Skip to content

Claude's answers, rendered: Markdown, math, charts and diagrams drawn in the Claude Code terminal. Independent project, not affiliated with Anthropic.

TypeScript claude-code-mod

Rename: the mod is cc-intelligent-ui; the repo is razorback16/cc-intelligent-ui

razorback162e55833f046a
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index f490f9d..8013502 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -4,5 +4,5 @@
"metadata": {
"description": "Intelligent UI: Claude's answers drawn as rendered Markdown in your terminal"
},
- "plugins": [{ "name": "intelligent-ui", "source": "./" }]
+ "plugins": [{ "name": "cc-intelligent-ui", "source": "./" }]
}
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index 217601c..f574961 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,14 +1,14 @@
{
- "name": "intelligent-ui",
+ "name": "cc-intelligent-ui",
"version": "0.1.0",
"description": "Draws Claude's answers as rendered Markdown pictures in the terminal, with live Typst for diagrams, charts and math",
"author": {
"name": "razorback16",
"url": "https://github.com/razorback16"
},
- "homepage": "https://github.com/razorback16/claude-intelligent-ui",
- "repository": "https://github.com/razorback16/claude-intelligent-ui",
- "documentationUrl": "https://github.com/razorback16/claude-intelligent-ui#readme",
+ "homepage": "https://github.com/razorback16/cc-intelligent-ui",
+ "repository": "https://github.com/razorback16/cc-intelligent-ui",
+ "documentationUrl": "https://github.com/razorback16/cc-intelligent-ui#readme",
"license": "MIT",
"keywords": [
"markdown",
diff --git a/README.md b/README.md
index c9fd1af..32ff1b8 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ brew install typst
Then, in Claude Code:
```
-/plugin install intelligent-ui --marketplace razorback16/claude-intelligent-ui
+/plugin install cc-intelligent-ui --marketplace razorback16/cc-intelligent-ui
```
It works at once, with no restart.
diff --git a/docs/development.md b/docs/development.md
index b251e12..cd7ef7b 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -5,8 +5,8 @@
## Build and test
```
-git clone https://github.com/razorback16/claude-intelligent-ui
-cd claude-intelligent-ui
+git clone https://github.com/razorback16/cc-intelligent-ui
+cd cc-intelligent-ui
claude --plugin-dir . # once: Claude Code writes the API types to .claude-plugin/types/
npx -p typescript tsc -p . # type check
claude plugin test . # tests
@@ -17,7 +17,7 @@ claude plugin validate .
## Debug log
-Set `IUI_DEBUG=1` before you start Claude Code. The mod then writes trace lines to `debug.log` in the cache folder (`${TMPDIR}/intelligent-ui-<uid>/`).
+Set `IUI_DEBUG=1` before you start Claude Code. The mod then writes trace lines to `debug.log` in the cache folder (`${TMPDIR}/cc-intelligent-ui-<uid>/`).
## Module layout
diff --git a/docs/how-it-works.md b/docs/how-it-works.md
index 77a358c..fd39480 100644
--- a/docs/how-it-works.md
+++ b/docs/how-it-works.md
@@ -9,7 +9,7 @@
3. The hook draws one `Image` per PNG, in place of the text.
4. Text size: the mod finds the terminal font (iTerm2 profile, Ghostty, kitty or Rio config, else Menlo metrics) and the cell size in pixels. Typst then measures both fonts so that 100% looks as large as the terminal text.
5. If a compile fails (a bad Typst block or an unknown LaTeX command), the mod compiles once more in safe mode: Typst blocks and math show as code. A dim line under the picture names the error. If that also fails, the normal text shows.
-6. Pictures are kept in `${TMPDIR}/intelligent-ui-<uid>/`. Folders older than 2 days are deleted at start. The drawing space of each answer at its first compile is kept in `~/.cache/intelligent-ui/designs`, so that its Typst drawings keep the same share of the screen in later sessions.
+6. Pictures are kept in `${TMPDIR}/cc-intelligent-ui-<uid>/`. Folders older than 2 days are deleted at start. The drawing space of each answer at its first compile is kept in `~/.cache/cc-intelligent-ui/designs`, so that its Typst drawings keep the same share of the screen in later sessions.
7. The plan: a `ui.render` hook on the ExitPlanMode `ToolUse` row draws the plan through the same steps. Claude Code shows that row above the approval question. The approved result row then shows only its header, so the plan does not show two times. A `tool.call` hook on ExitPlanMode asks the mod's question (`$.ui.ask`) before Claude Code asks for permission. Then a `classic.PermissionRequest` hook gives the answer to Claude Code at once, so the Claude Code dialog does not show. For an approval, the hook sends the plan (`updatedInput`) and the new permission mode (`setMode`). For the person's text, the `tool.call` hook refuses the call with that text.
8. Copy: one long-lived `perl` process watches the terminal size (at each SIGWINCH) and, on macOS, the clipboard. For the clipboard, it uses `/usr/bin/perl` with Apple's PerlObjCBridge and reads the change counter of the clipboard (`NSPasteboard changeCount`) every 0.3 s. This read is in the process and starts no other process (approximately 0.05% of one CPU core). The clipboard part starts only while the mod is on and after the mod drew its first picture in this session; then the mod starts the process again with the clipboard part (and again without it after `/iui off`). When the counter changes, the mod reads the clipboard one time (`pbpaste`). The first counter after a start is not a change, so an old clipboard is not copied. A picture cell holds its row and its column (kitty placeholder U+10EEEE plus two combining marks). The mod finds the drawn page that has these rows, at the size that it is drawn. Then it finds the position of each word on that page: it runs the probe (`typst query` on the same template, with the same inputs as the PNG compile, plus `probe=1` and `page=<n>`) for the selected pages only. The mod keeps the positions of the last 64 pages in memory. It writes nothing to disk for this, and the PNGs do not change. The mod takes the words in the selected cells. Immediately before it writes the text with `$.ui.copy`, it reads the clipboard again. If the clipboard has a newer copy, the mod does not write over it, and it reads that copy next. If the process stops, the mod starts it again after 1 s (3 times at most). At `/clear` or a resume, the process continues without the clipboard part. At other session ends (for example `/exit`), the mod stops the process and does not start a new one. A `ui.copy` hook also changes a copy with picture cells to the text.
diff --git a/docs/install.md b/docs/install.md
index eccd5cf..9d28323 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -28,7 +28,7 @@ Where pictures cannot draw, the mod shows the normal text. To see why a terminal
2. At the prompt of a Claude Code session in the terminal, type:
```
- /plugin install intelligent-ui --marketplace razorback16/claude-intelligent-ui
+ /plugin install cc-intelligent-ui --marketplace razorback16/cc-intelligent-ui
```
Answer `y` to add the marketplace, then push Enter to install for your user. The mod starts at once, with no restart.
@@ -36,7 +36,7 @@ Where pictures cannot draw, the mod shows the normal text. To see why a terminal
From a shell:
```
-claude plugin install intelligent-ui --marketplace razorback16/claude-intelligent-ui
+claude plugin install cc-intelligent-ui --marketplace razorback16/cc-intelligent-ui
```
## Try it from a clone
@@ -44,6 +44,6 @@ claude plugin install intelligent-ui --marketplace razorback16/claude-intelligen
To try it from a clone without installing:
```
-git clone https://github.com/razorback16/claude-intelligent-ui
-claude --plugin-dir /path/to/claude-intelligent-ui
+git clone https://github.com/razorback16/cc-intelligent-ui
+claude --plugin-dir /path/to/cc-intelligent-ui
```
diff --git a/docs/themes.md b/docs/themes.md
index 84abdf2..5cbf482 100644
--- a/docs/themes.md
+++ b/docs/themes.md
@@ -16,7 +16,7 @@ To change the theme, run `/iui theme <name>`. To list the themes, run `/iui them
## Make your own theme
-1. Make a folder: `~/.claude/intelligent-ui/themes/<name>/`.
+1. Make a folder: `~/.claude/cc-intelligent-ui/themes/<name>/`.
2. Put a `theme.json` in it. Write only the keys that you change. The mod merges your file over the base theme, `vscode` (not over the default, `claude-code`).
3. Run `/iui theme <name>`. You do not have to restart.
diff --git a/hooks/lib/env.ts b/hooks/lib/env.ts
index bf400b0..961e7ba 100644
--- a/hooks/lib/env.ts
+++ b/hooks/lib/env.ts
@@ -20,13 +20,13 @@ import { findTypst, measureFonts } from './typst'
// The `isOn` atom, which setUp turns off when the stored setting says so (a
// copy of its own: see state.ts).
-const isOn = atom({ plugin: 'intelligent-ui', key: 'isOn' } as const, true)
+const isOn = atom({ plugin: 'cc-intelligent-ui', key: 'isOn' } as const, true)
// Makes the cache folder, drops key folders not touched for 2 days, makes
// the designs folder (outside the tmp cache) and drops design files not
// touched for DESIGNS_KEPT_DAYS; prints the cache folder, the OS name and
// the designs folder.
-const CACHE_SH = `d="\${TMPDIR:-/tmp}"; d="\${d%/}/intelligent-ui-$(id -u)"; g="\${XDG_CACHE_HOME:-$HOME/.cache}/intelligent-ui/designs"; mkdir -p "$d" && chmod 700 "$d" && { find "$d" -mindepth 1 -maxdepth 1 -type d -mtime +2 ! -name pkg-cache -exec rm -rf {} + 2>/dev/null; mkdir -p "$g" 2>/dev/null && find "$g" -type f -mtime +${DESIGNS_KEPT_DAYS} -delete 2>/dev/null; printf '%s\\n%s\\n%s\\n' "$d" "$(uname -s)" "$g"; }`
+const CACHE_SH = `d="\${TMPDIR:-/tmp}"; d="\${d%/}/cc-intelligent-ui-$(id -u)"; g="\${XDG_CACHE_HOME:-$HOME/.cache}/cc-intelligent-ui/designs"; mkdir -p "$d" && chmod 700 "$d" && { find "$d" -mindepth 1 -maxdepth 1 -type d -mtime +2 ! -name pkg-cache -exec rm -rf {} + 2>/dev/null; mkdir -p "$g" 2>/dev/null && find "$g" -type f -mtime +${DESIGNS_KEPT_DAYS} -delete 2>/dev/null; printf '%s\\n%s\\n%s\\n' "$d" "$(uname -s)" "$g"; }`
// Once per load: the cache folder, Typst, the terminal and its font, the
// theme, the cell. A failed setup is tried again on the next call.
@@ -35,7 +35,7 @@ export function setUp($: EngineInterface): Promise<Env> {
await registerCommand($)
const made = await $.process.run(['sh', '-c', CACHE_SH]).catch(() => null)
const [made1 = '', os = '', made3 = ''] = (made?.stdout ?? '').split('\n')
- const cache = made1.trim() || '/tmp/intelligent-ui'
+ const cache = made1.trim() || '/tmp/cc-intelligent-ui'
// The key folders on disk now: a key found here is read back at once.
const listed = await $.fs.list(cache).catch(() => [])
S.onDisk = new Set(listed.filter(entry => entry.kind === 'dir' && entry.name !== 'pkg-cache').map(entry => entry.name))
@@ -98,7 +98,7 @@ export function setUp($: EngineInterface): Promise<Env> {
}
const termFont = await termFontOf($, program, isMac).catch(() => '')
const home = (await $.env.get('HOME')) ?? ''
- const designs = made3.trim() || (home ? `${home}/.cache/intelligent-ui/designs` : `${cache}/designs`)
+ const designs = made3.trim() || (home ? `${home}/.cache/cc-intelligent-ui/designs` : `${cache}/designs`)
const stored = await $.store.get('theme-name').catch(() => undefined)
const wanted = typeof stored === 'string' && stored ? stored : DEFAULT_THEME
const applied = await applyTheme($, root, home, wanted).catch(() => null)
diff --git a/hooks/lib/setup.ts b/hooks/lib/setup.ts
index 1ba02b6..6b52684 100644
--- a/hooks/lib/setup.ts
+++ b/hooks/lib/setup.ts
@@ -10,8 +10,8 @@ import { readText } from './host'
// $.env.set comes after its terminal check, too late). So the setup adds a
// marked block to the shell's start file that sets it in iTerm2 alone, not in
// tmux or screen (Claude Code cannot draw there).
-export const SETUP_START = '# >>> intelligent-ui: Claude Code pictures in iTerm2 >>>'
-export const SETUP_END = '# <<< intelligent-ui <<<'
+export const SETUP_START = '# >>> cc-intelligent-ui: Claude Code pictures in iTerm2 >>>'
+export const SETUP_END = '# <<< cc-intelligent-ui <<<'
export type ShellRc = { path: string; kind: 'sh' | 'fish' }
// The start file the setup writes for the login shell (`SHELL`); null for a
// shell it does not know. iTerm2 starts login shells: bash reads
@@ -20,7 +20,7 @@ export function shellRcOf(o: { shell: string; home: string; zdotdir?: string; xd
const name = o.shell.split('/').pop() ?? ''
if (name === 'zsh') return { path: `${o.zdotdir || o.home}/.zshrc`, kind: 'sh' }
if (name === 'bash') return { path: `${o.home}/${o.isMac ? '.bash_profile' : '.bashrc'}`, kind: 'sh' }
- if (name === 'fish') return { path: `${o.xdgConfig || `${o.home}/.config`}/fish/conf.d/intelligent-ui.fish`, kind: 'fish' }
+ if (name === 'fish') return { path: `${o.xdgConfig || `${o.home}/.config`}/fish/conf.d/cc-intelligent-ui.fish`, kind: 'fish' }
return null
}
export function setupBlock(kind: ShellRc['kind']): string {
diff --git a/hooks/lib/state.ts b/hooks/lib/state.ts
index 87ad591..1e20cb2 100644
--- a/hooks/lib/state.ts
+++ b/hooks/lib/state.ts
@@ -14,7 +14,7 @@ import { DEFAULT_HEIGHT, DEFAULT_SIZE, DEFAULT_WIDTH, type Height, type Width }
// `claude plugin validate` reads an atom only from a const in the file that
// reads or writes it, so each such file has a copy of its own (atom() is a
// plain description: the copies are one value).
-const done = atom({ plugin: 'intelligent-ui', key: 'done' } as const, 0)
+const done = atom({ plugin: 'cc-intelligent-ui', key: 'done' } as const, 0)
export type Cell = { width: number; height: number }
// The terminal now (one TIOCGWINSZ read): its columns, rows and cell in
diff --git a/hooks/lib/themes.ts b/hooks/lib/themes.ts
index 0c2de54..f753b82 100644
--- a/hooks/lib/themes.ts
+++ b/hooks/lib/themes.ts
@@ -101,7 +101,7 @@ export function themeListing(themes: ReadonlyMap<string, ThemeInfo>, problems: r
}
// The built-in themes under render/themes and the user's under
-// ~/.claude/intelligent-ui/themes, read fresh each call.
+// ~/.claude/cc-intelligent-ui/themes, read fresh each call.
export async function scanThemes($: EngineInterface, root: string, home: string) {
const found: (ThemeInfo | ThemeProblem)[] = []
for (const [base, isUser] of [[`${root}/render/themes`, false], [userThemesOf(home), true]] as const) {
@@ -129,7 +129,7 @@ export async function missingSyntax($: EngineInterface, theme: ThemeInfo) {
return lost
}
-export const userThemesOf = (home: string) => `${home || '~'}/.claude/intelligent-ui/themes`
+export const userThemesOf = (home: string) => `${home || '~'}/.claude/cc-intelligent-ui/themes`
// The mtimes of the files a theme's pictures depend on (themeFiles): a
// change to any of them makes new keys.
diff --git a/hooks/register.tsx b/hooks/register.tsx
index 40fbcd0..8d3124c 100644
--- a/hooks/register.tsx
+++ b/hooks/register.tsx
@@ -86,8 +86,8 @@ export {
} from './lib/plan'
// The atoms the hooks read and write (a copy of each in this file: see state.ts).
-const isOn = atom({ plugin: 'intelligent-ui', key: 'isOn' } as const, true)
-const done = atom({ plugin: 'intelligent-ui', key: 'done' } as const, 0)
+const isOn = atom({ plugin: 'cc-intelligent-ui', key: 'isOn' } as const, true)
+const done = atom({ plugin: 'cc-intelligent-ui', key: 'done' } as const, 0)
// ---- Pictures under rows ----------------------------------------------------
@@ -554,7 +554,7 @@ export const register: Register = on => {
if (!e.surfaces.includes('terminal') || !(await read($, isOn))) return composed
const ready = S.env ?? (await setUp($).catch(() => null))
if (!ready?.typst || !ready.canDraw) return composed
- return { sections: [...composed.sections, { id: 'intelligent-ui:typst', text: TYPST_PROMPT, scope: 'session' as const }] }
+ return { sections: [...composed.sections, { id: 'cc-intelligent-ui:typst', text: TYPST_PROMPT, scope: 'session' as const }] }
})
// A main-loop model request: its text blocks are final when the next block
diff --git a/outcomes/frame.typ b/outcomes/frame.typ
index b357725..682a714 100644
--- a/outcomes/frame.typ
+++ b/outcomes/frame.typ
@@ -48,7 +48,7 @@
mascot(0.42pt, rgb("#d77757"), c.eye),
[*Claude Code* #text(fill: c.dim)[v2.1.301] \
#text(fill: c.dim)[Opus 5.5 with high effort · Claude Max] \
- #text(fill: c.dim)[\~/projects/intelligent-ui ·] #text(fill: c.green)[/rc]])
+ #text(fill: c.dim)[\~/projects/cc-intelligent-ui ·] #text(fill: c.green)[/rc]])
#v(14pt)
#block(width: 100%, fill: c.ask-bg, inset: (x: 4pt, y: 4pt), below: 0pt)[❯ #ask]
#v(12pt)
diff --git a/outcomes/samples/1-overview.md b/outcomes/samples/1-overview.md
index c790acd..62e2cfc 100644
--- a/outcomes/samples/1-overview.md
+++ b/outcomes/samples/1-overview.md
@@ -4,7 +4,7 @@ Here is one answer with everything Intelligent UI draws:
## Real documents, not raw text
-Claude's answers arrive with **headings**, *emphasis*, `inline code`, [links](https://github.com/razorback16/claude-intelligent-ui) and pictures like the one above.
+Claude's answers arrive with **headings**, *emphasis*, `inline code`, [links](https://github.com/razorback16/cc-intelligent-ui) and pictures like the one above.
| Element | You write | You see |
|:--|:--|:--:|
diff --git a/render/themes/README.md b/render/themes/README.md
index 89e33e3..9d69aaa 100644
--- a/render/themes/README.md
+++ b/render/themes/README.md
@@ -8,7 +8,7 @@ A theme is a folder with a `theme.json`. Intelligent UI ships three:
| `vscode-modern` | VS Code Modern | VS Code's Markdown preview, Dark Modern / Light Modern |
| `vscode` | VS Code | the same, with the Dark+ / Light+ colours; every theme merges over this one |
-Your own themes go in `~/.claude/intelligent-ui/themes/<name>/theme.json`. A theme there with the same folder name as a built-in one is used in its place. It is still merged over the built-in `vscode`, like every theme. Choose a theme with `/iui theme <name>`.
+Your own themes go in `~/.claude/cc-intelligent-ui/themes/<name>/theme.json`. A theme there with the same folder name as a built-in one is used in its place. It is still merged over the built-in `vscode`, like every theme. Choose a theme with `/iui theme <name>`.
## Merging
diff --git a/tests/copy.test.ts b/tests/copy.test.ts
index 6638602..c020a13 100644
--- a/tests/copy.test.ts
+++ b/tests/copy.test.ts
@@ -407,7 +407,7 @@ function world(on: any, o: { failFirst?: boolean; noBridge?: boolean } = {}) {
killers.get(argv[1]!)?.()
return ok('')
}
- if (/intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
+ if (/cc-intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
if (cmd.includes('command -v typst')) return ok('/usr/bin/typst\n')
if (argv[0] === '/usr/bin/typst' && argv[1] === 'eval') return ok('{}')
if (cmd.includes('od -An')) return ok(argv.filter(a => a.endsWith('.png')).map(() => `${HEAD}\n@\n`).join(''))
@@ -445,7 +445,7 @@ function world(on: any, o: { failFirst?: boolean; noBridge?: boolean } = {}) {
const message = (requestId: string, text: string) =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
props: { text, isFirstOfReply: true }, viewport: { columns: 100, rows: 40 },
}) as any
const props = (text: string) => ({ text, isFirstOfReply: true }) as any
diff --git a/tests/draw.test.ts b/tests/draw.test.ts
index 43af218..0a79b26 100644
--- a/tests/draw.test.ts
+++ b/tests/draw.test.ts
@@ -175,7 +175,7 @@ function world(on: any, vars: Record<string, string>, head = HEAD, stored: Recor
logs.push(e.init?.stdin ?? '')
return ok('')
}
- if (/intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
+ if (/cc-intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
if (cmd.includes('command -v typst')) return ok('/usr/bin/typst\n')
if (argv[0] === '/usr/bin/typst' && argv[1] === 'eval') return ok('{}')
if (cmd.includes('od -An')) return ok(`${head}\n@\n`)
@@ -215,7 +215,7 @@ function world(on: any, vars: Record<string, string>, head = HEAD, stored: Recor
const ENGINE = { type: 'Text', props: {}, children: ['engine drawing'] }
const message = (requestId: string, text: string) =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
props: { text, isFirstOfReply: true }, viewport: { columns: 100, rows: 40 },
}) as any
const props = (text: string) => ({ text, isFirstOfReply: true }) as any
diff --git a/tests/images.test.ts b/tests/images.test.ts
index 981d9fe..986e556 100644
--- a/tests/images.test.ts
+++ b/tests/images.test.ts
@@ -275,7 +275,7 @@ function world(on: any, o: {
const argv: string[] = e.argv
const cmd = argv.join(' ')
if (argv[0] === 'kill') return ok('')
- if (/intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
+ if (/cc-intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
if (argv[0] === 'id' && argv[1] === '-u') return ok('501\n')
if (cmd.includes('command -v typst')) return o.typst ? ok('/usr/bin/typst\n') : ok('', 1)
if (argv[0] === '/usr/bin/typst' && argv[1] === 'eval') return ok('{}')
@@ -342,7 +342,7 @@ function world(on: any, o: {
const sent = (output: unknown, isErrored = false, id = 'tu-1') =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'ToolResult', requestId: id,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'ToolResult', requestId: id,
props: { tool_use_id: id, tool: 'SendUserFile', output, isErrored }, viewport: { columns: 100, rows: 40 },
}) as any
const attach = (path: string, isImage = true) => ({ attachments: [{ path, size: 1000, isImage, ...(isImage ? { media_type: 'image/png' } : {}) }] })
@@ -350,7 +350,7 @@ const attach = (path: string, isImage = true) => ({ attachments: [{ path, size:
const attachAll = (...paths: string[]) => ({ attachments: paths.map(path => ({ path, size: 1000, isImage: /\.(png|jpe?g|webp)$/i.test(path) })) })
const prompt = (text: string, origin: any = { kind: 'composer' }, id = 'u-1') =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'UserMessage', requestId: id,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'UserMessage', requestId: id,
props: { text, origin, isExpanded: true }, viewport: { columns: 100, rows: 40 },
}) as any
const images = (tree: any): any[] =>
@@ -576,7 +576,7 @@ test('the same Markdown in two folders compiles twice; an answer still uses the
await a.redraw(sent(attachAll('/t/a/n.md'), false, 'tu-a').props)
await b.redraw(sent(attachAll('/t/b/n.md'), false, 'tu-b').props)
expect(images(await a.drawn())[0].props.source.file).not.toBe(images(await b.drawn())[0].props.source.file)
- const answer = { plugin: 'intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId: 'r-1', props: { text: '# Same', isFirstOfReply: true }, viewport: { columns: 100, rows: 40 } } as any
+ const answer = { plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId: 'r-1', props: { text: '# Same', isFirstOfReply: true }, viewport: { columns: 100, rows: 40 } } as any
await $.ui.mount(answer)
await clock.settle()
expect(docs.map(d => d.base)).toEqual(['/t/a', '/t/b', '/w/app'])
diff --git a/tests/mode.test.ts b/tests/mode.test.ts
index d1afba3..eae1c43 100644
--- a/tests/mode.test.ts
+++ b/tests/mode.test.ts
@@ -11,7 +11,7 @@ test('with the theme on auto, the mode comes from the OS appearance, read every
on('config.set', async ($: any, e: any) => ({ value: e.value }))
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
- if (argv[0] === 'sh' && /intelligent-ui-/.test(argv.join(' '))) return { value: { exitCode: 0, stdout: '/tmp/mdp\nDarwin\n', stderr: '', isStdoutTruncated: false, isStderrTruncated: false } }
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(argv.join(' '))) return { value: { exitCode: 0, stdout: '/tmp/mdp\nDarwin\n', stderr: '', isStdoutTruncated: false, isStderrTruncated: false } }
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) {
reads.push('macOS')
return { value: osDark
@@ -83,7 +83,7 @@ test('with the theme on auto, a dark iTerm2 profile on a light Mac draws dark',
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
const cmd = argv.join(' ')
- if (argv[0] === 'sh' && /intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'sh' && cmd.includes('TabStyleWithAutomaticOption')) return ok(`${style}@\nG1\n@\n${marks}\n`)
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return ok('', 1)
return next(e)
@@ -110,7 +110,7 @@ test('with the theme on auto, Ghostty draws as its background is', async ($, on)
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
const cmd = argv.join(' ')
- if (argv[0] === 'sh' && /intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'sh' && cmd.includes('+show-config')) return ok(config)
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return osDark ? ok('Dark\n') : ok('', 1)
return next(e)
@@ -138,7 +138,7 @@ test('with the theme on auto, kitty draws as its config or auto theme is', async
const ok = (stdout: string, exitCode = 0) => ({ value: { exitCode, stdout, stderr: '', isStdoutTruncated: false, isStderrTruncated: false } })
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
- if (argv[0] === 'sh' && /intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return osDark ? ok('Dark\n') : ok('', 1)
return next(e)
})
@@ -171,7 +171,7 @@ test('with the theme on auto, Rio draws as its adaptive theme is', async ($, on)
const ok = (stdout: string, exitCode = 0) => ({ value: { exitCode, stdout, stderr: '', isStdoutTruncated: false, isStderrTruncated: false } })
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
- if (argv[0] === 'sh' && /intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return ok('Dark\n')
return next(e)
})
@@ -201,7 +201,7 @@ for (const colorFgBg of [undefined, '0;15']) {
const ok = (stdout: string, exitCode = 0) => ({ value: { exitCode, stdout, stderr: '', isStdoutTruncated: false, isStderrTruncated: false } })
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
- if (argv[0] === 'sh' && /intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(argv.join(' '))) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) {
asked.push('macOS')
return ok('', 1)
@@ -230,7 +230,7 @@ test('with the theme on auto, cmux draws as its appearance is', async ($, on) =>
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
const cmd = argv.join(' ')
- if (argv[0] === 'sh' && /intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'sh' && cmd.includes('+show-config')) return ok('font-family = Menlo\n')
if (argv[0] === 'defaults' && argv.includes('com.cmuxterm.app')) return ok(saved)
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return ok('', 1)
@@ -281,7 +281,7 @@ test('with the theme on auto, iTerm2 with no TERM_PROGRAM is found by ITERM_PROF
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
const cmd = argv.join(' ')
- if (argv[0] === 'sh' && /intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
+ if (argv[0] === 'sh' && /cc-intelligent-ui-/.test(cmd)) return ok('/tmp/mdp\nDarwin\n')
if (argv[0] === 'sh' && cmd.includes('TabStyleWithAutomaticOption')) return ok(`1\n@\nG1\n@\n${marks}\n`)
if (argv[0] === 'defaults' && argv.includes('AppleInterfaceStyle')) return ok('', 1)
return next(e)
diff --git a/tests/plan.test.ts b/tests/plan.test.ts
index 238813d..167e941 100644
--- a/tests/plan.test.ts
+++ b/tests/plan.test.ts
@@ -157,7 +157,7 @@ function world($: any, on: any, o: {
const argv: string[] = e.argv
const cmd = argv.join(' ')
if (argv[0] === 'kill') return ok('')
- if (/intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
+ if (/cc-intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
if (cmd.includes('command -v typst')) return ok('/usr/bin/typst\n')
if (cmd.includes('command -v code')) return o.code ? ok('/usr/local/bin/code\n') : ok('', 1)
if (argv[0] === '/usr/bin/typst' && argv[1] === 'eval') return ok('{}')
@@ -219,7 +219,7 @@ function world($: any, on: any, o: {
const use = (o: { id?: string; input?: unknown; output?: unknown; isRunning?: boolean; isErrored?: boolean } = {}) =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'ToolUse', requestId: o.id ?? 'tu-plan',
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'ToolUse', requestId: o.id ?? 'tu-plan',
props: {
tool_use_id: o.id ?? 'tu-plan', tool: 'ExitPlanMode', input: o.input ?? { plan: PLAN, planFilePath: FILE },
isRunning: o.isRunning ?? true, isErrored: o.isErrored ?? false, isInterrupted: false, output: o.output,
@@ -228,12 +228,12 @@ const use = (o: { id?: string; input?: unknown; output?: unknown; isRunning?: bo
}) as any
const result = (output: unknown, isErrored = false, id = 'tu-plan') =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'ToolResult', requestId: id,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'ToolResult', requestId: id,
props: { tool_use_id: id, tool: 'ExitPlanMode', output, isErrored }, viewport: { columns: 100, rows: 40 },
}) as any
const dialog = (question: string, header = PLAN_HEADER, id = 'tu-ask') =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'AskUserQuestion', requestId: id,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'AskUserQuestion', requestId: id,
props: { tool: 'AskUserQuestion', questions: [{ question, header, options: [{ label: 'A', description: '' }, { label: 'B', description: '' }], multiSelect: false }] },
viewport: { columns: 100, rows: 40 },
}) as any
diff --git a/tests/pure.test.ts b/tests/pure.test.ts
index b1424d8..94e9f77 100644
--- a/tests/pure.test.ts
+++ b/tests/pure.test.ts
@@ -473,22 +473,22 @@ test('a theme folder is usable only with a theme.json object', () => {
test('a user theme replaces the built-in one of its name; a broken one is only reported', () => {
const found = [
- themeEntry('nord', '/home/.claude/intelligent-ui/themes/nord', true, '{"description":"mine"}'),
+ themeEntry('nord', '/home/.claude/cc-intelligent-ui/themes/nord', true, '{"description":"mine"}'),
themeEntry('vscode', '/mod/render/themes/vscode', false, '{"name":"VS Code"}'),
themeEntry('nord', '/mod/render/themes/nord', false, '{"description":"built-in"}'),
- themeEntry('vscode', '/home/.claude/intelligent-ui/themes/vscode', true, '{not json'),
- themeEntry('solar', '/home/.claude/intelligent-ui/themes/solar', true, '[1]'),
+ themeEntry('vscode', '/home/.claude/cc-intelligent-ui/themes/vscode', true, '{not json'),
+ themeEntry('solar', '/home/.claude/cc-intelligent-ui/themes/solar', true, '[1]'),
]
const { themes, problems } = pickThemes(found)
expect([...themes.keys()].sort()).toEqual(['nord', 'vscode'])
expect(themes.get('nord')).toMatchObject({ isUser: true, description: 'mine' })
expect(themes.get('vscode')).toMatchObject({ isUser: false, dir: '/mod/render/themes/vscode' })
expect(problems.map(p => p.name).sort()).toEqual(['solar', 'vscode'])
- const listing = themeListing(themes, problems, 'nord', '/home/.claude/intelligent-ui/themes')
+ const listing = themeListing(themes, problems, 'nord', '/home/.claude/cc-intelligent-ui/themes')
expect(listing).toContain('* nord (user): mine')
expect(listing).toContain('- vscode (built-in)')
expect(listing).toContain('skipped solar (user)')
- expect(listing).toContain('/home/.claude/intelligent-ui/themes/<name>/theme.json')
+ expect(listing).toContain('/home/.claude/cc-intelligent-ui/themes/<name>/theme.json')
})
test('a missing theme falls back to the base theme, even before it is on disk', () => {
diff --git a/tests/render.test.ts b/tests/render.test.ts
index 8cc89e3..a6e15b2 100644
--- a/tests/render.test.ts
+++ b/tests/render.test.ts
@@ -5,7 +5,7 @@ const ENGINE = { type: 'Text', props: {}, children: ['engine drawing'] }
const message = (requestId: string, props: Record<string, unknown>) =>
({
- plugin: 'intelligent-ui',
+ plugin: 'cc-intelligent-ui',
surface: 'terminal',
component: 'AssistantMessage',
requestId,
diff --git a/tests/setup.test.ts b/tests/setup.test.ts
index 9ffa74c..0bc5f45 100644
--- a/tests/setup.test.ts
+++ b/tests/setup.test.ts
@@ -7,7 +7,7 @@ test('the setup writes the start file of the login shell', () => {
expect(shellRcOf({ shell: '/bin/zsh', home: '/h', zdotdir: '/z', isMac: true })!.path).toBe('/z/.zshrc')
expect(shellRcOf({ shell: '/bin/bash', home: '/h', isMac: true })!.path).toBe('/h/.bash_profile')
expect(shellRcOf({ shell: '/bin/bash', home: '/h', isMac: false })!.path).toBe('/h/.bashrc')
- expect(shellRcOf({ shell: '/opt/homebrew/bin/fish', home: '/h', isMac: true })).toEqual({ path: '/h/.config/fish/conf.d/intelligent-ui.fish', kind: 'fish' })
+ expect(shellRcOf({ shell: '/opt/homebrew/bin/fish', home: '/h', isMac: true })).toEqual({ path: '/h/.config/fish/conf.d/cc-intelligent-ui.fish', kind: 'fish' })
expect(shellRcOf({ shell: '/bin/tcsh', home: '/h', isMac: true })).toBe(null)
})
@@ -55,7 +55,7 @@ const iterm = (on: any, files: Record<string, string>, answer: string | null) =>
on('ui.toast', async ($: any, e: any) => (toasts.push(e.text), { value: undefined }))
on('ui.log', async ($: any, e: any) => (logs.push(e.text), { value: undefined }))
on('process.run', async ($: any, e: any, next: any) =>
- e.argv[0] === 'sh' && /intelligent-ui-/.test(e.argv.join(' '))
+ e.argv[0] === 'sh' && /cc-intelligent-ui-/.test(e.argv.join(' '))
? { value: { exitCode: 0, stdout: '/tmp/mdp\nDarwin\n', stderr: '', isStdoutTruncated: false, isStderrTruncated: false } }
: next(e))
on('fs.read', async ($: any, e: any, next: any) => (e.path in files ? { value: files[e.path] } : e.path.startsWith('/h/') ? { deny: 'no such file' } : next(e)))
diff --git a/tests/stream.test.ts b/tests/stream.test.ts
index 3eb73d7..29d9401 100644
--- a/tests/stream.test.ts
+++ b/tests/stream.test.ts
@@ -30,7 +30,7 @@ function world(on: any, o: { fail?: boolean; slow?: Promise<void>; tall?: boolea
on('process.run', async ($: any, e: any, next: any) => {
const argv: string[] = e.argv
const cmd = argv.join(' ')
- if (/intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
+ if (/cc-intelligent-ui-/.test(cmd)) return ok('/c\nDarwin\n')
if (cmd.includes('command -v typst')) return ok('/usr/bin/typst\n')
if (argv[0] === '/usr/bin/typst' && argv[1] === 'eval') return ok('{}')
if (argv[0] === 'kill') return ok('')
@@ -73,7 +73,7 @@ function world(on: any, o: { fail?: boolean; slow?: Promise<void>; tall?: boolea
const message = (requestId: string, text: string) =>
({
- plugin: 'intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
+ plugin: 'cc-intelligent-ui', surface: 'terminal', component: 'AssistantMessage', requestId,
props: { text, isFirstOfReply: true }, viewport: { columns: 100, rows: 40 },
}) as any
const props = (text: string) => ({ text, isFirstOfReply: true }) as any
diff --git a/tests/themes.test.ts b/tests/themes.test.ts
index 7426922..4bb8f0c 100644
--- a/tests/themes.test.ts
+++ b/tests/themes.test.ts
@@ -1,9 +1,9 @@
import { expect, mock, test } from 'claude-code/testing'
// A theme tree in memory: built-in themes under the mod's render/themes, user
-// themes under $HOME/.claude/intelligent-ui/themes.
+// themes under $HOME/.claude/cc-intelligent-ui/themes.
const HOME = '/fake-home'
-const USER = `${HOME}/.claude/intelligent-ui/themes`
+const USER = `${HOME}/.claude/cc-intelligent-ui/themes`
const files: Record<string, string> = {
'render/themes/vscode/theme.json': '{"name":"VS Code","description":"built-in look"}',
'render/themes/vscode-modern/theme.json': '{"name":"VS Code Modern","description":"modern look"}',
diff --git a/types/index.d.ts b/types/index.d.ts
index 446f9af..87ce264 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -3,7 +3,7 @@ export type IuiTheme = 'dark' | 'light'
declare module 'claude-code' {
interface PluginState {
- 'intelligent-ui': {
+ 'cc-intelligent-ui': {
// Whether answers are drawn as pictures (also kept in $.store as `enabled`).
isOn: boolean
// Goes up each time a render finishes or the setup changes, so the