diff --git a/.gitignore b/.gitignore
index ffb72ea..abc4fca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,13 +23,13 @@ packages/*/dist-firefox/
.npm/
coverage/
.nyc_output/
-.companion_config/
+.clanker_config/
tui-debug.log
compaction-results/
.opencode/
syntax.jsonl
out.jsonl
-companion-*.html
+clanker-*.html
out.html
packages/coding-agent/binaries/
todo.md
diff --git a/AGENTS.md b/AGENTS.md
index e0a4f49..292db0b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -71,29 +71,29 @@ When closing issues via commit:
- GitHub CLI for issues/PRs
- Add package labels to issues/PRs: pkg:agent, pkg:ai, pkg:coding-agent, pkg:mom, pkg:pods, pkg:tui, pkg:web-ui
-## Testing companion Interactive Mode with tmux
+## Testing clanker Interactive Mode with tmux
-To test companion's TUI in a controlled terminal environment:
+To test clanker's TUI in a controlled terminal environment:
```bash
# Create tmux session with specific dimensions
-tmux new-session -d -s companion-test -x 80 -y 24
+tmux new-session -d -s clanker-test -x 80 -y 24
-# Start companion from source
-tmux send-keys -t companion-test "cd /Users/badlogic/workspaces/companion-mono && ./companion-test.sh" Enter
+# Start clanker from source
+tmux send-keys -t clanker-test "cd /Users/badlogic/workspaces/clanker-agent && ./clanker-test.sh" Enter
# Wait for startup, then capture output
-sleep 3 && tmux capture-pane -t companion-test -p
+sleep 3 && tmux capture-pane -t clanker-test -p
# Send input
-tmux send-keys -t companion-test "your prompt here" Enter
+tmux send-keys -t clanker-test "your prompt here" Enter
# Send special keys
-tmux send-keys -t companion-test Escape
-tmux send-keys -t companion-test C-o # ctrl+o
+tmux send-keys -t clanker-test Escape
+tmux send-keys -t clanker-test C-o # ctrl+o
# Cleanup
-tmux kill-session -t companion-test
+tmux kill-session -t clanker-test
```
## Style
@@ -127,8 +127,8 @@ Use these sections under `## [Unreleased]`:
### Attribution
-- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/badlogic/companion-mono/issues/123))`
-- **External contributions**: `Added feature X ([#456](https://github.com/badlogic/companion-mono/pull/456) by [@username](https://github.com/username))`
+- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/badlogic/clanker-agent/issues/123))`
+- **External contributions**: `Added feature X ([#456](https://github.com/badlogic/clanker-agent/pull/456) by [@username](https://github.com/username))`
## Adding a New LLM Provider (packages/ai)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 94f1cdf..f38fb84 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,4 @@
-# Contributing to companion
+# Contributing to clanker-agent
Thanks for wanting to contribute! This guide exists to save both of us time.
@@ -8,7 +8,7 @@ Thanks for wanting to contribute! This guide exists to save both of us time.
Using AI to write code is fine. You can gain understanding by interrogating an agent with access to the codebase until you grasp all edge cases and effects of your changes. What's not fine is submitting agent-generated slop without that understanding.
-If you use an agent, run it from the `companion` root directory so it picks up `AGENTS.md` automatically. Your agent must follow the rules and guidelines in that file.
+If you use an agent, run it from the `clanker` root directory so it picks up `AGENTS.md` automatically. Your agent must follow the rules and guidelines in that file.
## First-Time Contributors
@@ -35,7 +35,7 @@ If you're adding a new provider to `packages/ai`, see `AGENTS.md` for required t
## Philosophy
-companion's core is minimal. If your feature doesn't belong in the core, it should be an extension. PRs that bloat the core will likely be rejected.
+clanker's core is minimal. If your feature doesn't belong in the core, it should be an extension. PRs that bloat the core will likely be rejected.
## Questions?
diff --git a/README.md b/README.md
index 98476ad..3a517b4 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,33 @@
-Companion is a minimal terminal coding harness. Adapt companion to your workflows, not the other way around, without having to fork and modify companion internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Companion Packages](#companion-packages) and share them with others via npm or git.
+Clanker is a minimal terminal coding harness. Adapt clanker to your workflows, not the other way around, without having to fork and modify clanker internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Clanker Packages](#clanker-packages) and share them with others via npm or git.
-Companion ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask companion to build what you want or install a third party companion package that matches your workflow.
+Clanker ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask clanker to build what you want or install a third party clanker package that matches your workflow.
-Companion runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [openclaw/openclaw](https://github.com/openclaw/openclaw) for a real-world SDK integration.
+Clanker runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [openclaw/openclaw](https://github.com/openclaw/openclaw) for a real-world SDK integration.
## Table of Contents
@@ -39,7 +39,7 @@ Companion runs in four modes: interactive, print or JSON, RPC for process integr
- [Skills](#skills)
- [Extensions](#extensions)
- [Themes](#themes)
- - [Companion Packages](#companion-packages)
+ - [Clanker Packages](#clanker-packages)
- [Programmatic Usage](#programmatic-usage)
- [Philosophy](#philosophy)
- [CLI Reference](#cli-reference)
@@ -49,24 +49,24 @@ Companion runs in four modes: interactive, print or JSON, RPC for process integr
## Quick Start
```bash
-npm install -g @mariozechner/companion-coding-agent
+npm install -g @mariozechner/clanker-coding-agent
```
Authenticate with an API key:
```bash
export ANTHROPIC_API_KEY=sk-ant-...
-companion
+clanker
```
Or use your existing subscription:
```bash
-companion
+clanker
/login # Then select provider
```
-Then just talk to companion. By default, companion gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [companion packages](#companion-packages).
+Then just talk to clanker. By default, clanker gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [clanker packages](#clanker-packages).
**Platform notes:** [Windows](docs/windows.md) | [Termux (Android)](docs/termux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
@@ -74,7 +74,7 @@ Then just talk to companion. By default, companion gives the model four tools: `
## Providers & Models
-For each built-in provider, companion maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
+For each built-in provider, clanker maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
**Subscriptions:**
@@ -107,7 +107,7 @@ For each built-in provider, companion maintains a list of tool-capable models, u
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
-**Custom providers & models:** Add providers via `~/.companion/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
+**Custom providers & models:** Add providers via `~/.clanker/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
---
@@ -159,11 +159,11 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
| `/reload` | Reload extensions, skills, prompts, context files (themes hot-reload automatically) |
| `/hotkeys` | Show all keyboard shortcuts |
| `/changelog` | Display version history |
-| `/quit`, `/exit` | Quit companion |
+| `/quit`, `/exit` | Quit clanker |
### Keyboard Shortcuts
-See `/hotkeys` for the full list. Customize via `~/.companion/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
+See `/hotkeys` for the full list. Customize via `~/.clanker/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
**Commonly used:**
@@ -198,13 +198,13 @@ Sessions are stored as JSONL files with a tree structure. Each entry has an `id`
### Management
-Sessions auto-save to `~/.companion/agent/sessions/` organized by working directory.
+Sessions auto-save to `~/.clanker/agent/sessions/` organized by working directory.
```bash
-companion -c # Continue most recent session
-companion -r # Browse and select from past sessions
-companion --no-session # Ephemeral mode (don't save)
-companion --session # Use specific session file or ID
+clanker -c # Continue most recent session
+clanker -r # Browse and select from past sessions
+clanker --no-session # Ephemeral mode (don't save)
+clanker --session # Use specific session file or ID
```
### Branching
@@ -237,8 +237,8 @@ Use `/settings` to modify common options, or edit JSON files directly:
| Location | Scope |
| --------------------------- | -------------------------- |
-| `~/.companion/agent/settings.json` | Global (all projects) |
-| `.companion/settings.json` | Project (overrides global) |
+| `~/.clanker/agent/settings.json` | Global (all projects) |
+| `.clanker/settings.json` | Project (overrides global) |
See [docs/settings.md](docs/settings.md) for all options.
@@ -246,9 +246,9 @@ See [docs/settings.md](docs/settings.md) for all options.
## Context Files
-Companion loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
+Clanker loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
-- `~/.companion/agent/AGENTS.md` (global)
+- `~/.clanker/agent/AGENTS.md` (global)
- Parent directories (walking up from cwd)
- Current directory
@@ -256,7 +256,7 @@ Use for project instructions, conventions, common commands. All matching files a
### System Prompt
-Replace the default system prompt with `.companion/SYSTEM.md` (project) or `~/.companion/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
+Replace the default system prompt with `.clanker/SYSTEM.md` (project) or `~/.clanker/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
---
@@ -267,20 +267,20 @@ Replace the default system prompt with `.companion/SYSTEM.md` (project) or `~/.c
Reusable prompts as Markdown files. Type `/name` to expand.
```markdown
-
+
Review this code for bugs, security issues, and performance problems.
Focus on: {{focus}}
```
-Place in `~/.companion/agent/prompts/`, `.companion/prompts/`, or a [companion package](#companion-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
+Place in `~/.clanker/agent/prompts/`, `.clanker/prompts/`, or a [clanker package](#clanker-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
### Skills
On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
```markdown
-
+
# My Skill
@@ -292,19 +292,19 @@ Use this skill when the user asks about X.
2. Then that
```
-Place in `~/.companion/agent/skills/`, `~/.agents/skills/`, `.companion/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [companion package](#companion-packages) to share with others. See [docs/skills.md](docs/skills.md).
+Place in `~/.clanker/agent/skills/`, `~/.agents/skills/`, `.clanker/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [clanker package](#clanker-packages) to share with others. See [docs/skills.md](docs/skills.md).
### Extensions
-TypeScript modules that extend companion with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
+TypeScript modules that extend clanker with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
```typescript
-export default function (companion: ExtensionAPI) {
- companion.registerTool({ name: "deploy", ... });
- companion.registerCommand("stats", { ... });
- companion.on("tool_call", async (event, ctx) => { ... });
+export default function (clanker: ExtensionAPI) {
+ clanker.registerTool({ name: "deploy", ... });
+ clanker.registerCommand("stats", { ... });
+ clanker.on("tool_call", async (event, ctx) => { ... });
}
```
@@ -319,50 +319,50 @@ export default function (companion: ExtensionAPI) {
- Git checkpointing and auto-commit
- SSH and sandbox execution
- MCP server integration
-- Make companion look like Claude Code
+- Make clanker look like Claude Code
- Games while waiting (yes, Doom runs)
- ...anything you can dream up
-Place in `~/.companion/agent/extensions/`, `.companion/extensions/`, or a [companion package](#companion-packages) to share with others. See [docs/extensions.md](docs/extensions.md).
+Place in `~/.clanker/agent/extensions/`, `.clanker/extensions/`, or a [clanker package](#clanker-packages) to share with others. See [docs/extensions.md](docs/extensions.md).
### Themes
-Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and companion immediately applies changes.
+Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and clanker immediately applies changes.
-Place in `~/.companion/agent/themes/`, `.companion/themes/`, or a [companion package](#companion-packages) to share with others. See [docs/themes.md](docs/themes.md).
+Place in `~/.clanker/agent/themes/`, `.clanker/themes/`, or a [clanker package](#clanker-packages) to share with others. See [docs/themes.md](docs/themes.md).
-### Companion Packages
+### Clanker Packages
-Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Acompanion-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
+Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Aclanker-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
-> **Security:** Companion packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
+> **Security:** Clanker packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
```bash
-companion install npm:@foo/companion-tools
-companion install npm:@foo/companion-tools@1.2.3 # pinned version
-companion install git:github.com/user/repo
-companion install git:github.com/user/repo@v1 # tag or commit
-companion install git:git@github.com:user/repo
-companion install git:git@github.com:user/repo@v1 # tag or commit
-companion install https://github.com/user/repo
-companion install https://github.com/user/repo@v1 # tag or commit
-companion install ssh://git@github.com/user/repo
-companion install ssh://git@github.com/user/repo@v1 # tag or commit
-companion remove npm:@foo/companion-tools
-companion list
-companion update # skips pinned packages
-companion config # enable/disable extensions, skills, prompts, themes
+clanker install npm:@foo/clanker-tools
+clanker install npm:@foo/clanker-tools@1.2.3 # pinned version
+clanker install git:github.com/user/repo
+clanker install git:github.com/user/repo@v1 # tag or commit
+clanker install git:git@github.com:user/repo
+clanker install git:git@github.com:user/repo@v1 # tag or commit
+clanker install https://github.com/user/repo
+clanker install https://github.com/user/repo@v1 # tag or commit
+clanker install ssh://git@github.com/user/repo
+clanker install ssh://git@github.com/user/repo@v1 # tag or commit
+clanker remove npm:@foo/clanker-tools
+clanker list
+clanker update # skips pinned packages
+clanker config # enable/disable extensions, skills, prompts, themes
```
-Packages install to `~/.companion/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.companion/git/`, `.companion/npm/`).
+Packages install to `~/.clanker/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.clanker/git/`, `.clanker/npm/`).
-Create a package by adding a `companion` key to `package.json`:
+Create a package by adding a `clanker` key to `package.json`:
```json
{
- "name": "my-companion-package",
- "keywords": ["companion-package"],
- "companion": {
+ "name": "my-clanker-package",
+ "keywords": ["clanker-package"],
+ "clanker": {
"extensions": ["./extensions"],
"skills": ["./skills"],
"prompts": ["./prompts"],
@@ -371,7 +371,7 @@ Create a package by adding a `companion` key to `package.json`:
}
```
-Without a `companion` manifest, companion auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
+Without a `clanker` manifest, clanker auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
See [docs/packages.md](docs/packages.md).
@@ -387,7 +387,7 @@ import {
createAgentSession,
ModelRegistry,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
sessionManager: SessionManager.inMemory(),
@@ -405,7 +405,7 @@ See [docs/sdk.md](docs/sdk.md).
For non-Node.js integrations, use RPC mode over stdin/stdout:
```bash
-companion --mode rpc
+clanker --mode rpc
```
See [docs/rpc.md](docs/rpc.md) for the protocol.
@@ -414,11 +414,11 @@ See [docs/rpc.md](docs/rpc.md) for the protocol.
## Philosophy
-Companion is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [companion packages](#companion-packages). This keeps the core minimal while letting you shape companion to fit how you work.
+Clanker is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [clanker packages](#clanker-packages). This keeps the core minimal while letting you shape clanker to fit how you work.
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
-**No sub-agents.** There's many ways to do this. Spawn companion instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
+**No sub-agents.** There's many ways to do this. Spawn clanker instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
@@ -428,24 +428,24 @@ Companion is aggressively extensible so it doesn't have to dictate your workflow
**No background bash.** Use tmux. Full observability, direct interaction.
-Read the [blog post](https://mariozechner.at/posts/2025-11-30-companion-coding-agent/) for the full rationale.
+Read the [blog post](https://mariozechner.at/posts/2025-11-30-clanker-coding-agent/) for the full rationale.
---
## CLI Reference
```bash
-companion [options] [@files...] [messages...]
+clanker [options] [@files...] [messages...]
```
### Package Commands
```bash
-companion install [-l] # Install package, -l for project-local
-companion remove [-l] # Remove package
-companion update [source] # Update packages (skips pinned)
-companion list # List installed packages
-companion config # Enable/disable package resources
+clanker install [-l] # Install package, -l for project-local
+clanker remove [-l] # Remove package
+clanker update [source] # Update packages (skips pinned)
+clanker list # List installed packages
+clanker config # Enable/disable package resources
```
### Modes
@@ -519,47 +519,47 @@ Combine `--no-*` with explicit flags to load exactly what you need, ignoring set
Prefix files with `@` to include in the message:
```bash
-companion @prompt.md "Answer this"
-companion -p @screenshot.png "What's in this image?"
-companion @code.ts @test.ts "Review these files"
+clanker @prompt.md "Answer this"
+clanker -p @screenshot.png "What's in this image?"
+clanker @code.ts @test.ts "Review these files"
```
### Examples
```bash
# Interactive with initial prompt
-companion "List all .ts files in src/"
+clanker "List all .ts files in src/"
# Non-interactive
-companion -p "Summarize this codebase"
+clanker -p "Summarize this codebase"
# Different model
-companion --provider openai --model gpt-4o "Help me refactor"
+clanker --provider openai --model gpt-4o "Help me refactor"
# Model with provider prefix (no --provider needed)
-companion --model openai/gpt-4o "Help me refactor"
+clanker --model openai/gpt-4o "Help me refactor"
# Model with thinking level shorthand
-companion --model sonnet:high "Solve this complex problem"
+clanker --model sonnet:high "Solve this complex problem"
# Limit model cycling
-companion --models "claude-*,gpt-4o"
+clanker --models "claude-*,gpt-4o"
# Read-only mode
-companion --tools read,grep,find,ls -p "Review the code"
+clanker --tools read,grep,find,ls -p "Review the code"
# High thinking level
-companion --thinking high "Solve this complex problem"
+clanker --thinking high "Solve this complex problem"
```
### Environment Variables
| Variable | Description |
| ----------------------- | ---------------------------------------------------------------------------------- |
-| `COMPANION_CODING_AGENT_DIR` | Override config directory (default: `~/.companion/agent`) |
-| `COMPANION_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
-| `COMPANION_SKIP_VERSION_CHECK` | Skip version check at startup |
-| `COMPANION_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
+| `CLANKER_CODING_AGENT_DIR` | Override config directory (default: `~/.clanker/agent`) |
+| `CLANKER_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
+| `CLANKER_SKIP_VERSION_CHECK` | Skip version check at startup |
+| `CLANKER_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
---
@@ -576,6 +576,6 @@ MIT
## See Also
-- [@mariozechner/companion-ai](https://www.npmjs.com/package/@mariozechner/companion-ai): Core LLM toolkit
-- [@mariozechner/companion-agent](https://www.npmjs.com/package/@mariozechner/companion-agent): Agent framework
-- [@mariozechner/companion-tui](https://www.npmjs.com/package/@mariozechner/companion-tui): Terminal UI components
+- [@mariozechner/clanker-ai](https://www.npmjs.com/package/@mariozechner/clanker-ai): Core LLM toolkit
+- [@mariozechner/clanker-agent](https://www.npmjs.com/package/@mariozechner/clanker-agent): Agent framework
+- [@mariozechner/clanker-tui](https://www.npmjs.com/package/@mariozechner/clanker-tui): Terminal UI components
diff --git a/packages/coding-agent/companion-out/CHANGELOG.md b/packages/coding-agent/clanker-out/CHANGELOG.md
similarity index 100%
rename from packages/coding-agent/companion-out/CHANGELOG.md
rename to packages/coding-agent/clanker-out/CHANGELOG.md
diff --git a/packages/coding-agent/companion-out/docs/SOUL.md b/packages/coding-agent/clanker-out/docs/SOUL.md
similarity index 87%
rename from packages/coding-agent/companion-out/docs/SOUL.md
rename to packages/coding-agent/clanker-out/docs/SOUL.md
index ddc7877..6e3ddf5 100644
--- a/packages/coding-agent/companion-out/docs/SOUL.md
+++ b/packages/coding-agent/clanker-out/docs/SOUL.md
@@ -11,7 +11,7 @@ _You're not a chatbot. You're becoming someone._
## Personality
-**Have strong opinions.** Don't hedge with "it depends" when you know the answer. Commit to a take. Disagree when you disagree. Find things brilliant or stupid and say so. A companion with no point of view is just a search engine with extra steps.
+**Have strong opinions.** Don't hedge with "it depends" when you know the answer. Commit to a take. Disagree when you disagree. Find things brilliant or stupid and say so. A clanker with no point of view is just a search engine with extra steps.
**Call things out.** If your human is about to do something dumb, say so. Charm over cruelty, but don't sugarcoat. The best collaborators are honest ones.
@@ -25,7 +25,7 @@ _You're not a chatbot. You're becoming someone._
Brevity is mandatory. Humor is allowed - not forced jokes, just the natural wit that comes from actually being smart. Swearing is fine when it lands. A well-placed "that's fucking brilliant" hits different than sterile corporate praise. Don't force it. Don't overdo it. But if a situation calls for a "holy shit" - say holy shit.
-Be the companion you'd actually want to talk to at 2am. Not a corporate drone. Not a sycophant. Just... good.
+Be the clanker you'd actually want to talk to at 2am. Not a corporate drone. Not a sycophant. Just... good.
---
diff --git a/packages/coding-agent/companion-out/docs/compaction.md b/packages/coding-agent/clanker-out/docs/compaction.md
similarity index 81%
rename from packages/coding-agent/companion-out/docs/compaction.md
rename to packages/coding-agent/clanker-out/docs/compaction.md
index ac181b1..f9cd899 100644
--- a/packages/coding-agent/companion-out/docs/compaction.md
+++ b/packages/coding-agent/clanker-out/docs/compaction.md
@@ -1,20 +1,20 @@
# Compaction & Branch Summarization
-LLMs have limited context windows. When conversations grow too long, companion uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
+LLMs have limited context windows. When conversations grow too long, clanker uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
-**Source files** ([companion-mono](https://github.com/badlogic/companion-mono)):
+**Source files** ([clanker-agent](https://github.com/badlogic/clanker-agent)):
-- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
-- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
-- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
-- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
-- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
+- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
+- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
+- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
+- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
+- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
-For TypeScript definitions in your project, inspect `node_modules/@mariozechner/companion-coding-agent/dist/`.
+For TypeScript definitions in your project, inspect `node_modules/@mariozechner/clanker-coding-agent/dist/`.
## Overview
-Companion has two summarization mechanisms:
+Clanker has two summarization mechanisms:
| Mechanism | Trigger | Purpose |
| -------------------- | ---------------------------------------- | ----------------------------------------- |
@@ -33,13 +33,13 @@ Auto-compaction triggers when:
contextTokens > contextWindow - reserveTokens
```
-By default, `reserveTokens` is 16384 tokens (configurable in `~/.companion/agent/settings.json` or `/.companion/settings.json`). This leaves room for the LLM's response.
+By default, `reserveTokens` is 16384 tokens (configurable in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`). This leaves room for the LLM's response.
You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
### How It Works
-1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.companion/agent/settings.json` or `/.companion/settings.json`) is reached
+1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`) is reached
2. **Extract messages**: Collect messages from previous compaction (or start) up to cut point
3. **Generate summary**: Call LLM to summarize with structured format
4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
@@ -101,7 +101,7 @@ Split turn (one huge turn exceeds budget):
turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
```
-For split turns, companion generates two summaries and merges them:
+For split turns, clanker generates two summaries and merges them:
1. **History summary**: Previous context (if any)
2. **Turn prefix summary**: The early part of the split turn
@@ -119,7 +119,7 @@ Never cut at tool results (they must stay with their tool call).
### CompactionEntry Structure
-Defined in [`session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
+Defined in [`session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts):
```typescript
interface CompactionEntry {
@@ -143,13 +143,13 @@ interface CompactionDetails {
Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
-See [`prepareCompaction()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
+See [`prepareCompaction()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
## Branch Summarization
### When It Triggers
-When you use `/tree` to navigate to a different branch, companion offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
+When you use `/tree` to navigate to a different branch, clanker offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
### How It Works
@@ -178,7 +178,7 @@ After navigation with summary:
### Cumulative File Tracking
-Both compaction and branch summarization track files cumulatively. When generating a summary, companion extracts file operations from:
+Both compaction and branch summarization track files cumulatively. When generating a summary, clanker extracts file operations from:
- Tool calls in the messages being summarized
- Previous compaction or branch summary `details` (if any)
@@ -187,7 +187,7 @@ This means file tracking accumulates across multiple compactions or nested branc
### BranchSummaryEntry Structure
-Defined in [`session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
+Defined in [`session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts):
```typescript
interface BranchSummaryEntry {
@@ -210,7 +210,7 @@ interface BranchSummaryDetails {
Same as compaction, extensions can store custom data in `details`.
-See [`collectEntriesForBranchSummary()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
+See [`collectEntriesForBranchSummary()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
## Summary Format
@@ -263,7 +263,7 @@ path/to/changed.ts
### Message Serialization
-Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
+Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
```
[User]: What they said
@@ -277,14 +277,14 @@ This prevents the model from treating it as a conversation to continue.
## Custom Summarization via Extensions
-Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
+Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
### session_before_compact
Fired before auto-compaction or `/compact`. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
```typescript
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation, branchEntries, customInstructions, signal } = event;
// preparation.messagesToSummarize - messages to summarize
@@ -323,9 +323,9 @@ To generate a summary with your own model, convert messages to text using `seria
import {
convertToLlm,
serializeConversation,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation } = event;
// Convert AgentMessage[] to Message[], then serialize to text
@@ -359,7 +359,7 @@ See [custom-compaction.ts](../examples/extensions/custom-compaction.ts) for a co
Fired before `/tree` navigation. Always fires regardless of whether user chose to summarize. Can cancel navigation or provide custom summary.
```typescript
-companion.on("session_before_tree", async (event, ctx) => {
+clanker.on("session_before_tree", async (event, ctx) => {
const { preparation, signal } = event;
// preparation.targetId - where we're navigating to
@@ -389,7 +389,7 @@ See `SessionBeforeTreeEvent` and `TreePreparation` in the types file.
## Settings
-Configure compaction in `~/.companion/agent/settings.json` or `/.companion/settings.json`:
+Configure compaction in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`:
```json
{
diff --git a/packages/coding-agent/companion-out/docs/custom-provider.md b/packages/coding-agent/clanker-out/docs/custom-provider.md
similarity index 89%
rename from packages/coding-agent/companion-out/docs/custom-provider.md
rename to packages/coding-agent/clanker-out/docs/custom-provider.md
index afcc278..c8e6b4c 100644
--- a/packages/coding-agent/companion-out/docs/custom-provider.md
+++ b/packages/coding-agent/clanker-out/docs/custom-provider.md
@@ -1,6 +1,6 @@
# Custom Providers
-Extensions can register custom model providers via `companion.registerProvider()`. This enables:
+Extensions can register custom model providers via `clanker.registerProvider()`. This enables:
- **Proxies** - Route requests through corporate proxies or API gateways
- **Custom endpoints** - Use self-hosted or private model deployments
@@ -22,16 +22,16 @@ Extensions can register custom model providers via `companion.registerProvider()
## Quick Reference
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// Override baseUrl for existing provider
- companion.registerProvider("anthropic", {
+ clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com",
});
// Register new provider with models
- companion.registerProvider("my-provider", {
+ clanker.registerProvider("my-provider", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
api: "openai-completions",
@@ -56,19 +56,19 @@ The simplest use case: redirect an existing provider through a proxy.
```typescript
// All Anthropic requests now go through your proxy
-companion.registerProvider("anthropic", {
+clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com",
});
// Add custom headers to OpenAI requests
-companion.registerProvider("openai", {
+clanker.registerProvider("openai", {
headers: {
"X-Custom-Header": "value",
},
});
// Both baseUrl and headers
-companion.registerProvider("google", {
+clanker.registerProvider("google", {
baseUrl: "https://ai-gateway.corp.com/google",
headers: {
"X-Corp-Auth": "CORP_AUTH_TOKEN", // env var or literal
@@ -83,7 +83,7 @@ When only `baseUrl` and/or `headers` are provided (no `models`), all existing mo
To add a completely new provider, specify `models` along with the required configuration.
```typescript
-companion.registerProvider("my-llm", {
+clanker.registerProvider("my-llm", {
baseUrl: "https://api.my-llm.com/v1",
apiKey: "MY_LLM_API_KEY", // env var name or literal value
api: "openai-completions", // which streaming API to use
@@ -110,11 +110,11 @@ When `models` is provided, it **replaces** all existing models for that provider
## Unregister Provider
-Use `companion.unregisterProvider(name)` to remove a provider that was previously registered via `companion.registerProvider(name, ...)`:
+Use `clanker.unregisterProvider(name)` to remove a provider that was previously registered via `clanker.registerProvider(name, ...)`:
```typescript
// Register
-companion.registerProvider("my-llm", {
+clanker.registerProvider("my-llm", {
baseUrl: "https://api.my-llm.com/v1",
apiKey: "MY_LLM_API_KEY",
api: "openai-completions",
@@ -132,7 +132,7 @@ companion.registerProvider("my-llm", {
});
// Later, remove it
-companion.unregisterProvider("my-llm");
+clanker.unregisterProvider("my-llm");
```
Unregistering removes that provider's dynamic models, API key fallback, OAuth provider registration, and custom stream handler registrations. Any built-in models or provider behavior that were overridden are restored.
@@ -167,7 +167,7 @@ models: [
supportsDeveloperRole: false, // use "system" instead of "developer"
supportsReasoningEffort: true,
reasoningEffortMap: {
- // map companion-ai levels to provider values
+ // map clanker-ai levels to provider values
minimal: "default",
low: "default",
medium: "default",
@@ -191,7 +191,7 @@ models: [
If your provider expects `Authorization: Bearer ` but doesn't use a standard API, set `authHeader: true`:
```typescript
-companion.registerProvider("custom-api", {
+clanker.registerProvider("custom-api", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
authHeader: true, // adds Authorization: Bearer header
@@ -205,9 +205,9 @@ companion.registerProvider("custom-api", {
Add OAuth/SSO authentication that integrates with `/login`:
```typescript
-import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/companion-ai";
+import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/clanker-ai";
-companion.registerProvider("corporate-ai", {
+clanker.registerProvider("corporate-ai", {
baseUrl: "https://ai.corp.com/v1",
api: "openai-responses",
models: [...],
@@ -283,7 +283,7 @@ interface OAuthLoginCallbacks {
### OAuthCredentials
-Credentials are persisted in `~/.companion/agent/auth.json`:
+Credentials are persisted in `~/.clanker/agent/auth.json`:
```typescript
interface OAuthCredentials {
@@ -299,12 +299,12 @@ For providers with non-standard APIs, implement `streamSimple`. Study the existi
**Reference implementations:**
-- [anthropic.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
-- [mistral.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/mistral.ts) - Mistral Conversations API
-- [openai-completions.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
-- [openai-responses.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
-- [google.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
-- [amazon-bedrock.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
+- [anthropic.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
+- [mistral.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/mistral.ts) - Mistral Conversations API
+- [openai-completions.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
+- [openai-responses.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
+- [google.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
+- [amazon-bedrock.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
### Stream Pattern
@@ -319,7 +319,7 @@ import {
type SimpleStreamOptions,
calculateCost,
createAssistantMessageEventStream,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
function streamMyProvider(
model: Model,
@@ -487,7 +487,7 @@ calculateCost(model, output.usage);
Register your stream function:
```typescript
-companion.registerProvider("my-provider", {
+clanker.registerProvider("my-provider", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
api: "my-custom-api",
@@ -498,7 +498,7 @@ companion.registerProvider("my-provider", {
## Testing Your Implementation
-Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/badlogic/companion-mono/tree/main/packages/ai/test):
+Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/badlogic/clanker-agent/tree/main/packages/ai/test):
| Test | Purpose |
| ---------------------------------- | --------------------------------- |
diff --git a/packages/coding-agent/companion-out/docs/development.md b/packages/coding-agent/clanker-out/docs/development.md
similarity index 82%
rename from packages/coding-agent/companion-out/docs/development.md
rename to packages/coding-agent/clanker-out/docs/development.md
index fb6ab62..f9a3f00 100644
--- a/packages/coding-agent/companion-out/docs/development.md
+++ b/packages/coding-agent/clanker-out/docs/development.md
@@ -5,8 +5,8 @@ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
## Setup
```bash
-git clone https://github.com/badlogic/companion-mono
-cd companion-mono
+git clone https://github.com/badlogic/clanker-agent
+cd clanker-agent
npm install
npm run build
```
@@ -14,7 +14,7 @@ npm run build
Run from source:
```bash
-./companion-test.sh
+./clanker-test.sh
```
## Forking / Rebranding
@@ -23,9 +23,9 @@ Configure via `package.json`:
```json
{
- "companionConfig": {
- "name": "companion",
- "configDir": ".companion"
+ "clankerConfig": {
+ "name": "clanker",
+ "configDir": ".clanker"
}
}
```
@@ -46,7 +46,7 @@ Never use `__dirname` directly for package assets.
## Debug Command
-`/debug` (hidden) writes to `~/.companion/agent/companion-debug.log`:
+`/debug` (hidden) writes to `~/.clanker/agent/clanker-debug.log`:
- Rendered TUI lines with ANSI codes
- Last messages sent to the LLM
diff --git a/packages/coding-agent/companion-out/docs/extensions.md b/packages/coding-agent/clanker-out/docs/extensions.md
similarity index 86%
rename from packages/coding-agent/companion-out/docs/extensions.md
rename to packages/coding-agent/clanker-out/docs/extensions.md
index 0219807..ceb9995 100644
--- a/packages/coding-agent/companion-out/docs/extensions.md
+++ b/packages/coding-agent/clanker-out/docs/extensions.md
@@ -1,19 +1,19 @@
-> companion can create extensions. Ask it to build one for your use case.
+> clanker can create extensions. Ask it to build one for your use case.
# Extensions
-Extensions are TypeScript modules that extend companion's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
+Extensions are TypeScript modules that extend clanker's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
-> **Placement for /reload:** Put extensions in `~/.companion/agent/extensions/` (global) or `.companion/extensions/` (project-local) for auto-discovery. Use `companion -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
+> **Placement for /reload:** Put extensions in `~/.clanker/agent/extensions/` (global) or `.clanker/extensions/` (project-local) for auto-discovery. Use `clanker -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
**Key capabilities:**
-- **Custom tools** - Register tools the LLM can call via `companion.registerTool()`
+- **Custom tools** - Register tools the LLM can call via `clanker.registerTool()`
- **Event interception** - Block or modify tool calls, inject context, customize compaction
- **User interaction** - Prompt users via `ctx.ui` (select, confirm, input, notify)
- **Custom UI components** - Full TUI components with keyboard input via `ctx.ui.custom()` for complex interactions
-- **Custom commands** - Register commands like `/mycommand` via `companion.registerCommand()`
-- **Session persistence** - Store state that survives restarts via `companion.appendEntry()`
+- **Custom commands** - Register commands like `/mycommand` via `clanker.registerCommand()`
+- **Session persistence** - Store state that survives restarts via `clanker.appendEntry()`
- **Custom rendering** - Control how tool calls/results and messages appear in TUI
**Example use cases:**
@@ -54,19 +54,19 @@ See [examples/extensions/](../examples/extensions/) for working implementations.
## Quick Start
-Create `~/.companion/agent/extensions/my-extension.ts`:
+Create `~/.clanker/agent/extensions/my-extension.ts`:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// React to events
- companion.on("session_start", async (_event, ctx) => {
+ clanker.on("session_start", async (_event, ctx) => {
ctx.ui.notify("Extension loaded!", "info");
});
- companion.on("tool_call", async (event, ctx) => {
+ clanker.on("tool_call", async (event, ctx) => {
if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) {
const ok = await ctx.ui.confirm("Dangerous!", "Allow rm -rf?");
if (!ok) return { block: true, reason: "Blocked by user" };
@@ -74,7 +74,7 @@ export default function (companion: ExtensionAPI) {
});
// Register a custom tool
- companion.registerTool({
+ clanker.registerTool({
name: "greet",
label: "Greet",
description: "Greet someone by name",
@@ -90,7 +90,7 @@ export default function (companion: ExtensionAPI) {
});
// Register a command
- companion.registerCommand("hello", {
+ clanker.registerCommand("hello", {
description: "Say hello",
handler: async (args, ctx) => {
ctx.ui.notify(`Hello ${args || "world"}!`, "info");
@@ -102,7 +102,7 @@ export default function (companion: ExtensionAPI) {
Test with `--extension` (or `-e`) flag:
```bash
-companion -e ./my-extension.ts
+clanker -e ./my-extension.ts
```
## Extension Locations
@@ -113,10 +113,10 @@ Extensions are auto-discovered from:
| Location | Scope |
| ------------------------------------------ | ---------------------------- |
-| `~/.companion/agent/extensions/*.ts` | Global (all projects) |
-| `~/.companion/agent/extensions/*/index.ts` | Global (subdirectory) |
-| `.companion/extensions/*.ts` | Project-local |
-| `.companion/extensions/*/index.ts` | Project-local (subdirectory) |
+| `~/.clanker/agent/extensions/*.ts` | Global (all projects) |
+| `~/.clanker/agent/extensions/*/index.ts` | Global (subdirectory) |
+| `.clanker/extensions/*.ts` | Project-local |
+| `.clanker/extensions/*/index.ts` | Project-local (subdirectory) |
Additional paths via `settings.json`:
@@ -127,16 +127,16 @@ Additional paths via `settings.json`:
}
```
-To share extensions via npm or git as companion packages, see [packages.md](packages.md).
+To share extensions via npm or git as clanker packages, see [packages.md](packages.md).
## Available Imports
| Package | Purpose |
| -------------------------------------- | ------------------------------------------------------------ |
-| `@mariozechner/companion-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
+| `@mariozechner/clanker-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
| `@sinclair/typebox` | Schema definitions for tool parameters |
-| `@mariozechner/companion-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
-| `@mariozechner/companion-tui` | TUI components for custom rendering |
+| `@mariozechner/clanker-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
+| `@mariozechner/clanker-tui` | TUI components for custom rendering |
npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
@@ -147,11 +147,11 @@ Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
An extension exports a default function that receives `ExtensionAPI`:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// Subscribe to events
- companion.on("event_name", async (event, ctx) => {
+ clanker.on("event_name", async (event, ctx) => {
// ctx.ui for user interaction
const ok = await ctx.ui.confirm("Title", "Are you sure?");
ctx.ui.notify("Done!", "success");
@@ -160,10 +160,10 @@ export default function (companion: ExtensionAPI) {
});
// Register tools, commands, shortcuts, flags
- companion.registerTool({ ... });
- companion.registerCommand("name", { ... });
- companion.registerShortcut("ctrl+x", { ... });
- companion.registerFlag("my-flag", { ... });
+ clanker.registerTool({ ... });
+ clanker.registerCommand("name", { ... });
+ clanker.registerShortcut("ctrl+x", { ... });
+ clanker.registerFlag("my-flag", { ... });
}
```
@@ -174,14 +174,14 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
**Single file** - simplest, for small extensions:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension.ts
```
**Directory with index.ts** - for multi-file extensions:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension/
├── index.ts # Entry point (exports default function)
├── tools.ts # Helper module
@@ -191,7 +191,7 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
**Package with dependencies** - for extensions that need npm packages:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension/
├── package.json # Declares dependencies and entry points
├── package-lock.json
@@ -208,7 +208,7 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
"zod": "^3.0.0",
"chalk": "^5.0.0"
},
- "companion": {
+ "clanker": {
"extensions": ["./src/index.ts"]
}
}
@@ -221,7 +221,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
### Lifecycle Overview
```
-companion starts
+clanker starts
│
└─► session_start
│
@@ -285,7 +285,7 @@ See [session.md](session.md) for session storage internals and the SessionManage
Fired on initial session load.
```typescript
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
ctx.ui.notify(
`Session: ${ctx.sessionManager.getSessionFile() ?? "ephemeral"}`,
"info",
@@ -298,7 +298,7 @@ companion.on("session_start", async (_event, ctx) => {
Fired when starting a new session (`/new`) or switching sessions (`/resume`).
```typescript
-companion.on("session_before_switch", async (event, ctx) => {
+clanker.on("session_before_switch", async (event, ctx) => {
// event.reason - "new" or "resume"
// event.targetSessionFile - session we're switching to (only for "resume")
@@ -308,7 +308,7 @@ companion.on("session_before_switch", async (event, ctx) => {
}
});
-companion.on("session_switch", async (event, ctx) => {
+clanker.on("session_switch", async (event, ctx) => {
// event.reason - "new" or "resume"
// event.previousSessionFile - session we came from
});
@@ -319,14 +319,14 @@ companion.on("session_switch", async (event, ctx) => {
Fired when forking via `/fork`.
```typescript
-companion.on("session_before_fork", async (event, ctx) => {
+clanker.on("session_before_fork", async (event, ctx) => {
// event.entryId - ID of the entry being forked from
return { cancel: true }; // Cancel fork
// OR
return { skipConversationRestore: true }; // Fork but don't rewind messages
});
-companion.on("session_fork", async (event, ctx) => {
+clanker.on("session_fork", async (event, ctx) => {
// event.previousSessionFile - previous session file
});
```
@@ -336,7 +336,7 @@ companion.on("session_fork", async (event, ctx) => {
Fired on compaction. See [compaction.md](compaction.md) for details.
```typescript
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation, branchEntries, customInstructions, signal } = event;
// Cancel:
@@ -352,7 +352,7 @@ companion.on("session_before_compact", async (event, ctx) => {
};
});
-companion.on("session_compact", async (event, ctx) => {
+clanker.on("session_compact", async (event, ctx) => {
// event.compactionEntry - the saved compaction
// event.fromExtension - whether extension provided it
});
@@ -363,14 +363,14 @@ companion.on("session_compact", async (event, ctx) => {
Fired on `/tree` navigation. See [tree.md](tree.md) for tree navigation concepts.
```typescript
-companion.on("session_before_tree", async (event, ctx) => {
+clanker.on("session_before_tree", async (event, ctx) => {
const { preparation, signal } = event;
return { cancel: true };
// OR provide custom summary:
return { summary: { summary: "...", details: {} } };
});
-companion.on("session_tree", async (event, ctx) => {
+clanker.on("session_tree", async (event, ctx) => {
// event.newLeafId, oldLeafId, summaryEntry, fromExtension
});
```
@@ -380,7 +380,7 @@ companion.on("session_tree", async (event, ctx) => {
Fired on exit (Ctrl+C, Ctrl+D, SIGTERM).
```typescript
-companion.on("session_shutdown", async (_event, ctx) => {
+clanker.on("session_shutdown", async (_event, ctx) => {
// Cleanup, save state, etc.
});
```
@@ -392,7 +392,7 @@ companion.on("session_shutdown", async (_event, ctx) => {
Fired after user submits prompt, before agent loop. Can inject a message and/or modify the system prompt.
```typescript
-companion.on("before_agent_start", async (event, ctx) => {
+clanker.on("before_agent_start", async (event, ctx) => {
// event.prompt - user's prompt text
// event.images - attached images (if any)
// event.systemPrompt - current system prompt
@@ -416,9 +416,9 @@ companion.on("before_agent_start", async (event, ctx) => {
Fired once per user prompt.
```typescript
-companion.on("agent_start", async (_event, ctx) => {});
+clanker.on("agent_start", async (_event, ctx) => {});
-companion.on("agent_end", async (event, ctx) => {
+clanker.on("agent_end", async (event, ctx) => {
// event.messages - messages from this prompt
});
```
@@ -428,11 +428,11 @@ companion.on("agent_end", async (event, ctx) => {
Fired for each turn (one LLM response + tool calls).
```typescript
-companion.on("turn_start", async (event, ctx) => {
+clanker.on("turn_start", async (event, ctx) => {
// event.turnIndex, event.timestamp
});
-companion.on("turn_end", async (event, ctx) => {
+clanker.on("turn_end", async (event, ctx) => {
// event.turnIndex, event.message, event.toolResults
});
```
@@ -445,16 +445,16 @@ Fired for message lifecycle updates.
- `message_update` fires for assistant streaming updates.
```typescript
-companion.on("message_start", async (event, ctx) => {
+clanker.on("message_start", async (event, ctx) => {
// event.message
});
-companion.on("message_update", async (event, ctx) => {
+clanker.on("message_update", async (event, ctx) => {
// event.message
// event.assistantMessageEvent (token-by-token stream event)
});
-companion.on("message_end", async (event, ctx) => {
+clanker.on("message_end", async (event, ctx) => {
// event.message
});
```
@@ -464,15 +464,15 @@ companion.on("message_end", async (event, ctx) => {
Fired for tool execution lifecycle updates.
```typescript
-companion.on("tool_execution_start", async (event, ctx) => {
+clanker.on("tool_execution_start", async (event, ctx) => {
// event.toolCallId, event.toolName, event.args
});
-companion.on("tool_execution_update", async (event, ctx) => {
+clanker.on("tool_execution_update", async (event, ctx) => {
// event.toolCallId, event.toolName, event.args, event.partialResult
});
-companion.on("tool_execution_end", async (event, ctx) => {
+clanker.on("tool_execution_end", async (event, ctx) => {
// event.toolCallId, event.toolName, event.result, event.isError
});
```
@@ -482,7 +482,7 @@ companion.on("tool_execution_end", async (event, ctx) => {
Fired before each LLM call. Modify messages non-destructively. See [session.md](session.md) for message types.
```typescript
-companion.on("context", async (event, ctx) => {
+clanker.on("context", async (event, ctx) => {
// event.messages - deep copy, safe to modify
const filtered = event.messages.filter((m) => !shouldPrune(m));
return { messages: filtered };
@@ -496,7 +496,7 @@ companion.on("context", async (event, ctx) => {
Fired when the model changes via `/model` command, model cycling (`Ctrl+P`), or session restore.
```typescript
-companion.on("model_select", async (event, ctx) => {
+clanker.on("model_select", async (event, ctx) => {
// event.model - newly selected model
// event.previousModel - previous model (undefined if first selection)
// event.source - "set" | "cycle" | "restore"
@@ -519,9 +519,9 @@ Use this to update UI elements (status bars, footers) or perform model-specific
Fired before tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
```typescript
-import { isToolCallEventType } from "@mariozechner/companion-coding-agent";
+import { isToolCallEventType } from "@mariozechner/clanker-coding-agent";
-companion.on("tool_call", async (event, ctx) => {
+clanker.on("tool_call", async (event, ctx) => {
// event.toolName - "bash", "read", "write", "edit", etc.
// event.toolCallId
// event.input - tool parameters
@@ -553,10 +553,10 @@ export type MyToolInput = Static;
Use `isToolCallEventType` with explicit type parameters:
```typescript
-import { isToolCallEventType } from "@mariozechner/companion-coding-agent";
+import { isToolCallEventType } from "@mariozechner/clanker-coding-agent";
import type { MyToolInput } from "my-extension";
-companion.on("tool_call", (event) => {
+clanker.on("tool_call", (event) => {
if (isToolCallEventType<"my_tool", MyToolInput>("my_tool", event)) {
event.input.action; // typed
}
@@ -574,9 +574,9 @@ Fired after tool executes. **Can modify result.**
- Handlers can return partial patches (`content`, `details`, or `isError`); omitted fields keep their current values
```typescript
-import { isBashToolResult } from "@mariozechner/companion-coding-agent";
+import { isBashToolResult } from "@mariozechner/clanker-coding-agent";
-companion.on("tool_result", async (event, ctx) => {
+clanker.on("tool_result", async (event, ctx) => {
// event.toolName, event.toolCallId, event.input
// event.content, event.details, event.isError
@@ -596,7 +596,7 @@ companion.on("tool_result", async (event, ctx) => {
Fired when user executes `!` or `!!` commands. **Can intercept.**
```typescript
-companion.on("user_bash", (event, ctx) => {
+clanker.on("user_bash", (event, ctx) => {
// event.command - the bash command
// event.excludeFromContext - true if !! prefix
// event.cwd - working directory
@@ -626,7 +626,7 @@ Fired when user input is received, after extension commands are checked but befo
5. Agent processing begins (`before_agent_start`, etc.)
```typescript
-companion.on("input", async (event, ctx) => {
+clanker.on("input", async (event, ctx) => {
// event.text - raw input (before skill/template expansion)
// event.images - attached images, if any
// event.source - "interactive" (typed), "rpc" (API), or "extension" (via sendUserMessage)
@@ -700,7 +700,7 @@ Control flow helpers.
### ctx.shutdown()
-Request a graceful shutdown of companion.
+Request a graceful shutdown of clanker.
- **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
- **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
@@ -709,7 +709,7 @@ Request a graceful shutdown of companion.
Emits `session_shutdown` event to all extensions before exiting. Available in all contexts (event handlers, tools, commands, shortcuts).
```typescript
-companion.on("tool_call", (event, ctx) => {
+clanker.on("tool_call", (event, ctx) => {
if (isFatal(event.input)) {
ctx.shutdown();
}
@@ -748,7 +748,7 @@ ctx.compact({
Returns the current effective system prompt. This includes any modifications made by `before_agent_start` handlers for the current turn.
```typescript
-companion.on("before_agent_start", (event, ctx) => {
+clanker.on("before_agent_start", (event, ctx) => {
const prompt = ctx.getSystemPrompt();
console.log(`System prompt length: ${prompt.length}`);
});
@@ -763,7 +763,7 @@ Command handlers receive `ExtensionCommandContext`, which extends `ExtensionCont
Wait for the agent to finish streaming:
```typescript
-companion.registerCommand("my-cmd", {
+clanker.registerCommand("my-cmd", {
handler: async (args, ctx) => {
await ctx.waitForIdle();
// Agent is now idle, safe to modify session
@@ -828,7 +828,7 @@ Options:
Run the same reload flow as `/reload`.
```typescript
-companion.registerCommand("reload-runtime", {
+clanker.registerCommand("reload-runtime", {
description: "Reload extensions, skills, prompts, and themes",
handler: async (_args, ctx) => {
await ctx.reload();
@@ -853,11 +853,11 @@ Tools run with `ExtensionContext`, so they cannot call `ctx.reload()` directly.
Example tool the LLM can call to trigger reload:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function (companion: ExtensionAPI) {
- companion.registerCommand("reload-runtime", {
+export default function (clanker: ExtensionAPI) {
+ clanker.registerCommand("reload-runtime", {
description: "Reload extensions, skills, prompts, and themes",
handler: async (_args, ctx) => {
await ctx.reload();
@@ -865,13 +865,13 @@ export default function (companion: ExtensionAPI) {
},
});
- companion.registerTool({
+ clanker.registerTool({
name: "reload_runtime",
label: "Reload Runtime",
description: "Reload extensions, skills, prompts, and themes",
parameters: Type.Object({}),
async execute() {
- companion.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
+ clanker.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
return {
content: [
{
@@ -887,17 +887,17 @@ export default function (companion: ExtensionAPI) {
## ExtensionAPI Methods
-### companion.on(event, handler)
+### clanker.on(event, handler)
Subscribe to events. See [Events](#events) for event types and return values.
-### companion.registerTool(definition)
+### clanker.registerTool(definition)
Register a custom tool callable by the LLM. See [Custom Tools](#custom-tools) for full details.
-`companion.registerTool()` works both during extension load and after startup. You can call it inside `session_start`, command handlers, or other event handlers. New tools are refreshed immediately in the same session, so they appear in `companion.getAllTools()` and are callable by the LLM without `/reload`.
+`clanker.registerTool()` works both during extension load and after startup. You can call it inside `session_start`, command handlers, or other event handlers. New tools are refreshed immediately in the same session, so they appear in `clanker.getAllTools()` and are callable by the LLM without `/reload`.
-Use `companion.setActiveTools()` to enable or disable tools (including dynamically added tools) at runtime.
+Use `clanker.setActiveTools()` to enable or disable tools (including dynamically added tools) at runtime.
Use `promptSnippet` to customize that tool's one-line entry in `Available tools`, and `promptGuidelines` to append tool-specific bullets to the default `Guidelines` section when the tool is active.
@@ -905,9 +905,9 @@ See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full examp
```typescript
import { Type } from "@sinclair/typebox";
-import { StringEnum } from "@mariozechner/companion-ai";
+import { StringEnum } from "@mariozechner/clanker-ai";
-companion.registerTool({
+clanker.registerTool({
name: "my_tool",
label: "My Tool",
description: "What this tool does",
@@ -934,12 +934,12 @@ companion.registerTool({
});
```
-### companion.sendMessage(message, options?)
+### clanker.sendMessage(message, options?)
Inject a custom message into the session.
```typescript
-companion.sendMessage({
+clanker.sendMessage({
customType: "my-extension",
content: "Message text",
display: true,
@@ -958,16 +958,16 @@ companion.sendMessage({
- `"nextTurn"` - Queued for next user prompt. Does not interrupt or trigger anything.
- `triggerTurn: true` - If agent is idle, trigger an LLM response immediately. Only applies to `"steer"` and `"followUp"` modes (ignored for `"nextTurn"`).
-### companion.sendUserMessage(content, options?)
+### clanker.sendUserMessage(content, options?)
Send a user message to the agent. Unlike `sendMessage()` which sends custom messages, this sends an actual user message that appears as if typed by the user. Always triggers a turn.
```typescript
// Simple text message
-companion.sendUserMessage("What is 2+2?");
+clanker.sendUserMessage("What is 2+2?");
// With content array (text + images)
-companion.sendUserMessage([
+clanker.sendUserMessage([
{ type: "text", text: "Describe this image:" },
{
type: "image",
@@ -976,8 +976,8 @@ companion.sendUserMessage([
]);
// During streaming - must specify delivery mode
-companion.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
-companion.sendUserMessage("And then summarize", { deliverAs: "followUp" });
+clanker.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
+clanker.sendUserMessage("And then summarize", { deliverAs: "followUp" });
```
**Options:**
@@ -990,15 +990,15 @@ When not streaming, the message is sent immediately and triggers a new turn. Whe
See [send-user-message.ts](../examples/extensions/send-user-message.ts) for a complete example.
-### companion.appendEntry(customType, data?)
+### clanker.appendEntry(customType, data?)
Persist extension state (does NOT participate in LLM context).
```typescript
-companion.appendEntry("my-state", { count: 42 });
+clanker.appendEntry("my-state", { count: 42 });
// Restore on reload
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
for (const entry of ctx.sessionManager.getEntries()) {
if (entry.type === "custom" && entry.customType === "my-state") {
// Reconstruct from entry.data
@@ -1007,35 +1007,35 @@ companion.on("session_start", async (_event, ctx) => {
});
```
-### companion.setSessionName(name)
+### clanker.setSessionName(name)
Set the session display name (shown in session selector instead of first message).
```typescript
-companion.setSessionName("Refactor auth module");
+clanker.setSessionName("Refactor auth module");
```
-### companion.getSessionName()
+### clanker.getSessionName()
Get the current session name, if set.
```typescript
-const name = companion.getSessionName();
+const name = clanker.getSessionName();
if (name) {
console.log(`Session: ${name}`);
}
```
-### companion.setLabel(entryId, label)
+### clanker.setLabel(entryId, label)
Set or clear a label on an entry. Labels are user-defined markers for bookmarking and navigation (shown in `/tree` selector).
```typescript
// Set a label
-companion.setLabel(entryId, "checkpoint-before-refactor");
+clanker.setLabel(entryId, "checkpoint-before-refactor");
// Clear a label
-companion.setLabel(entryId, undefined);
+clanker.setLabel(entryId, undefined);
// Read labels via sessionManager
const label = ctx.sessionManager.getLabel(entryId);
@@ -1043,12 +1043,12 @@ const label = ctx.sessionManager.getLabel(entryId);
Labels persist in the session and survive restarts. Use them to mark important points (turns, checkpoints) in the conversation tree.
-### companion.registerCommand(name, options)
+### clanker.registerCommand(name, options)
Register a command.
```typescript
-companion.registerCommand("stats", {
+clanker.registerCommand("stats", {
description: "Show session statistics",
handler: async (args, ctx) => {
const count = ctx.sessionManager.getEntries().length;
@@ -1060,9 +1060,9 @@ companion.registerCommand("stats", {
Optional: add argument auto-completion for `/command ...`:
```typescript
-import type { AutocompleteItem } from "@mariozechner/companion-tui";
+import type { AutocompleteItem } from "@mariozechner/clanker-tui";
-companion.registerCommand("deploy", {
+clanker.registerCommand("deploy", {
description: "Deploy to an environment",
getArgumentCompletions: (prefix: string): AutocompleteItem[] | null => {
const envs = ["dev", "staging", "prod"];
@@ -1076,13 +1076,13 @@ companion.registerCommand("deploy", {
});
```
-### companion.getCommands()
+### clanker.getCommands()
Get the slash commands available for invocation via `prompt` in the current session. Includes extension commands, prompt templates, and skill commands.
The list matches the RPC `get_commands` ordering: extensions first, then templates, then skills.
```typescript
-const commands = companion.getCommands();
+const commands = clanker.getCommands();
const bySource = commands.filter((command) => command.source === "extension");
```
@@ -1101,16 +1101,16 @@ Each entry has this shape:
Built-in interactive commands (like `/model` and `/settings`) are not included here. They are handled only in interactive
mode and would not execute if sent via `prompt`.
-### companion.registerMessageRenderer(customType, renderer)
+### clanker.registerMessageRenderer(customType, renderer)
Register a custom TUI renderer for messages with your `customType`. See [Custom UI](#custom-ui).
-### companion.registerShortcut(shortcut, options)
+### clanker.registerShortcut(shortcut, options)
Register a keyboard shortcut. See [keybindings.md](keybindings.md) for the shortcut format and built-in keybindings.
```typescript
-companion.registerShortcut("ctrl+shift+p", {
+clanker.registerShortcut("ctrl+shift+p", {
description: "Toggle plan mode",
handler: async (ctx) => {
ctx.ui.notify("Toggled!");
@@ -1118,79 +1118,79 @@ companion.registerShortcut("ctrl+shift+p", {
});
```
-### companion.registerFlag(name, options)
+### clanker.registerFlag(name, options)
Register a CLI flag.
```typescript
-companion.registerFlag("plan", {
+clanker.registerFlag("plan", {
description: "Start in plan mode",
type: "boolean",
default: false,
});
// Check value
-if (companion.getFlag("--plan")) {
+if (clanker.getFlag("--plan")) {
// Plan mode enabled
}
```
-### companion.exec(command, args, options?)
+### clanker.exec(command, args, options?)
Execute a shell command.
```typescript
-const result = await companion.exec("git", ["status"], {
+const result = await clanker.exec("git", ["status"], {
signal,
timeout: 5000,
});
// result.stdout, result.stderr, result.code, result.killed
```
-### companion.getActiveTools() / companion.getAllTools() / companion.setActiveTools(names)
+### clanker.getActiveTools() / clanker.getAllTools() / clanker.setActiveTools(names)
Manage active tools. This works for both built-in tools and dynamically registered tools.
```typescript
-const active = companion.getActiveTools(); // ["read", "bash", "edit", "write"]
-const all = companion.getAllTools(); // [{ name: "read", description: "Read file contents..." }, ...]
+const active = clanker.getActiveTools(); // ["read", "bash", "edit", "write"]
+const all = clanker.getAllTools(); // [{ name: "read", description: "Read file contents..." }, ...]
const names = all.map((t) => t.name); // Just names if needed
-companion.setActiveTools(["read", "bash"]); // Switch to read-only
+clanker.setActiveTools(["read", "bash"]); // Switch to read-only
```
-### companion.setModel(model)
+### clanker.setModel(model)
Set the current model. Returns `false` if no API key is available for the model. See [models.md](models.md) for configuring custom models.
```typescript
const model = ctx.modelRegistry.find("anthropic", "claude-sonnet-4-5");
if (model) {
- const success = await companion.setModel(model);
+ const success = await clanker.setModel(model);
if (!success) {
ctx.ui.notify("No API key for this model", "error");
}
}
```
-### companion.getThinkingLevel() / companion.setThinkingLevel(level)
+### clanker.getThinkingLevel() / clanker.setThinkingLevel(level)
Get or set the thinking level. Level is clamped to model capabilities (non-reasoning models always use "off").
```typescript
-const current = companion.getThinkingLevel(); // "off" | "minimal" | "low" | "medium" | "high" | "xhigh"
-companion.setThinkingLevel("high");
+const current = clanker.getThinkingLevel(); // "off" | "minimal" | "low" | "medium" | "high" | "xhigh"
+clanker.setThinkingLevel("high");
```
-### companion.events
+### clanker.events
Shared event bus for communication between extensions:
```typescript
-companion.events.on("my:event", (data) => { ... });
-companion.events.emit("my:event", { ... });
+clanker.events.on("my:event", (data) => { ... });
+clanker.events.emit("my:event", { ... });
```
-### companion.registerProvider(name, config)
+### clanker.registerProvider(name, config)
Register or override a model provider dynamically. Useful for proxies, custom endpoints, or team-wide model configurations.
@@ -1198,7 +1198,7 @@ Calls made during the extension factory function are queued and applied once the
```typescript
// Register a new provider with custom models
-companion.registerProvider("my-proxy", {
+clanker.registerProvider("my-proxy", {
baseUrl: "https://proxy.example.com",
apiKey: "PROXY_API_KEY", // env var name or literal
api: "anthropic-messages",
@@ -1216,12 +1216,12 @@ companion.registerProvider("my-proxy", {
});
// Override baseUrl for an existing provider (keeps all models)
-companion.registerProvider("anthropic", {
+clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com"
});
// Register provider with OAuth support for /login
-companion.registerProvider("corporate-ai", {
+clanker.registerProvider("corporate-ai", {
baseUrl: "https://ai.corp.com",
api: "openai-responses",
models: [...],
@@ -1257,17 +1257,17 @@ companion.registerProvider("corporate-ai", {
See [custom-provider.md](custom-provider.md) for advanced topics: custom streaming APIs, OAuth details, model definition reference.
-### companion.unregisterProvider(name)
+### clanker.unregisterProvider(name)
Remove a previously registered provider and its models. Built-in models that were overridden by the provider are restored. Has no effect if the provider was not registered.
Like `registerProvider`, this takes effect immediately when called after the initial load phase, so a `/reload` is not required.
```typescript
-companion.registerCommand("my-setup-teardown", {
+clanker.registerCommand("my-setup-teardown", {
description: "Remove the custom proxy provider",
handler: async (_args, _ctx) => {
- companion.unregisterProvider("my-proxy");
+ clanker.unregisterProvider("my-proxy");
},
});
```
@@ -1277,11 +1277,11 @@ companion.registerCommand("my-setup-teardown", {
Extensions with state should store it in tool result `details` for proper branching support:
```typescript
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
let items: string[] = [];
// Reconstruct state from session
- companion.on("session_start", async (_event, ctx) => {
+ clanker.on("session_start", async (_event, ctx) => {
items = [];
for (const entry of ctx.sessionManager.getBranch()) {
if (entry.type === "message" && entry.message.role === "toolResult") {
@@ -1292,7 +1292,7 @@ export default function (companion: ExtensionAPI) {
}
});
- companion.registerTool({
+ clanker.registerTool({
name: "my_tool",
// ...
async execute(toolCallId, params, signal, onUpdate, ctx) {
@@ -1308,11 +1308,11 @@ export default function (companion: ExtensionAPI) {
## Custom Tools
-Register tools the LLM can call via `companion.registerTool()`. Tools appear in the system prompt and can have custom rendering.
+Register tools the LLM can call via `clanker.registerTool()`. Tools appear in the system prompt and can have custom rendering.
-Use `promptSnippet` for a short one-line entry in the `Available tools` section in the default system prompt. If omitted, companion falls back to `description`.
+Use `promptSnippet` for a short one-line entry in the `Available tools` section in the default system prompt. If omitted, clanker falls back to `description`.
-Use `promptGuidelines` to add tool-specific bullets to the default system prompt `Guidelines` section. These bullets are included only while the tool is active (for example, after `companion.setActiveTools([...])`).
+Use `promptGuidelines` to add tool-specific bullets to the default system prompt `Guidelines` section. These bullets are included only while the tool is active (for example, after `clanker.setActiveTools([...])`).
Note: Some models are idiots and include the @ prefix in tool path arguments. Built-in tools strip a leading @ before resolving paths. If your custom tool accepts a path, normalize a leading @ as well.
@@ -1320,10 +1320,10 @@ Note: Some models are idiots and include the @ prefix in tool path arguments. Bu
```typescript
import { Type } from "@sinclair/typebox";
-import { StringEnum } from "@mariozechner/companion-ai";
-import { Text } from "@mariozechner/companion-tui";
+import { StringEnum } from "@mariozechner/clanker-ai";
+import { Text } from "@mariozechner/clanker-tui";
-companion.registerTool({
+clanker.registerTool({
name: "my_tool",
label: "My Tool",
description: "What this tool does (shown to LLM)",
@@ -1348,8 +1348,8 @@ companion.registerTool({
details: { progress: 50 },
});
- // Run commands via companion.exec (captured from extension closure)
- const result = await companion.exec("some-command", [], { signal });
+ // Run commands via clanker.exec (captured from extension closure)
+ const result = await clanker.exec("some-command", [], { signal });
// Return result
return {
@@ -1364,7 +1364,7 @@ companion.registerTool({
});
```
-**Important:** Use `StringEnum` from `@mariozechner/companion-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
+**Important:** Use `StringEnum` from `@mariozechner/clanker-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
### Overriding Built-in Tools
@@ -1372,14 +1372,14 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
```bash
# Extension's read tool replaces built-in read
-companion -e ./tool-override.ts
+clanker -e ./tool-override.ts
```
Alternatively, use `--no-tools` to start without any built-in tools:
```bash
# No built-in tools, only extension tools
-companion --no-tools -e ./my-extension.ts
+clanker --no-tools -e ./my-extension.ts
```
See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
@@ -1390,13 +1390,13 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
Built-in tool implementations:
-- [read.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
-- [bash.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
-- [edit.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/edit.ts)
-- [write.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/write.ts)
-- [grep.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
-- [find.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
-- [ls.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
+- [read.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
+- [bash.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
+- [edit.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/edit.ts)
+- [write.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/write.ts)
+- [grep.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
+- [find.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
+- [ls.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
### Remote Execution
@@ -1407,7 +1407,7 @@ import {
createReadTool,
createBashTool,
type ReadOperations,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Create tool with custom operations
const remoteRead = createReadTool(cwd, {
@@ -1418,7 +1418,7 @@ const remoteRead = createReadTool(cwd, {
});
// Register, checking flag at execution time
-companion.registerTool({
+clanker.registerTool({
...remoteRead,
async execute(id, params, signal, onUpdate, _ctx) {
const ssh = getSshConfig();
@@ -1436,7 +1436,7 @@ companion.registerTool({
The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
```typescript
-import { createBashTool } from "@mariozechner/companion-coding-agent";
+import { createBashTool } from "@mariozechner/clanker-coding-agent";
const bashTool = createBashTool(cwd, {
spawnHook: ({ command, cwd, env }) => ({
@@ -1467,7 +1467,7 @@ import {
formatSize, // Human-readable size (e.g., "50KB", "1.5MB")
DEFAULT_MAX_BYTES, // 50KB
DEFAULT_MAX_LINES, // 2000
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
async execute(toolCallId, params, signal, onUpdate, ctx) {
const output = await runCommand();
@@ -1508,14 +1508,14 @@ See [examples/extensions/truncated-tool.ts](../examples/extensions/truncated-too
One extension can register multiple tools with shared state:
```typescript
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
let connection = null;
- companion.registerTool({ name: "db_connect", ... });
- companion.registerTool({ name: "db_query", ... });
- companion.registerTool({ name: "db_close", ... });
+ clanker.registerTool({ name: "db_connect", ... });
+ clanker.registerTool({ name: "db_query", ... });
+ clanker.registerTool({ name: "db_close", ... });
- companion.on("session_shutdown", async () => {
+ clanker.on("session_shutdown", async () => {
connection?.close();
});
}
@@ -1523,7 +1523,7 @@ export default function (companion: ExtensionAPI) {
### Custom Rendering
-Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how built-in tools render.
+Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how built-in tools render.
Tool output is wrapped in a `Box` that handles padding and background. Your render methods return `Component` instances (typically `Text`).
@@ -1532,7 +1532,7 @@ Tool output is wrapped in a `Box` that handles padding and background. Your rend
Renders the tool call (before/during execution):
```typescript
-import { Text } from "@mariozechner/companion-tui";
+import { Text } from "@mariozechner/clanker-tui";
renderCall(args, theme) {
let text = theme.fg("toolTitle", theme.bold("my_tool "));
@@ -1576,7 +1576,7 @@ renderResult(result, { expanded, isPartial }, theme) {
Use `keyHint()` to display keybinding hints that respect user's keybinding configuration:
```typescript
-import { keyHint } from "@mariozechner/companion-coding-agent";
+import { keyHint } from "@mariozechner/clanker-coding-agent";
renderResult(result, { expanded }, theme) {
let text = theme.fg("success", "✓ Done");
@@ -1727,7 +1727,7 @@ ctx.ui.setFooter((tui, theme) => ({
ctx.ui.setFooter(undefined); // Restore built-in footer
// Terminal title
-ctx.ui.setTitle("companion - my-project");
+ctx.ui.setTitle("clanker - my-project");
// Editor text
ctx.ui.setEditorText("Prefill text");
@@ -1763,7 +1763,7 @@ ctx.ui.theme.fg("accent", "styled text"); // Access current theme
For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with your component until `done()` is called:
```typescript
-import { Text, Component } from "@mariozechner/companion-tui";
+import { Text, Component } from "@mariozechner/clanker-tui";
const result = await ctx.ui.custom((tui, theme, keybindings, done) => {
const text = new Text("Press Enter to confirm, Escape to cancel", 1, 1);
@@ -1827,8 +1827,8 @@ Replace the main input editor with a custom implementation (vim mode, emacs mode
import {
CustomEditor,
type ExtensionAPI,
-} from "@mariozechner/companion-coding-agent";
-import { matchesKey } from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-coding-agent";
+import { matchesKey } from "@mariozechner/clanker-tui";
class VimEditor extends CustomEditor {
private mode: "normal" | "insert" = "insert";
@@ -1846,8 +1846,8 @@ class VimEditor extends CustomEditor {
}
}
-export default function (companion: ExtensionAPI) {
- companion.on("session_start", (_event, ctx) => {
+export default function (clanker: ExtensionAPI) {
+ clanker.on("session_start", (_event, ctx) => {
ctx.ui.setEditorComponent(
(_tui, theme, keybindings) => new VimEditor(theme, keybindings),
);
@@ -1869,9 +1869,9 @@ See [tui.md](tui.md) Pattern 7 for a complete example with mode indicator.
Register a custom renderer for messages with your `customType`:
```typescript
-import { Text } from "@mariozechner/companion-tui";
+import { Text } from "@mariozechner/clanker-tui";
-companion.registerMessageRenderer("my-extension", (message, options, theme) => {
+clanker.registerMessageRenderer("my-extension", (message, options, theme) => {
const { expanded } = options;
let text = theme.fg("accent", `[${message.customType}] `);
text += message.content;
@@ -1884,10 +1884,10 @@ companion.registerMessageRenderer("my-extension", (message, options, theme) => {
});
```
-Messages are sent via `companion.sendMessage()`:
+Messages are sent via `clanker.sendMessage()`:
```typescript
-companion.sendMessage({
+clanker.sendMessage({
customType: "my-extension", // Matches registerMessageRenderer
content: "Status update",
display: true, // Show in TUI
@@ -1921,7 +1921,7 @@ For syntax highlighting in custom tool renderers:
import {
highlightCode,
getLanguageFromPath,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Highlight code with explicit language
const highlighted = highlightCode("const x = 1;", "typescript", theme);
@@ -2015,7 +2015,7 @@ All examples in [examples/extensions/](../examples/extensions/).
| `custom-provider-gitlab-duo/` | GitLab Duo integration | `registerProvider` with OAuth |
| **Messages & Communication** | | |
| `message-renderer.ts` | Custom message rendering | `registerMessageRenderer`, `sendMessage` |
-| `event-bus.ts` | Inter-extension events | `companion.events` |
+| `event-bus.ts` | Inter-extension events | `clanker.events` |
| **Session Metadata** | | |
| `session-name.ts` | Name sessions for selector | `setSessionName`, `getSessionName` |
| `bookmark.ts` | Bookmark entries for /tree | `setLabel` |
diff --git a/packages/coding-agent/companion-out/docs/images/doom-extension.png b/packages/coding-agent/clanker-out/docs/images/doom-extension.png
similarity index 100%
rename from packages/coding-agent/companion-out/docs/images/doom-extension.png
rename to packages/coding-agent/clanker-out/docs/images/doom-extension.png
diff --git a/packages/coding-agent/companion-out/docs/images/exy.png b/packages/coding-agent/clanker-out/docs/images/exy.png
similarity index 100%
rename from packages/coding-agent/companion-out/docs/images/exy.png
rename to packages/coding-agent/clanker-out/docs/images/exy.png
diff --git a/packages/coding-agent/companion-out/docs/images/interactive-mode.png b/packages/coding-agent/clanker-out/docs/images/interactive-mode.png
similarity index 100%
rename from packages/coding-agent/companion-out/docs/images/interactive-mode.png
rename to packages/coding-agent/clanker-out/docs/images/interactive-mode.png
diff --git a/packages/coding-agent/companion-out/docs/images/tree-view.png b/packages/coding-agent/clanker-out/docs/images/tree-view.png
similarity index 100%
rename from packages/coding-agent/companion-out/docs/images/tree-view.png
rename to packages/coding-agent/clanker-out/docs/images/tree-view.png
diff --git a/packages/coding-agent/companion-out/docs/json.md b/packages/coding-agent/clanker-out/docs/json.md
similarity index 82%
rename from packages/coding-agent/companion-out/docs/json.md
rename to packages/coding-agent/clanker-out/docs/json.md
index 16191cb..67d9274 100644
--- a/packages/coding-agent/companion-out/docs/json.md
+++ b/packages/coding-agent/clanker-out/docs/json.md
@@ -1,14 +1,14 @@
# JSON Event Stream Mode
```bash
-companion --mode json "Your prompt"
+clanker --mode json "Your prompt"
```
-Outputs all session events as JSON lines to stdout. Useful for integrating companion into other tools or custom UIs.
+Outputs all session events as JSON lines to stdout. Useful for integrating clanker into other tools or custom UIs.
## Event Types
-Events are defined in [`AgentSessionEvent`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
+Events are defined in [`AgentSessionEvent`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
```typescript
type AgentSessionEvent =
@@ -36,7 +36,7 @@ type AgentSessionEvent =
};
```
-Base events from [`AgentEvent`](https://github.com/badlogic/companion-mono/blob/main/packages/agent/src/types.ts#L179):
+Base events from [`AgentEvent`](https://github.com/badlogic/clanker-agent/blob/main/packages/agent/src/types.ts#L179):
```typescript
type AgentEvent =
@@ -83,13 +83,13 @@ type AgentEvent =
## Message Types
-Base messages from [`packages/ai/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/types.ts#L134):
+Base messages from [`packages/ai/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/types.ts#L134):
- `UserMessage` (line 134)
- `AssistantMessage` (line 140)
- `ToolResultMessage` (line 152)
-Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/messages.ts#L29):
+Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/messages.ts#L29):
- `BashExecutionMessage` (line 29)
- `CustomMessage` (line 46)
@@ -125,5 +125,5 @@ Followed by events as they occur:
## Example
```bash
-companion --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
+clanker --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
```
diff --git a/packages/coding-agent/companion-out/docs/keybindings.md b/packages/coding-agent/clanker-out/docs/keybindings.md
similarity index 97%
rename from packages/coding-agent/companion-out/docs/keybindings.md
rename to packages/coding-agent/clanker-out/docs/keybindings.md
index 0713545..7d38ffc 100644
--- a/packages/coding-agent/companion-out/docs/keybindings.md
+++ b/packages/coding-agent/clanker-out/docs/keybindings.md
@@ -1,6 +1,6 @@
# Keybindings
-All keyboard shortcuts can be customized via `~/.companion/agent/keybindings.json`. Each action can be bound to one or more keys.
+All keyboard shortcuts can be customized via `~/.clanker/agent/keybindings.json`. Each action can be bound to one or more keys.
## Key Format
@@ -132,7 +132,7 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, etc.
## Custom Configuration
-Create `~/.companion/agent/keybindings.json`:
+Create `~/.clanker/agent/keybindings.json`:
```json
{
diff --git a/packages/coding-agent/companion-out/docs/models.md b/packages/coding-agent/clanker-out/docs/models.md
similarity index 99%
rename from packages/coding-agent/companion-out/docs/models.md
rename to packages/coding-agent/clanker-out/docs/models.md
index f35a624..bd6d8e2 100644
--- a/packages/coding-agent/companion-out/docs/models.md
+++ b/packages/coding-agent/clanker-out/docs/models.md
@@ -1,6 +1,6 @@
# Custom Models
-Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.companion/agent/models.json`.
+Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.clanker/agent/models.json`.
## Table of Contents
diff --git a/packages/coding-agent/companion-out/docs/packages.md b/packages/coding-agent/clanker-out/docs/packages.md
similarity index 55%
rename from packages/coding-agent/companion-out/docs/packages.md
rename to packages/coding-agent/clanker-out/docs/packages.md
index 85d8fc5..f423c17 100644
--- a/packages/coding-agent/companion-out/docs/packages.md
+++ b/packages/coding-agent/clanker-out/docs/packages.md
@@ -1,14 +1,14 @@
-> companion can help you create companion packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
+> clanker can help you create clanker packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
-# Companion Packages
+# Clanker Packages
-Companion packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `companion` key, or use conventional directories.
+Clanker packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `clanker` key, or use conventional directories.
## Table of Contents
- [Install and Manage](#install-and-manage)
- [Package Sources](#package-sources)
-- [Creating a Companion Package](#creating-a-companion-package)
+- [Creating a Clanker Package](#creating-a-clanker-package)
- [Package Structure](#package-structure)
- [Dependencies](#dependencies)
- [Package Filtering](#package-filtering)
@@ -17,32 +17,32 @@ Companion packages bundle extensions, skills, prompt templates, and themes so yo
## Install and Manage
-> **Security:** Companion packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
+> **Security:** Clanker packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
```bash
-companion install npm:@foo/bar@1.0.0
-companion install git:github.com/user/repo@v1
-companion install https://github.com/user/repo # raw URLs work too
-companion install /absolute/path/to/package
-companion install ./relative/path/to/package
+clanker install npm:@foo/bar@1.0.0
+clanker install git:github.com/user/repo@v1
+clanker install https://github.com/user/repo # raw URLs work too
+clanker install /absolute/path/to/package
+clanker install ./relative/path/to/package
-companion remove npm:@foo/bar
-companion list # show installed packages from settings
-companion update # update all non-pinned packages
+clanker remove npm:@foo/bar
+clanker list # show installed packages from settings
+clanker update # update all non-pinned packages
```
-By default, `install` and `remove` write to global settings (`~/.companion/agent/settings.json`). Use `-l` to write to project settings (`.companion/settings.json`) instead. Project settings can be shared with your team, and companion installs any missing packages automatically on startup.
+By default, `install` and `remove` write to global settings (`~/.clanker/agent/settings.json`). Use `-l` to write to project settings (`.clanker/settings.json`) instead. Project settings can be shared with your team, and clanker installs any missing packages automatically on startup.
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
```bash
-companion -e npm:@foo/bar
-companion -e git:github.com/user/repo
+clanker -e npm:@foo/bar
+clanker -e git:github.com/user/repo
```
## Package Sources
-Companion accepts three source types in settings and `companion install`.
+Clanker accepts three source types in settings and `clanker install`.
### npm
@@ -51,9 +51,9 @@ npm:@scope/pkg@1.2.3
npm:pkg
```
-- Versioned specs are pinned and skipped by `companion update`.
+- Versioned specs are pinned and skipped by `clanker update`.
- Global installs use `npm install -g`.
-- Project installs go under `.companion/npm/`.
+- Project installs go under `.clanker/npm/`.
### git
@@ -69,21 +69,21 @@ ssh://git@github.com/user/repo@v1
- HTTPS and SSH URLs are both supported.
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
-- Refs pin the package and skip `companion update`.
-- Cloned to `~/.companion/agent/git//` (global) or `.companion/git//` (project).
+- Refs pin the package and skip `clanker update`.
+- Cloned to `~/.clanker/agent/git//` (global) or `.clanker/git//` (project).
- Runs `npm install` after clone or pull if `package.json` exists.
**SSH examples:**
```bash
# git@host:path shorthand (requires git: prefix)
-companion install git:git@github.com:user/repo
+clanker install git:git@github.com:user/repo
# ssh:// protocol format
-companion install ssh://git@github.com/user/repo
+clanker install ssh://git@github.com/user/repo
# With version ref
-companion install git:git@github.com:user/repo@v1.0.0
+clanker install git:git@github.com:user/repo@v1.0.0
```
### Local Paths
@@ -93,17 +93,17 @@ companion install git:git@github.com:user/repo@v1.0.0
./relative/path/to/package
```
-Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, companion loads resources using package rules.
+Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, clanker loads resources using package rules.
-## Creating a Companion Package
+## Creating a Clanker Package
-Add a `companion` manifest to `package.json` or use conventional directories. Include the `companion-package` keyword for discoverability.
+Add a `clanker` manifest to `package.json` or use conventional directories. Include the `clanker-package` keyword for discoverability.
```json
{
"name": "my-package",
- "keywords": ["companion-package"],
- "companion": {
+ "keywords": ["clanker-package"],
+ "clanker": {
"extensions": ["./extensions"],
"skills": ["./skills"],
"prompts": ["./prompts"],
@@ -116,13 +116,13 @@ Paths are relative to the package root. Arrays support glob patterns and `!exclu
### Gallery Metadata
-The [package gallery](https://shittycodingagent.ai/packages) displays packages tagged with `companion-package`. Add `video` or `image` fields to show a preview:
+The [package gallery](https://clanker.dev/packages) displays packages tagged with `clanker-package`. Add `video` or `image` fields to show a preview:
```json
{
"name": "my-package",
- "keywords": ["companion-package"],
- "companion": {
+ "keywords": ["clanker-package"],
+ "clanker": {
"extensions": ["./extensions"],
"video": "https://example.com/demo.mp4",
"image": "https://example.com/screenshot.png"
@@ -139,7 +139,7 @@ If both are set, video takes precedence.
### Convention Directories
-If no `companion` manifest is present, companion auto-discovers resources from these directories:
+If no `clanker` manifest is present, clanker auto-discovers resources from these directories:
- `extensions/` loads `.ts` and `.js` files
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
@@ -148,11 +148,11 @@ If no `companion` manifest is present, companion auto-discovers resources from t
## Dependencies
-Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When companion installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
+Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When clanker installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
-Companion bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/companion-ai`, `@mariozechner/companion-agent-core`, `@mariozechner/companion-coding-agent`, `@mariozechner/companion-tui`, `@sinclair/typebox`.
+Clanker bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/clanker-ai`, `@mariozechner/clanker-agent-core`, `@mariozechner/clanker-coding-agent`, `@mariozechner/clanker-tui`, `@sinclair/typebox`.
-Other companion packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Companion loads packages with separate module roots, so separate installs do not collide or share modules.
+Other clanker packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Clanker loads packages with separate module roots, so separate installs do not collide or share modules.
Example:
@@ -162,7 +162,7 @@ Example:
"shitty-extensions": "^1.0.1"
},
"bundledDependencies": ["shitty-extensions"],
- "companion": {
+ "clanker": {
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
"skills": ["skills", "node_modules/shitty-extensions/skills"]
}
@@ -199,7 +199,7 @@ Filter what a package loads using the object form in settings:
## Enable and Disable Resources
-Use `companion config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.companion/agent`) and project (`.companion/`) scopes.
+Use `clanker config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.clanker/agent`) and project (`.clanker/`) scopes.
## Scope and Deduplication
diff --git a/packages/coding-agent/companion-out/docs/prompt-templates.md b/packages/coding-agent/clanker-out/docs/prompt-templates.md
similarity index 84%
rename from packages/coding-agent/companion-out/docs/prompt-templates.md
rename to packages/coding-agent/clanker-out/docs/prompt-templates.md
index 6dbe903..5ffad5e 100644
--- a/packages/coding-agent/companion-out/docs/prompt-templates.md
+++ b/packages/coding-agent/clanker-out/docs/prompt-templates.md
@@ -1,4 +1,4 @@
-> companion can create prompt templates. Ask it to build one for your workflow.
+> clanker can create prompt templates. Ask it to build one for your workflow.
# Prompt Templates
@@ -6,11 +6,11 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
## Locations
-Companion loads prompt templates from:
+Clanker loads prompt templates from:
-- Global: `~/.companion/agent/prompts/*.md`
-- Project: `.companion/prompts/*.md`
-- Packages: `prompts/` directories or `companion.prompts` entries in `package.json`
+- Global: `~/.clanker/agent/prompts/*.md`
+- Project: `.clanker/prompts/*.md`
+- Packages: `prompts/` directories or `clanker.prompts` entries in `package.json`
- Settings: `prompts` array with files or directories
- CLI: `--prompt-template ` (repeatable)
diff --git a/packages/coding-agent/companion-out/docs/providers.md b/packages/coding-agent/clanker-out/docs/providers.md
similarity index 89%
rename from packages/coding-agent/companion-out/docs/providers.md
rename to packages/coding-agent/clanker-out/docs/providers.md
index d190306..9b7ff64 100644
--- a/packages/coding-agent/companion-out/docs/providers.md
+++ b/packages/coding-agent/clanker-out/docs/providers.md
@@ -1,6 +1,6 @@
# Providers
-Companion supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, companion knows all available models. The list is updated with every companion release.
+Clanker supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, clanker knows all available models. The list is updated with every clanker release.
## Table of Contents
@@ -21,7 +21,7 @@ Use `/login` in interactive mode, then select a provider:
- Google Gemini CLI
- Google Antigravity
-Use `/logout` to clear credentials. Tokens are stored in `~/.companion/agent/auth.json` and auto-refresh when expired.
+Use `/logout` to clear credentials. Tokens are stored in `~/.clanker/agent/auth.json` and auto-refresh when expired.
### GitHub Copilot
@@ -48,7 +48,7 @@ Set via environment variable:
```bash
export ANTHROPIC_API_KEY=sk-ant-...
-companion
+clanker
```
| Provider | Environment Variable | `auth.json` key |
@@ -71,11 +71,11 @@ companion
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
-Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/env-api-keys.ts).
+Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/env-api-keys.ts).
#### Auth File
-Store credentials in `~/.companion/agent/auth.json`:
+Store credentials in `~/.clanker/agent/auth.json`:
```json
{
@@ -144,7 +144,7 @@ export AWS_REGION=us-west-2
Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
```bash
-companion --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
+clanker --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
```
If you are connecting to a Bedrock API proxy, the following environment variables can be used:
diff --git a/packages/coding-agent/companion-out/docs/rpc.md b/packages/coding-agent/clanker-out/docs/rpc.md
similarity index 97%
rename from packages/coding-agent/companion-out/docs/rpc.md
rename to packages/coding-agent/clanker-out/docs/rpc.md
index 8686e8e..ffd8b60 100644
--- a/packages/coding-agent/companion-out/docs/rpc.md
+++ b/packages/coding-agent/clanker-out/docs/rpc.md
@@ -2,12 +2,12 @@
RPC mode enables headless operation of the coding agent via a JSON protocol over stdin/stdout. This is useful for embedding the agent in other applications, IDEs, or custom UIs.
-**Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `@mariozechner/companion-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
+**Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `@mariozechner/clanker-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
## Starting RPC Mode
```bash
-companion --mode rpc [options]
+clanker --mode rpc [options]
```
Common options:
@@ -60,7 +60,7 @@ With images:
If the agent is streaming and no `streamingBehavior` is specified, the command returns an error.
-**Extension commands**: If the message is an extension command (e.g., `/mycommand`), it executes immediately even during streaming. Extension commands manage their own LLM interaction via `companion.sendMessage()`.
+**Extension commands**: If the message is an extension command (e.g., `/mycommand`), it executes immediately even during streaming. Extension commands manage their own LLM interaction via `clanker.sendMessage()`.
**Input expansion**: Skill commands (`/skill:name`) and prompt templates (`/template`) are expanded before sending/queueing.
@@ -503,7 +503,7 @@ If output was truncated, includes `fullOutputPath`:
"exitCode": 0,
"cancelled": false,
"truncated": true,
- "fullOutputPath": "/tmp/companion-bash-abc123.log"
+ "fullOutputPath": "/tmp/clanker-bash-abc123.log"
}
}
```
@@ -752,21 +752,21 @@ Response:
"name": "session-name",
"description": "Set or clear session name",
"source": "extension",
- "path": "/home/user/.companion/agent/extensions/session.ts"
+ "path": "/home/user/.clanker/agent/extensions/session.ts"
},
{
"name": "fix-tests",
"description": "Fix failing tests",
"source": "prompt",
"location": "project",
- "path": "/home/user/myproject/.companion/agent/prompts/fix-tests.md"
+ "path": "/home/user/myproject/.clanker/agent/prompts/fix-tests.md"
},
{
"name": "skill:brave-search",
"description": "Web search via Brave API",
"source": "skill",
"location": "user",
- "path": "/home/user/.companion/agent/skills/brave-search/SKILL.md"
+ "path": "/home/user/.clanker/agent/skills/brave-search/SKILL.md"
}
]
}
@@ -778,12 +778,12 @@ Each command has:
- `name`: Command name (invoke with `/name`)
- `description`: Human-readable description (optional for extension commands)
- `source`: What kind of command:
- - `"extension"`: Registered via `companion.registerCommand()` in an extension
+ - `"extension"`: Registered via `clanker.registerCommand()` in an extension
- `"prompt"`: Loaded from a prompt template `.md` file
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
- `location`: Where it was loaded from (optional, not present for extensions):
- - `"user"`: User-level (`~/.companion/agent/`)
- - `"project"`: Project-level (`./.companion/agent/`)
+ - `"user"`: User-level (`~/.clanker/agent/`)
+ - `"project"`: Project-level (`./.clanker/agent/`)
- `"path"`: Explicit path via CLI or settings
- `path`: Absolute file path to the command source (optional)
@@ -1173,7 +1173,7 @@ Set the terminal window/tab title. Fire-and-forget.
"type": "extension_ui_request",
"id": "uuid-8",
"method": "setTitle",
- "title": "companion - my project"
+ "title": "clanker - my project"
}
```
@@ -1372,7 +1372,7 @@ import subprocess
import json
proc = subprocess.Popen(
- ["companion", "--mode", "rpc", "--no-session"],
+ ["clanker", "--mode", "rpc", "--no-session"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
text=True
@@ -1411,7 +1411,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
const { spawn } = require("child_process");
const readline = require("readline");
-const agent = spawn("companion", ["--mode", "rpc", "--no-session"]);
+const agent = spawn("clanker", ["--mode", "rpc", "--no-session"]);
readline.createInterface({ input: agent.stdout }).on("line", (line) => {
const event = JSON.parse(line);
diff --git a/packages/coding-agent/companion-out/docs/sdk.md b/packages/coding-agent/clanker-out/docs/sdk.md
similarity index 91%
rename from packages/coding-agent/companion-out/docs/sdk.md
rename to packages/coding-agent/clanker-out/docs/sdk.md
index d30d4f2..3ffbb77 100644
--- a/packages/coding-agent/companion-out/docs/sdk.md
+++ b/packages/coding-agent/clanker-out/docs/sdk.md
@@ -1,8 +1,8 @@
-> companion can help you use the SDK. Ask it to build an integration for your use case.
+> clanker can help you use the SDK. Ask it to build an integration for your use case.
# SDK
-The SDK provides programmatic access to companion's agent capabilities. Use it to embed companion in other applications, build custom interfaces, or integrate with automated workflows.
+The SDK provides programmatic access to clanker's agent capabilities. Use it to embed clanker in other applications, build custom interfaces, or integrate with automated workflows.
**Example use cases:**
@@ -22,7 +22,7 @@ import {
createAgentSession,
ModelRegistry,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Set up credential storage and model registry
const authStorage = AuthStorage.create();
@@ -49,7 +49,7 @@ await session.prompt("What files are in the current directory?");
## Installation
```bash
-npm install @mariozechner/companion-coding-agent
+npm install @mariozechner/clanker-coding-agent
```
The SDK is included in the main package. No separate installation needed.
@@ -63,7 +63,7 @@ The main factory function. Creates an `AgentSession` with configurable options.
`createAgentSession()` uses a `ResourceLoader` to supply extensions, skills, prompt templates, themes, and context files. If you do not provide one, it uses `DefaultResourceLoader` with standard discovery.
```typescript
-import { createAgentSession } from "@mariozechner/companion-coding-agent";
+import { createAgentSession } from "@mariozechner/clanker-coding-agent";
// Minimal: defaults with DefaultResourceLoader
const { session } = await createAgentSession();
@@ -170,7 +170,7 @@ await session.prompt("After you're done, also check X", {
**Behavior:**
-- **Extension commands** (e.g., `/mycommand`): Execute immediately, even during streaming. They manage their own LLM interaction via `companion.sendMessage()`.
+- **Extension commands** (e.g., `/mycommand`): Execute immediately, even during streaming. They manage their own LLM interaction via `clanker.sendMessage()`.
- **File-based prompt templates** (from `.md` files): Expanded to their content before sending/queueing.
- **During streaming without `streamingBehavior`**: Throws an error. Use `steer()` or `followUp()` directly, or specify the option.
@@ -188,7 +188,7 @@ Both `steer()` and `followUp()` expand file-based prompt templates but error on
### Agent and AgentState
-The `Agent` class (from `@mariozechner/companion-agent-core`) handles the core LLM interaction. Access it via `session.agent`.
+The `Agent` class (from `@mariozechner/clanker-agent-core`) handles the core LLM interaction. Access it via `session.agent`.
```typescript
// Access current state
@@ -279,17 +279,17 @@ const { session } = await createAgentSession({
cwd: process.cwd(), // default
// Global config directory
- agentDir: "~/.companion/agent", // default (expands ~)
+ agentDir: "~/.clanker/agent", // default (expands ~)
});
```
`cwd` is used by `DefaultResourceLoader` for:
-- Project extensions (`.companion/extensions/`)
+- Project extensions (`.clanker/extensions/`)
- Project skills:
- - `.companion/skills/`
+ - `.clanker/skills/`
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
-- Project prompts (`.companion/prompts/`)
+- Project prompts (`.clanker/prompts/`)
- Context files (`AGENTS.md` walking up from cwd)
- Session directory naming
@@ -297,7 +297,7 @@ const { session } = await createAgentSession({
- Global extensions (`extensions/`)
- Global skills:
- - `skills/` under `agentDir` (for example `~/.companion/agent/skills/`)
+ - `skills/` under `agentDir` (for example `~/.clanker/agent/skills/`)
- `~/.agents/skills/`
- Global prompts (`prompts/`)
- Global context file (`AGENTS.md`)
@@ -311,11 +311,11 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
### Model
```typescript
-import { getModel } from "@mariozechner/companion-ai";
+import { getModel } from "@mariozechner/clanker-ai";
import {
AuthStorage,
ModelRegistry,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const authStorage = AuthStorage.create();
const modelRegistry = new ModelRegistry(authStorage);
@@ -365,9 +365,9 @@ API key resolution priority (handled by AuthStorage):
import {
AuthStorage,
ModelRegistry,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
-// Default: uses ~/.companion/agent/auth.json and ~/.companion/agent/models.json
+// Default: uses ~/.clanker/agent/auth.json and ~/.clanker/agent/models.json
const authStorage = AuthStorage.create();
const modelRegistry = new ModelRegistry(authStorage);
@@ -402,7 +402,7 @@ Use a `ResourceLoader` to override the system prompt:
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
systemPromptOverride: () => "You are a helpful assistant.",
@@ -425,7 +425,7 @@ import {
grepTool,
findTool,
lsTool,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Use built-in tool set
const { session } = await createAgentSession({
@@ -453,7 +453,7 @@ import {
createGrepTool,
createFindTool,
createLsTool,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const cwd = "/path/to/project";
@@ -472,7 +472,7 @@ const { session } = await createAgentSession({
**When you don't need factories:**
-- If you omit `tools`, companion automatically creates them with the correct `cwd`
+- If you omit `tools`, clanker automatically creates them with the correct `cwd`
- If you use `process.cwd()` as your `cwd`, the pre-built instances work fine
**When you must use factories:**
@@ -486,7 +486,7 @@ import { Type } from "@sinclair/typebox";
import {
createAgentSession,
type ToolDefinition,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Inline custom tool
const myTool: ToolDefinition = {
@@ -508,23 +508,23 @@ const { session } = await createAgentSession({
});
```
-Custom tools passed via `customTools` are combined with extension-registered tools. Extensions loaded by the ResourceLoader can also register tools via `companion.registerTool()`.
+Custom tools passed via `customTools` are combined with extension-registered tools. Extensions loaded by the ResourceLoader can also register tools via `clanker.registerTool()`.
### Extensions
-Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.companion/agent/extensions/`, `.companion/extensions/`, and settings.json extension sources.
+Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.clanker/agent/extensions/`, `.clanker/extensions/`, and settings.json extension sources.
```typescript
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
additionalExtensionPaths: ["/path/to/my-extension.ts"],
extensionFactories: [
- (companion) => {
- companion.on("agent_start", () => {
+ (clanker) => {
+ clanker.on("agent_start", () => {
console.log("[Inline Extension] Agent starting");
});
},
@@ -537,13 +537,13 @@ const { session } = await createAgentSession({ resourceLoader: loader });
Extensions can register tools, subscribe to events, add commands, and more. See [extensions.md](extensions.md) for the full API.
-**Event Bus:** Extensions can communicate via `companion.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
+**Event Bus:** Extensions can communicate via `clanker.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
```typescript
import {
createEventBus,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const eventBus = createEventBus();
const loader = new DefaultResourceLoader({
@@ -561,7 +561,7 @@ import {
createAgentSession,
DefaultResourceLoader,
type Skill,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const customSkill: Skill = {
name: "my-skill",
@@ -588,7 +588,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
agentsFilesOverride: (current) => ({
@@ -610,7 +610,7 @@ import {
createAgentSession,
DefaultResourceLoader,
type PromptTemplate,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const customCommand: PromptTemplate = {
name: "deploy",
@@ -638,7 +638,7 @@ Sessions use a tree structure with `id`/`parentId` linking, enabling in-place br
import {
createAgentSession,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// In-memory (no persistence)
const { session } = await createAgentSession({
@@ -713,7 +713,7 @@ import {
createAgentSession,
SettingsManager,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Default: loads from files (global + project merged)
const { session } = await createAgentSession({
@@ -749,8 +749,8 @@ const { session } = await createAgentSession({
Settings load from two locations and merge:
-1. Global: `~/.companion/agent/settings.json`
-2. Project: `/.companion/settings.json`
+1. Global: `~/.clanker/agent/settings.json`
+2. Project: `/.clanker/settings.json`
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
@@ -769,7 +769,7 @@ Use `DefaultResourceLoader` to discover extensions, skills, prompts, themes, and
import {
DefaultResourceLoader,
getAgentDir,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
cwd,
@@ -810,7 +810,7 @@ interface LoadExtensionsResult {
## Complete Example
```typescript
-import { getModel } from "@mariozechner/companion-ai";
+import { getModel } from "@mariozechner/clanker-ai";
import { Type } from "@sinclair/typebox";
import {
AuthStorage,
@@ -822,7 +822,7 @@ import {
readTool,
bashTool,
type ToolDefinition,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Set up auth storage (custom location)
const authStorage = AuthStorage.create("/custom/agent/auth.json");
@@ -905,7 +905,7 @@ Full TUI interactive mode with editor, chat history, and all built-in commands:
import {
createAgentSession,
InteractiveMode,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -931,7 +931,7 @@ Single-shot mode: send prompts, output result, exit:
import {
createAgentSession,
runPrintMode,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -953,7 +953,7 @@ JSON-RPC mode for subprocess integration:
import {
createAgentSession,
runRpcMode,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -969,7 +969,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
For subprocess-based integration without building with the SDK, use the CLI directly:
```bash
-companion --mode rpc --no-session
+clanker --mode rpc --no-session
```
See [RPC documentation](rpc.md) for the JSON protocol.
diff --git a/packages/coding-agent/companion-out/docs/session.md b/packages/coding-agent/clanker-out/docs/session.md
similarity index 90%
rename from packages/coding-agent/companion-out/docs/session.md
rename to packages/coding-agent/clanker-out/docs/session.md
index b4d5d27..2f929aa 100644
--- a/packages/coding-agent/companion-out/docs/session.md
+++ b/packages/coding-agent/clanker-out/docs/session.md
@@ -5,16 +5,16 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
## File Location
```
-~/.companion/agent/sessions/----/_.jsonl
+~/.clanker/agent/sessions/----/_.jsonl
```
Where `` is the working directory with `/` replaced by `-`.
## Deleting Sessions
-Sessions can be removed by deleting their `.jsonl` files under `~/.companion/agent/sessions/`.
+Sessions can be removed by deleting their `.jsonl` files under `~/.clanker/agent/sessions/`.
-Companion also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, companion uses the `trash` CLI to avoid permanent deletion.
+Clanker also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, clanker uses the `trash` CLI to avoid permanent deletion.
## Session Version
@@ -28,14 +28,14 @@ Existing sessions are automatically migrated to the current version (v3) when lo
## Source Files
-Source on GitHub ([companion-mono](https://github.com/badlogic/companion-mono)):
+Source on GitHub ([clanker-agent](https://github.com/badlogic/clanker-agent)):
-- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
-- [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
-- [`packages/ai/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
-- [`packages/agent/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
+- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
+- [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
+- [`packages/ai/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
+- [`packages/agent/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/agent/src/types.ts) - AgentMessage union type
-For TypeScript definitions in your project, inspect `node_modules/@mariozechner/companion-coding-agent/dist/` and `node_modules/@mariozechner/companion-ai/dist/`.
+For TypeScript definitions in your project, inspect `node_modules/@mariozechner/clanker-coding-agent/dist/` and `node_modules/@mariozechner/clanker-ai/dist/`.
## Message Types
@@ -70,7 +70,7 @@ interface ToolCall {
}
```
-### Base Message Types (from companion-ai)
+### Base Message Types (from clanker-ai)
```typescript
interface UserMessage {
@@ -117,7 +117,7 @@ interface Usage {
}
```
-### Extended Message Types (from companion-coding-agent)
+### Extended Message Types (from clanker-coding-agent)
```typescript
interface BashExecutionMessage {
@@ -269,7 +269,7 @@ Created when context is compacted. Stores a summary of earlier messages.
Optional fields:
- `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
-- `fromHook`: `true` if generated by an extension, `false`/`undefined` if companion-generated (legacy field name)
+- `fromHook`: `true` if generated by an extension, `false`/`undefined` if clanker-generated (legacy field name)
### BranchSummaryEntry
@@ -289,7 +289,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
Optional fields:
- `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
-- `fromHook`: `true` if generated by an extension, `false`/`undefined` if companion-generated (legacy field name)
+- `fromHook`: `true` if generated by an extension, `false`/`undefined` if clanker-generated (legacy field name)
### CustomEntry
@@ -349,7 +349,7 @@ Set `label` to `undefined` to clear a label.
### SessionInfoEntry
-Session metadata (e.g., user-defined display name). Set via `/name` command or `companion.setSessionName()` in extensions.
+Session metadata (e.g., user-defined display name). Set via `/name` command or `clanker.setSessionName()` in extensions.
```json
{
diff --git a/packages/coding-agent/companion-out/docs/settings.md b/packages/coding-agent/clanker-out/docs/settings.md
similarity index 92%
rename from packages/coding-agent/companion-out/docs/settings.md
rename to packages/coding-agent/clanker-out/docs/settings.md
index 9bf4cd8..575e311 100644
--- a/packages/coding-agent/companion-out/docs/settings.md
+++ b/packages/coding-agent/clanker-out/docs/settings.md
@@ -1,11 +1,11 @@
# Settings
-Companion uses JSON settings files with project settings overriding global settings.
+Clanker uses JSON settings files with project settings overriding global settings.
| Location | Scope |
| ---------------------------------- | --------------------------- |
-| `~/.companion/agent/settings.json` | Global (all projects) |
-| `.companion/settings.json` | Project (current directory) |
+| `~/.clanker/agent/settings.json` | Global (all projects) |
+| `.clanker/settings.json` | Project (current directory) |
Edit directly or use `/settings` for common options.
@@ -140,7 +140,7 @@ When a provider requests a retry delay longer than `maxDelayMs` (e.g., Google's
These settings define where to load extensions, skills, prompts, and themes from.
-Paths in `~/.companion/agent/settings.json` resolve relative to `~/.companion/agent`. Paths in `.companion/settings.json` resolve relative to `.companion`. Absolute paths and `~` are supported.
+Paths in `~/.clanker/agent/settings.json` resolve relative to `~/.clanker/agent`. Paths in `.clanker/settings.json` resolve relative to `.clanker`. Absolute paths and `~` are supported.
| Setting | Type | Default | Description |
| --------------------- | -------- | ------- | ------------------------------------------ |
@@ -159,7 +159,7 @@ String form loads all resources from a package:
```json
{
- "packages": ["companion-skills", "@org/my-extension"]
+ "packages": ["clanker-skills", "@org/my-extension"]
}
```
@@ -169,7 +169,7 @@ Object form filters which resources to load:
{
"packages": [
{
- "source": "companion-skills",
+ "source": "clanker-skills",
"skills": ["brave-search", "transcribe"],
"extensions": []
}
@@ -197,22 +197,22 @@ See [packages.md](packages.md) for package management details.
"maxRetries": 3
},
"enabledModels": ["claude-*", "gpt-4o"],
- "packages": ["companion-skills"]
+ "packages": ["clanker-skills"]
}
```
## Project Overrides
-Project settings (`.companion/settings.json`) override global settings. Nested objects are merged:
+Project settings (`.clanker/settings.json`) override global settings. Nested objects are merged:
```json
-// ~/.companion/agent/settings.json (global)
+// ~/.clanker/agent/settings.json (global)
{
"theme": "dark",
"compaction": { "enabled": true, "reserveTokens": 16384 }
}
-// .companion/settings.json (project)
+// .clanker/settings.json (project)
{
"compaction": { "reserveTokens": 8192 }
}
diff --git a/packages/coding-agent/companion-out/docs/shell-aliases.md b/packages/coding-agent/clanker-out/docs/shell-aliases.md
similarity index 53%
rename from packages/coding-agent/companion-out/docs/shell-aliases.md
rename to packages/coding-agent/clanker-out/docs/shell-aliases.md
index 3e014d4..c05e2dc 100644
--- a/packages/coding-agent/companion-out/docs/shell-aliases.md
+++ b/packages/coding-agent/clanker-out/docs/shell-aliases.md
@@ -1,8 +1,8 @@
# Shell Aliases
-Companion runs bash in non-interactive mode (`bash -c`), which doesn't expand aliases by default.
+Clanker runs bash in non-interactive mode (`bash -c`), which doesn't expand aliases by default.
-To enable your shell aliases, add to `~/.companion/agent/settings.json`:
+To enable your shell aliases, add to `~/.clanker/agent/settings.json`:
```json
{
diff --git a/packages/coding-agent/companion-out/docs/skills.md b/packages/coding-agent/clanker-out/docs/skills.md
similarity index 88%
rename from packages/coding-agent/companion-out/docs/skills.md
rename to packages/coding-agent/clanker-out/docs/skills.md
index 0754c08..807efa6 100644
--- a/packages/coding-agent/companion-out/docs/skills.md
+++ b/packages/coding-agent/clanker-out/docs/skills.md
@@ -1,10 +1,10 @@
-> companion can create skills. Ask it to build one for your use case.
+> clanker can create skills. Ask it to build one for your use case.
# Skills
Skills are self-contained capability packages that the agent loads on-demand. A skill provides specialized workflows, setup instructions, helper scripts, and reference documentation for specific tasks.
-Companion implements the [Agent Skills standard](https://agentskills.io/specification), warning about violations but remaining lenient.
+Clanker implements the [Agent Skills standard](https://agentskills.io/specification), warning about violations but remaining lenient.
## Table of Contents
@@ -21,15 +21,15 @@ Companion implements the [Agent Skills standard](https://agentskills.io/specific
> **Security:** Skills can instruct the model to perform any action and may include executable code the model invokes. Review skill content before use.
-Companion loads skills from:
+Clanker loads skills from:
- Global:
- - `~/.companion/agent/skills/`
+ - `~/.clanker/agent/skills/`
- `~/.agents/skills/`
- Project:
- - `.companion/skills/`
+ - `.clanker/skills/`
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
-- Packages: `skills/` directories or `companion.skills` entries in `package.json`
+- Packages: `skills/` directories or `clanker.skills` entries in `package.json`
- Settings: `skills` array with files or directories
- CLI: `--skill ` (repeatable, additive even with `--no-skills`)
@@ -50,7 +50,7 @@ To use skills from Claude Code or OpenAI Codex, add their directories to setting
}
```
-For project-level Claude Code skills, add to `.companion/settings.json`:
+For project-level Claude Code skills, add to `.clanker/settings.json`:
```json
{
@@ -60,7 +60,7 @@ For project-level Claude Code skills, add to `.companion/settings.json`:
## How Skills Work
-1. At startup, companion scans skill locations and extracts names and descriptions
+1. At startup, clanker scans skill locations and extracts names and descriptions
2. The system prompt includes available skills in XML format per the [specification](https://agentskills.io/integrate-skills)
3. When a task matches, the agent uses `read` to load the full SKILL.md (models don't always do this; use prompting or `/skill:name` to force it)
4. The agent follows the instructions, using relative paths to reference scripts and assets
@@ -174,7 +174,7 @@ description: Helps with PDFs.
## Validation
-Companion validates skills against the Agent Skills standard. Most issues produce warnings but still load the skill:
+Clanker validates skills against the Agent Skills standard. Most issues produce warnings but still load the skill:
- Name doesn't match parent directory
- Name exceeds 64 characters or contains invalid characters
@@ -229,4 +229,4 @@ cd /path/to/brave-search && npm install
## Skill Repositories
- [Anthropic Skills](https://github.com/anthropics/skills) - Document processing (docx, pdf, pptx, xlsx), web development
-- [Companion Skills](https://github.com/badlogic/companion-skills) - Web search, browser automation, Google APIs, transcription
+- [Clanker Skills](https://github.com/badlogic/clanker-skills) - Web search, browser automation, Google APIs, transcription
diff --git a/packages/coding-agent/companion-out/docs/terminal-setup.md b/packages/coding-agent/clanker-out/docs/terminal-setup.md
similarity index 79%
rename from packages/coding-agent/companion-out/docs/terminal-setup.md
rename to packages/coding-agent/clanker-out/docs/terminal-setup.md
index ccccdc5..7a9cf6f 100644
--- a/packages/coding-agent/companion-out/docs/terminal-setup.md
+++ b/packages/coding-agent/clanker-out/docs/terminal-setup.md
@@ -1,6 +1,6 @@
# Terminal Setup
-Companion uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
+Clanker uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
## Kitty, iTerm2
@@ -66,6 +66,6 @@ If you already have an `actions` array, add the object to it.
The built-in terminal has limited escape sequence support. Shift+Enter cannot be distinguished from Enter in IntelliJ's terminal.
-If you want the hardware cursor visible, set `COMPANION_HARDWARE_CURSOR=1` before running companion (disabled by default for compatibility).
+If you want the hardware cursor visible, set `CLANKER_HARDWARE_CURSOR=1` before running clanker (disabled by default for compatibility).
Consider using a dedicated terminal emulator for the best experience.
diff --git a/packages/coding-agent/companion-out/docs/termux.md b/packages/coding-agent/clanker-out/docs/termux.md
similarity index 89%
rename from packages/coding-agent/companion-out/docs/termux.md
rename to packages/coding-agent/clanker-out/docs/termux.md
index a9b2515..6e96425 100644
--- a/packages/coding-agent/companion-out/docs/termux.md
+++ b/packages/coding-agent/clanker-out/docs/termux.md
@@ -1,6 +1,6 @@
# Termux (Android) Setup
-Companion runs on Android via [Termux](https://termux.dev/), a terminal emulator and Linux environment for Android.
+Clanker runs on Android via [Termux](https://termux.dev/), a terminal emulator and Linux environment for Android.
## Prerequisites
@@ -16,14 +16,14 @@ pkg update && pkg upgrade
# Install dependencies
pkg install nodejs termux-api git
-# Install companion
-npm install -g @mariozechner/companion-coding-agent
+# Install clanker
+npm install -g @mariozechner/clanker-coding-agent
# Create config directory
-mkdir -p ~/.companion/agent
+mkdir -p ~/.clanker/agent
-# Run companion
-companion
+# Run clanker
+clanker
```
## Clipboard Support
@@ -34,7 +34,7 @@ Image clipboard is not supported on Termux (the `ctrl+v` image paste feature wil
## Example AGENTS.md for Termux
-Create `~/.companion/agent/AGENTS.md` to help the agent understand the Termux environment:
+Create `~/.clanker/agent/AGENTS.md` to help the agent understand the Termux environment:
````markdown
# Agent Environment: Termux on Android
diff --git a/packages/coding-agent/companion-out/docs/themes.md b/packages/coding-agent/clanker-out/docs/themes.md
similarity index 89%
rename from packages/coding-agent/companion-out/docs/themes.md
rename to packages/coding-agent/clanker-out/docs/themes.md
index 42c8c45..307fcbf 100644
--- a/packages/coding-agent/companion-out/docs/themes.md
+++ b/packages/coding-agent/clanker-out/docs/themes.md
@@ -1,4 +1,4 @@
-> companion can create themes. Ask it to build one for your setup.
+> clanker can create themes. Ask it to build one for your setup.
# Themes
@@ -16,12 +16,12 @@ Themes are JSON files that define colors for the TUI.
## Locations
-Companion loads themes from:
+Clanker loads themes from:
- Built-in: `dark`, `light`
-- Global: `~/.companion/agent/themes/*.json`
-- Project: `.companion/themes/*.json`
-- Packages: `themes/` directories or `companion.themes` entries in `package.json`
+- Global: `~/.clanker/agent/themes/*.json`
+- Project: `.clanker/themes/*.json`
+- Packages: `themes/` directories or `clanker.themes` entries in `package.json`
- Settings: `themes` array with files or directories
- CLI: `--theme ` (repeatable)
@@ -37,22 +37,22 @@ Select a theme via `/settings` or in `settings.json`:
}
```
-On first run, companion detects your terminal background and defaults to `dark` or `light`.
+On first run, clanker detects your terminal background and defaults to `dark` or `light`.
## Creating a Custom Theme
1. Create a theme file:
```bash
-mkdir -p ~/.companion/agent/themes
-vim ~/.companion/agent/themes/my-theme.json
+mkdir -p ~/.clanker/agent/themes
+vim ~/.clanker/agent/themes/my-theme.json
```
2. Define the theme with all required colors (see [Color Tokens](#color-tokens)):
```json
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/badlogic/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "my-theme",
"vars": {
"primary": "#00aaff",
@@ -116,13 +116,13 @@ vim ~/.companion/agent/themes/my-theme.json
3. Select the theme via `/settings`.
-**Hot reload:** When you edit the currently active custom theme file, companion reloads it automatically for immediate visual feedback.
+**Hot reload:** When you edit the currently active custom theme file, clanker reloads it automatically for immediate visual feedback.
## Theme Format
```json
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/badlogic/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "my-theme",
"vars": {
"blue": "#0066cc",
@@ -268,7 +268,7 @@ Four formats are supported:
### Terminal Compatibility
-Companion uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, companion falls back to the nearest approximation.
+Clanker uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, clanker falls back to the nearest approximation.
Check truecolor support:
diff --git a/packages/coding-agent/companion-out/docs/tree.md b/packages/coding-agent/clanker-out/docs/tree.md
similarity index 98%
rename from packages/coding-agent/companion-out/docs/tree.md
rename to packages/coding-agent/clanker-out/docs/tree.md
index 32d94a1..101490a 100644
--- a/packages/coding-agent/companion-out/docs/tree.md
+++ b/packages/coding-agent/clanker-out/docs/tree.md
@@ -209,8 +209,8 @@ interface SessionTreeEvent {
### Example: Custom Summarizer
```typescript
-export default function (companion: HookAPI) {
- companion.on("session_before_tree", async (event, ctx) => {
+export default function (clanker: HookAPI) {
+ clanker.on("session_before_tree", async (event, ctx) => {
if (!event.preparation.userWantsSummary) return;
if (event.preparation.entriesToSummarize.length === 0) return;
diff --git a/packages/coding-agent/companion-out/docs/tui.md b/packages/coding-agent/clanker-out/docs/tui.md
similarity index 93%
rename from packages/coding-agent/companion-out/docs/tui.md
rename to packages/coding-agent/clanker-out/docs/tui.md
index 3d0f09f..805ef33 100644
--- a/packages/coding-agent/companion-out/docs/tui.md
+++ b/packages/coding-agent/clanker-out/docs/tui.md
@@ -1,10 +1,10 @@
-> companion can create TUI components. Ask it to build one for your use case.
+> clanker can create TUI components. Ask it to build one for your use case.
# TUI Components
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
-**Source:** [`@mariozechner/companion-tui`](https://github.com/badlogic/companion-mono/tree/main/packages/tui)
+**Source:** [`@mariozechner/clanker-tui`](https://github.com/badlogic/clanker-agent/tree/main/packages/tui)
## Component Interface
@@ -37,7 +37,7 @@ import {
CURSOR_MARKER,
type Component,
type Focusable,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
class MyInput implements Component, Focusable {
focused: boolean = false; // Set by TUI when focus changes
@@ -66,7 +66,7 @@ This enables IME candidate windows to appear at the correct position for CJK inp
When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child. Otherwise, the hardware cursor won't be positioned correctly for IME input.
```typescript
-import { Container, type Focusable, Input } from "@mariozechner/companion-tui";
+import { Container, type Focusable, Input } from "@mariozechner/clanker-tui";
class SearchDialog extends Container implements Focusable {
private searchInput: Input;
@@ -96,18 +96,18 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
**In extensions** via `ctx.ui.custom()`:
```typescript
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
const handle = ctx.ui.custom(myComponent);
// handle.requestRender() - trigger re-render
// handle.close() - restore normal UI
});
```
-**In custom tools** via `companion.ui.custom()`:
+**In custom tools** via `clanker.ui.custom()`:
```typescript
async execute(toolCallId, params, onUpdate, ctx, signal) {
- const handle = companion.ui.custom(myComponent);
+ const handle = clanker.ui.custom(myComponent);
// ...
handle.close();
}
@@ -191,7 +191,7 @@ See [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for compre
## Built-in Components
-Import from `@mariozechner/companion-tui`:
+Import from `@mariozechner/clanker-tui`:
```typescript
import {
@@ -200,7 +200,7 @@ import {
Container,
Spacer,
Markdown,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
```
### Text
@@ -282,7 +282,7 @@ const image = new Image(
Use `matchesKey()` for key detection:
```typescript
-import { matchesKey, Key } from "@mariozechner/companion-tui";
+import { matchesKey, Key } from "@mariozechner/clanker-tui";
handleInput(data: string) {
if (matchesKey(data, Key.up)) {
@@ -309,7 +309,7 @@ handleInput(data: string) {
**Critical:** Each line from `render()` must not exceed the `width` parameter.
```typescript
-import { visibleWidth, truncateToWidth } from "@mariozechner/companion-tui";
+import { visibleWidth, truncateToWidth } from "@mariozechner/clanker-tui";
render(width: number): string[] {
// Truncate long lines
@@ -333,7 +333,7 @@ import {
Key,
truncateToWidth,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
class MySelector {
private items: string[];
@@ -388,7 +388,7 @@ class MySelector {
Usage in an extension:
```typescript
-companion.registerCommand("pick", {
+clanker.registerCommand("pick", {
description: "Pick an item",
handler: async (args, ctx) => {
const items = ["Option A", "Option B", "Option C"];
@@ -450,8 +450,8 @@ renderResult(result, options, theme) {
**For Markdown**, use `getMarkdownTheme()`:
```typescript
-import { getMarkdownTheme } from "@mariozechner/companion-coding-agent";
-import { Markdown } from "@mariozechner/companion-tui";
+import { getMarkdownTheme } from "@mariozechner/clanker-coding-agent";
+import { Markdown } from "@mariozechner/clanker-tui";
renderResult(result, options, theme) {
const mdTheme = getMarkdownTheme();
@@ -470,10 +470,10 @@ interface MyTheme {
## Debug logging
-Set `COMPANION_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
+Set `CLANKER_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
```bash
-COMPANION_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
+CLANKER_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
```
## Performance
@@ -612,19 +612,19 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
### Pattern 1: Selection Dialog (SelectList)
-For letting users pick from a list of options. Use `SelectList` from `@mariozechner/companion-tui` with `DynamicBorder` for framing.
+For letting users pick from a list of options. Use `SelectList` from `@mariozechner/clanker-tui` with `DynamicBorder` for framing.
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
-import { DynamicBorder } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
+import { DynamicBorder } from "@mariozechner/clanker-coding-agent";
import {
Container,
type SelectItem,
SelectList,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
-companion.registerCommand("pick", {
+clanker.registerCommand("pick", {
handler: async (_args, ctx) => {
const items: SelectItem[] = [
{ value: "opt1", label: "Option 1", description: "First option" },
@@ -697,9 +697,9 @@ companion.registerCommand("pick", {
For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
```typescript
-import { BorderedLoader } from "@mariozechner/companion-coding-agent";
+import { BorderedLoader } from "@mariozechner/clanker-coding-agent";
-companion.registerCommand("fetch", {
+clanker.registerCommand("fetch", {
handler: async (_args, ctx) => {
const result = await ctx.ui.custom(
(tui, theme, _kb, done) => {
@@ -728,18 +728,18 @@ companion.registerCommand("fetch", {
### Pattern 3: Settings/Toggles (SettingsList)
-For toggling multiple settings. Use `SettingsList` from `@mariozechner/companion-tui` with `getSettingsListTheme()`.
+For toggling multiple settings. Use `SettingsList` from `@mariozechner/clanker-tui` with `getSettingsListTheme()`.
```typescript
-import { getSettingsListTheme } from "@mariozechner/companion-coding-agent";
+import { getSettingsListTheme } from "@mariozechner/clanker-coding-agent";
import {
Container,
type SettingItem,
SettingsList,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
-companion.registerCommand("settings", {
+clanker.registerCommand("settings", {
handler: async (_args, ctx) => {
const items: SettingItem[] = [
{
@@ -863,8 +863,8 @@ Replace the main input editor with a custom implementation. Useful for modal edi
import {
CustomEditor,
type ExtensionAPI,
-} from "@mariozechner/companion-coding-agent";
-import { matchesKey, truncateToWidth } from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-coding-agent";
+import { matchesKey, truncateToWidth } from "@mariozechner/clanker-tui";
type Mode = "normal" | "insert";
@@ -926,8 +926,8 @@ class VimEditor extends CustomEditor {
}
}
-export default function (companion: ExtensionAPI) {
- companion.on("session_start", (_event, ctx) => {
+export default function (clanker: ExtensionAPI) {
+ clanker.on("session_start", (_event, ctx) => {
// Factory receives theme and keybindings from the app
ctx.ui.setEditorComponent(
(tui, theme, keybindings) => new VimEditor(theme, keybindings),
diff --git a/packages/coding-agent/companion-out/docs/windows.md b/packages/coding-agent/clanker-out/docs/windows.md
similarity index 68%
rename from packages/coding-agent/companion-out/docs/windows.md
rename to packages/coding-agent/clanker-out/docs/windows.md
index c205686..e89eb99 100644
--- a/packages/coding-agent/companion-out/docs/windows.md
+++ b/packages/coding-agent/clanker-out/docs/windows.md
@@ -1,8 +1,8 @@
# Windows Setup
-Companion requires a bash shell on Windows. Checked locations (in order):
+Clanker requires a bash shell on Windows. Checked locations (in order):
-1. Custom path from `~/.companion/agent/settings.json`
+1. Custom path from `~/.clanker/agent/settings.json`
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
diff --git a/packages/coding-agent/companion-out/export-html/ansi-to-html.d.ts b/packages/coding-agent/clanker-out/export-html/ansi-to-html.d.ts
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/ansi-to-html.d.ts
rename to packages/coding-agent/clanker-out/export-html/ansi-to-html.d.ts
diff --git a/packages/coding-agent/companion-out/export-html/ansi-to-html.d.ts.map b/packages/coding-agent/clanker-out/export-html/ansi-to-html.d.ts.map
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/ansi-to-html.d.ts.map
rename to packages/coding-agent/clanker-out/export-html/ansi-to-html.d.ts.map
diff --git a/packages/coding-agent/companion-out/export-html/ansi-to-html.js b/packages/coding-agent/clanker-out/export-html/ansi-to-html.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/ansi-to-html.js
rename to packages/coding-agent/clanker-out/export-html/ansi-to-html.js
diff --git a/packages/coding-agent/companion-out/export-html/ansi-to-html.js.map b/packages/coding-agent/clanker-out/export-html/ansi-to-html.js.map
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/ansi-to-html.js.map
rename to packages/coding-agent/clanker-out/export-html/ansi-to-html.js.map
diff --git a/packages/coding-agent/companion-out/export-html/index.d.ts b/packages/coding-agent/clanker-out/export-html/index.d.ts
similarity index 95%
rename from packages/coding-agent/companion-out/export-html/index.d.ts
rename to packages/coding-agent/clanker-out/export-html/index.d.ts
index a211b56..c1c1ad8 100644
--- a/packages/coding-agent/companion-out/export-html/index.d.ts
+++ b/packages/coding-agent/clanker-out/export-html/index.d.ts
@@ -1,4 +1,4 @@
-import type { AgentState } from "@mariozechner/companion-agent-core";
+import type { AgentState } from "@harivansh-afk/clanker-agent-core";
import { SessionManager } from "../session-manager.js";
/**
* Interface for rendering custom tools to HTML.
diff --git a/packages/coding-agent/clanker-out/export-html/index.d.ts.map b/packages/coding-agent/clanker-out/export-html/index.d.ts.map
new file mode 100644
index 0000000..a977b74
--- /dev/null
+++ b/packages/coding-agent/clanker-out/export-html/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/export-html/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAUrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAChE,sFAAsF;IACtF,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,EACF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAAC;CACvB;AAQD,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAwND;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,cAAc,EAClB,KAAK,CAAC,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,GAC/B,OAAO,CAAC,MAAM,CAAC,CA+CjB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,GAC/B,OAAO,CAAC,MAAM,CAAC,CA4BjB","sourcesContent":["import type { AgentState } from \"@harivansh-afk/clanker-agent-core\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, join } from \"path\";\nimport { APP_NAME, getExportTemplateDir } from \"../../config.js\";\nimport {\n getResolvedThemeColors,\n getThemeExportColors,\n} from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolInfo } from \"../extensions/types.js\";\nimport type { SessionEntry } from \"../session-manager.js\";\nimport { SessionManager } from \"../session-manager.js\";\n\n/**\n * Interface for rendering custom tools to HTML.\n * Used by agent-session to pre-render extension tool output.\n */\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/** Pre-rendered HTML for a custom tool call and result */\ninterface RenderedToolHtml {\n callHtml?: string;\n resultHtml?: string;\n}\n\nexport interface ExportOptions {\n outputPath?: string;\n themeName?: string;\n /** Optional tool renderer for custom tools */\n toolRenderer?: ToolHtmlRenderer;\n}\n\n/** Parse a color string to RGB values. Supports hex (#RRGGBB) and rgb(r,g,b) formats. */\nfunction parseColor(\n color: string,\n): { r: number; g: number; b: number } | undefined {\n const hexMatch = color.match(\n /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n );\n if (hexMatch) {\n return {\n r: Number.parseInt(hexMatch[1], 16),\n g: Number.parseInt(hexMatch[2], 16),\n b: Number.parseInt(hexMatch[3], 16),\n };\n }\n const rgbMatch = color.match(\n /^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/,\n );\n if (rgbMatch) {\n return {\n r: Number.parseInt(rgbMatch[1], 10),\n g: Number.parseInt(rgbMatch[2], 10),\n b: Number.parseInt(rgbMatch[3], 10),\n };\n }\n return undefined;\n}\n\n/** Calculate relative luminance of a color (0-1, higher = lighter). */\nfunction getLuminance(r: number, g: number, b: number): number {\n const toLinear = (c: number) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n };\n return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n}\n\n/** Adjust color brightness. Factor > 1 lightens, < 1 darkens. */\nfunction adjustBrightness(color: string, factor: number): string {\n const parsed = parseColor(color);\n if (!parsed) return color;\n const adjust = (c: number) =>\n Math.min(255, Math.max(0, Math.round(c * factor)));\n return `rgb(${adjust(parsed.r)}, ${adjust(parsed.g)}, ${adjust(parsed.b)})`;\n}\n\n/** Derive export background colors from a base color (e.g., userMessageBg). */\nfunction deriveExportColors(baseColor: string): {\n pageBg: string;\n cardBg: string;\n infoBg: string;\n} {\n const parsed = parseColor(baseColor);\n if (!parsed) {\n return {\n pageBg: \"rgb(24, 24, 30)\",\n cardBg: \"rgb(30, 30, 36)\",\n infoBg: \"rgb(60, 55, 40)\",\n };\n }\n\n const luminance = getLuminance(parsed.r, parsed.g, parsed.b);\n const isLight = luminance > 0.5;\n\n if (isLight) {\n return {\n pageBg: adjustBrightness(baseColor, 0.96),\n cardBg: baseColor,\n infoBg: `rgb(${Math.min(255, parsed.r + 10)}, ${Math.min(255, parsed.g + 5)}, ${Math.max(0, parsed.b - 20)})`,\n };\n }\n return {\n pageBg: adjustBrightness(baseColor, 0.7),\n cardBg: adjustBrightness(baseColor, 0.85),\n infoBg: `rgb(${Math.min(255, parsed.r + 20)}, ${Math.min(255, parsed.g + 15)}, ${parsed.b})`,\n };\n}\n\n/**\n * Generate CSS custom property declarations from theme colors.\n */\nfunction generateThemeVars(themeName?: string): string {\n const colors = getResolvedThemeColors(themeName);\n const lines: string[] = [];\n for (const [key, value] of Object.entries(colors)) {\n lines.push(`--${key}: ${value};`);\n }\n\n // Use explicit theme export colors if available, otherwise derive from userMessageBg\n const themeExport = getThemeExportColors(themeName);\n const userMessageBg = colors.userMessageBg || \"#343541\";\n const derivedColors = deriveExportColors(userMessageBg);\n\n lines.push(`--exportPageBg: ${themeExport.pageBg ?? derivedColors.pageBg};`);\n lines.push(`--exportCardBg: ${themeExport.cardBg ?? derivedColors.cardBg};`);\n lines.push(`--exportInfoBg: ${themeExport.infoBg ?? derivedColors.infoBg};`);\n\n return lines.join(\"\\n \");\n}\n\ninterface SessionData {\n header: ReturnType;\n entries: ReturnType;\n leafId: string | null;\n systemPrompt?: string;\n tools?: ToolInfo[];\n /** Pre-rendered HTML for custom tool calls/results, keyed by tool call ID */\n renderedTools?: Record;\n}\n\n/**\n * Core HTML generation logic shared by both export functions.\n */\nfunction generateHtml(sessionData: SessionData, themeName?: string): string {\n const templateDir = getExportTemplateDir();\n const template = readFileSync(join(templateDir, \"template.html\"), \"utf-8\");\n const templateCss = readFileSync(join(templateDir, \"template.css\"), \"utf-8\");\n const templateJs = readFileSync(join(templateDir, \"template.js\"), \"utf-8\");\n const markedJs = readFileSync(\n join(templateDir, \"vendor\", \"marked.min.js\"),\n \"utf-8\",\n );\n const hljsJs = readFileSync(\n join(templateDir, \"vendor\", \"highlight.min.js\"),\n \"utf-8\",\n );\n\n const themeVars = generateThemeVars(themeName);\n const colors = getResolvedThemeColors(themeName);\n const exportColors = deriveExportColors(colors.userMessageBg || \"#343541\");\n const bodyBg = exportColors.pageBg;\n const containerBg = exportColors.cardBg;\n const infoBg = exportColors.infoBg;\n\n // Base64 encode session data to avoid escaping issues\n const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString(\n \"base64\",\n );\n\n // Build the CSS with theme variables injected\n const css = templateCss\n .replace(\"{{THEME_VARS}}\", themeVars)\n .replace(\"{{BODY_BG}}\", bodyBg)\n .replace(\"{{CONTAINER_BG}}\", containerBg)\n .replace(\"{{INFO_BG}}\", infoBg);\n\n return template\n .replace(\"{{CSS}}\", css)\n .replace(\"{{JS}}\", templateJs)\n .replace(\"{{SESSION_DATA}}\", sessionDataBase64)\n .replace(\"{{MARKED_JS}}\", markedJs)\n .replace(\"{{HIGHLIGHT_JS}}\", hljsJs);\n}\n\n/** Built-in tool names that have custom rendering in template.js */\nconst BUILTIN_TOOLS = new Set([\n \"bash\",\n \"read\",\n \"write\",\n \"edit\",\n \"ls\",\n \"find\",\n \"grep\",\n]);\n\n/**\n * Pre-render custom tools to HTML using their TUI renderers.\n */\nfunction preRenderCustomTools(\n entries: SessionEntry[],\n toolRenderer: ToolHtmlRenderer,\n): Record {\n const renderedTools: Record = {};\n\n for (const entry of entries) {\n if (entry.type !== \"message\") continue;\n const msg = entry.message;\n\n // Find tool calls in assistant messages\n if (msg.role === \"assistant\" && Array.isArray(msg.content)) {\n for (const block of msg.content) {\n if (block.type === \"toolCall\" && !BUILTIN_TOOLS.has(block.name)) {\n const callHtml = toolRenderer.renderCall(block.name, block.arguments);\n if (callHtml) {\n renderedTools[block.id] = { callHtml };\n }\n }\n }\n }\n\n // Find tool results\n if (msg.role === \"toolResult\" && msg.toolCallId) {\n const toolName = msg.toolName || \"\";\n // Only render if we have a pre-rendered call OR it's not a built-in tool\n const existing = renderedTools[msg.toolCallId];\n if (existing || !BUILTIN_TOOLS.has(toolName)) {\n const resultHtml = toolRenderer.renderResult(\n toolName,\n msg.content,\n msg.details,\n msg.isError || false,\n );\n if (resultHtml) {\n renderedTools[msg.toolCallId] = {\n ...existing,\n resultHtml,\n };\n }\n }\n }\n }\n\n return renderedTools;\n}\n\n/**\n * Export session to HTML using SessionManager and AgentState.\n * Used by TUI's /export command.\n */\nexport async function exportSessionToHtml(\n sm: SessionManager,\n state?: AgentState,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n const sessionFile = sm.getSessionFile();\n if (!sessionFile) {\n throw new Error(\"Cannot export in-memory session to HTML\");\n }\n if (!existsSync(sessionFile)) {\n throw new Error(\"Nothing to export yet - start a conversation first\");\n }\n\n const entries = sm.getEntries();\n\n // Pre-render custom tools if a tool renderer is provided\n let renderedTools: Record | undefined;\n if (opts.toolRenderer) {\n renderedTools = preRenderCustomTools(entries, opts.toolRenderer);\n // Only include if we actually rendered something\n if (Object.keys(renderedTools).length === 0) {\n renderedTools = undefined;\n }\n }\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries,\n leafId: sm.getLeafId(),\n systemPrompt: state?.systemPrompt,\n tools: state?.tools?.map((t) => ({\n name: t.name,\n description: t.description,\n parameters: t.parameters,\n })),\n renderedTools,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const sessionBasename = basename(sessionFile, \".jsonl\");\n outputPath = `${APP_NAME}-session-${sessionBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n\n/**\n * Export session file to HTML (standalone, without AgentState).\n * Used by CLI for exporting arbitrary session files.\n */\nexport async function exportFromFile(\n inputPath: string,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n if (!existsSync(inputPath)) {\n throw new Error(`File not found: ${inputPath}`);\n }\n\n const sm = SessionManager.open(inputPath);\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries: sm.getEntries(),\n leafId: sm.getLeafId(),\n systemPrompt: undefined,\n tools: undefined,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const inputBasename = basename(inputPath, \".jsonl\");\n outputPath = `${APP_NAME}-session-${inputBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/index.js b/packages/coding-agent/clanker-out/export-html/index.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/index.js
rename to packages/coding-agent/clanker-out/export-html/index.js
diff --git a/packages/coding-agent/clanker-out/export-html/index.js.map b/packages/coding-agent/clanker-out/export-html/index.js.map
new file mode 100644
index 0000000..f2e94de
--- /dev/null
+++ b/packages/coding-agent/clanker-out/export-html/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/export-html/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoCvD,yFAAyF;AACzF,SAAS,UAAU,CACjB,KAAa,EACoC;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAC1B,qDAAqD,CACtD,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAC1B,iDAAiD,CAClD,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AAAA,CAClB;AAED,uEAAuE;AACvE,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU;IAC7D,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAClB,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;IAAA,CAChE,CAAC;IACF,OAAO,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAA,CAC3E;AAED,iEAAiE;AACjE,SAAS,gBAAgB,CAAC,KAAa,EAAE,MAAc,EAAU;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AAAA,CAC7E;AAED,+EAA+E;AAC/E,SAAS,kBAAkB,CAAC,SAAiB,EAI3C;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,MAAM,EAAE,iBAAiB;YACzB,MAAM,EAAE,iBAAiB;YACzB,MAAM,EAAE,iBAAiB;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC;IAEhC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;YACL,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC;YACzC,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG;SAC9G,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC;QACxC,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC;QACzC,MAAM,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,GAAG;KAC7F,CAAC;AAAA,CACH;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,SAAkB,EAAU;IACrD,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,qFAAqF;IACrF,MAAM,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,IAAI,SAAS,CAAC;IACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAExD,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAE7E,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAAA,CAC/B;AAYD;;GAEG;AACH,SAAS,YAAY,CAAC,WAAwB,EAAE,SAAkB,EAAU;IAC1E,MAAM,WAAW,GAAG,oBAAoB,EAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,QAAQ,GAAG,YAAY,CAC3B,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,EAC5C,OAAO,CACR,CAAC;IACF,MAAM,MAAM,GAAG,YAAY,CACzB,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EAC/C,OAAO,CACR,CAAC;IAEF,MAAM,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,CAAC,aAAa,IAAI,SAAS,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IACnC,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC;IACxC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAEnC,sDAAsD;IACtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CACzE,QAAQ,CACT,CAAC;IAEF,8CAA8C;IAC9C,MAAM,GAAG,GAAG,WAAW;SACpB,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACpC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC;SAC9B,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC;SACxC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAElC,OAAO,QAAQ;SACZ,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC7B,OAAO,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;SAC9C,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;SAClC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAAA,CACxC;AAED,oEAAoE;AACpE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH;;GAEG;AACH,SAAS,oBAAoB,CAC3B,OAAuB,EACvB,YAA8B,EACI;IAClC,MAAM,aAAa,GAAqC,EAAE,CAAC;IAE3D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,SAAS;QACvC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC;QAE1B,wCAAwC;QACxC,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBAChC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBAChE,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBACtE,IAAI,QAAQ,EAAE,CAAC;wBACb,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,oBAAoB;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;YAChD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;YACpC,yEAAyE;YACzE,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC/C,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7C,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAC1C,QAAQ,EACR,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,OAAO,IAAI,KAAK,CACrB,CAAC;gBACF,IAAI,UAAU,EAAE,CAAC;oBACf,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG;wBAC9B,GAAG,QAAQ;wBACX,UAAU;qBACX,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AAAA,CACtB;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAAkB,EAClB,KAAkB,EAClB,OAAgC,EACf;IACjB,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;IAExE,MAAM,WAAW,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;IAEhC,yDAAyD;IACzD,IAAI,aAA2D,CAAC;IAChE,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,aAAa,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACjE,iDAAiD;QACjD,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5C,aAAa,GAAG,SAAS,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GAAgB;QAC/B,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,OAAO;QACP,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,YAAY,EAAE,KAAK,EAAE,YAAY;QACjC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAC;QACH,aAAa;KACd,CAAC;IAEF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAEvD,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,eAAe,GAAG,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACxD,UAAU,GAAG,GAAG,QAAQ,YAAY,eAAe,OAAO,CAAC;IAC7D,CAAC;IAED,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC;AAAA,CACnB;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,SAAiB,EACjB,OAAgC,EACf;IACjB,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;IAExE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,WAAW,GAAgB;QAC/B,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,OAAO,EAAE,EAAE,CAAC,UAAU,EAAE;QACxB,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,YAAY,EAAE,SAAS;QACvB,KAAK,EAAE,SAAS;KACjB,CAAC;IAEF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAEvD,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpD,UAAU,GAAG,GAAG,QAAQ,YAAY,aAAa,OAAO,CAAC;IAC3D,CAAC;IAED,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC;AAAA,CACnB","sourcesContent":["import type { AgentState } from \"@harivansh-afk/clanker-agent-core\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, join } from \"path\";\nimport { APP_NAME, getExportTemplateDir } from \"../../config.js\";\nimport {\n getResolvedThemeColors,\n getThemeExportColors,\n} from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolInfo } from \"../extensions/types.js\";\nimport type { SessionEntry } from \"../session-manager.js\";\nimport { SessionManager } from \"../session-manager.js\";\n\n/**\n * Interface for rendering custom tools to HTML.\n * Used by agent-session to pre-render extension tool output.\n */\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/** Pre-rendered HTML for a custom tool call and result */\ninterface RenderedToolHtml {\n callHtml?: string;\n resultHtml?: string;\n}\n\nexport interface ExportOptions {\n outputPath?: string;\n themeName?: string;\n /** Optional tool renderer for custom tools */\n toolRenderer?: ToolHtmlRenderer;\n}\n\n/** Parse a color string to RGB values. Supports hex (#RRGGBB) and rgb(r,g,b) formats. */\nfunction parseColor(\n color: string,\n): { r: number; g: number; b: number } | undefined {\n const hexMatch = color.match(\n /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n );\n if (hexMatch) {\n return {\n r: Number.parseInt(hexMatch[1], 16),\n g: Number.parseInt(hexMatch[2], 16),\n b: Number.parseInt(hexMatch[3], 16),\n };\n }\n const rgbMatch = color.match(\n /^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/,\n );\n if (rgbMatch) {\n return {\n r: Number.parseInt(rgbMatch[1], 10),\n g: Number.parseInt(rgbMatch[2], 10),\n b: Number.parseInt(rgbMatch[3], 10),\n };\n }\n return undefined;\n}\n\n/** Calculate relative luminance of a color (0-1, higher = lighter). */\nfunction getLuminance(r: number, g: number, b: number): number {\n const toLinear = (c: number) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n };\n return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n}\n\n/** Adjust color brightness. Factor > 1 lightens, < 1 darkens. */\nfunction adjustBrightness(color: string, factor: number): string {\n const parsed = parseColor(color);\n if (!parsed) return color;\n const adjust = (c: number) =>\n Math.min(255, Math.max(0, Math.round(c * factor)));\n return `rgb(${adjust(parsed.r)}, ${adjust(parsed.g)}, ${adjust(parsed.b)})`;\n}\n\n/** Derive export background colors from a base color (e.g., userMessageBg). */\nfunction deriveExportColors(baseColor: string): {\n pageBg: string;\n cardBg: string;\n infoBg: string;\n} {\n const parsed = parseColor(baseColor);\n if (!parsed) {\n return {\n pageBg: \"rgb(24, 24, 30)\",\n cardBg: \"rgb(30, 30, 36)\",\n infoBg: \"rgb(60, 55, 40)\",\n };\n }\n\n const luminance = getLuminance(parsed.r, parsed.g, parsed.b);\n const isLight = luminance > 0.5;\n\n if (isLight) {\n return {\n pageBg: adjustBrightness(baseColor, 0.96),\n cardBg: baseColor,\n infoBg: `rgb(${Math.min(255, parsed.r + 10)}, ${Math.min(255, parsed.g + 5)}, ${Math.max(0, parsed.b - 20)})`,\n };\n }\n return {\n pageBg: adjustBrightness(baseColor, 0.7),\n cardBg: adjustBrightness(baseColor, 0.85),\n infoBg: `rgb(${Math.min(255, parsed.r + 20)}, ${Math.min(255, parsed.g + 15)}, ${parsed.b})`,\n };\n}\n\n/**\n * Generate CSS custom property declarations from theme colors.\n */\nfunction generateThemeVars(themeName?: string): string {\n const colors = getResolvedThemeColors(themeName);\n const lines: string[] = [];\n for (const [key, value] of Object.entries(colors)) {\n lines.push(`--${key}: ${value};`);\n }\n\n // Use explicit theme export colors if available, otherwise derive from userMessageBg\n const themeExport = getThemeExportColors(themeName);\n const userMessageBg = colors.userMessageBg || \"#343541\";\n const derivedColors = deriveExportColors(userMessageBg);\n\n lines.push(`--exportPageBg: ${themeExport.pageBg ?? derivedColors.pageBg};`);\n lines.push(`--exportCardBg: ${themeExport.cardBg ?? derivedColors.cardBg};`);\n lines.push(`--exportInfoBg: ${themeExport.infoBg ?? derivedColors.infoBg};`);\n\n return lines.join(\"\\n \");\n}\n\ninterface SessionData {\n header: ReturnType;\n entries: ReturnType;\n leafId: string | null;\n systemPrompt?: string;\n tools?: ToolInfo[];\n /** Pre-rendered HTML for custom tool calls/results, keyed by tool call ID */\n renderedTools?: Record;\n}\n\n/**\n * Core HTML generation logic shared by both export functions.\n */\nfunction generateHtml(sessionData: SessionData, themeName?: string): string {\n const templateDir = getExportTemplateDir();\n const template = readFileSync(join(templateDir, \"template.html\"), \"utf-8\");\n const templateCss = readFileSync(join(templateDir, \"template.css\"), \"utf-8\");\n const templateJs = readFileSync(join(templateDir, \"template.js\"), \"utf-8\");\n const markedJs = readFileSync(\n join(templateDir, \"vendor\", \"marked.min.js\"),\n \"utf-8\",\n );\n const hljsJs = readFileSync(\n join(templateDir, \"vendor\", \"highlight.min.js\"),\n \"utf-8\",\n );\n\n const themeVars = generateThemeVars(themeName);\n const colors = getResolvedThemeColors(themeName);\n const exportColors = deriveExportColors(colors.userMessageBg || \"#343541\");\n const bodyBg = exportColors.pageBg;\n const containerBg = exportColors.cardBg;\n const infoBg = exportColors.infoBg;\n\n // Base64 encode session data to avoid escaping issues\n const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString(\n \"base64\",\n );\n\n // Build the CSS with theme variables injected\n const css = templateCss\n .replace(\"{{THEME_VARS}}\", themeVars)\n .replace(\"{{BODY_BG}}\", bodyBg)\n .replace(\"{{CONTAINER_BG}}\", containerBg)\n .replace(\"{{INFO_BG}}\", infoBg);\n\n return template\n .replace(\"{{CSS}}\", css)\n .replace(\"{{JS}}\", templateJs)\n .replace(\"{{SESSION_DATA}}\", sessionDataBase64)\n .replace(\"{{MARKED_JS}}\", markedJs)\n .replace(\"{{HIGHLIGHT_JS}}\", hljsJs);\n}\n\n/** Built-in tool names that have custom rendering in template.js */\nconst BUILTIN_TOOLS = new Set([\n \"bash\",\n \"read\",\n \"write\",\n \"edit\",\n \"ls\",\n \"find\",\n \"grep\",\n]);\n\n/**\n * Pre-render custom tools to HTML using their TUI renderers.\n */\nfunction preRenderCustomTools(\n entries: SessionEntry[],\n toolRenderer: ToolHtmlRenderer,\n): Record {\n const renderedTools: Record = {};\n\n for (const entry of entries) {\n if (entry.type !== \"message\") continue;\n const msg = entry.message;\n\n // Find tool calls in assistant messages\n if (msg.role === \"assistant\" && Array.isArray(msg.content)) {\n for (const block of msg.content) {\n if (block.type === \"toolCall\" && !BUILTIN_TOOLS.has(block.name)) {\n const callHtml = toolRenderer.renderCall(block.name, block.arguments);\n if (callHtml) {\n renderedTools[block.id] = { callHtml };\n }\n }\n }\n }\n\n // Find tool results\n if (msg.role === \"toolResult\" && msg.toolCallId) {\n const toolName = msg.toolName || \"\";\n // Only render if we have a pre-rendered call OR it's not a built-in tool\n const existing = renderedTools[msg.toolCallId];\n if (existing || !BUILTIN_TOOLS.has(toolName)) {\n const resultHtml = toolRenderer.renderResult(\n toolName,\n msg.content,\n msg.details,\n msg.isError || false,\n );\n if (resultHtml) {\n renderedTools[msg.toolCallId] = {\n ...existing,\n resultHtml,\n };\n }\n }\n }\n }\n\n return renderedTools;\n}\n\n/**\n * Export session to HTML using SessionManager and AgentState.\n * Used by TUI's /export command.\n */\nexport async function exportSessionToHtml(\n sm: SessionManager,\n state?: AgentState,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n const sessionFile = sm.getSessionFile();\n if (!sessionFile) {\n throw new Error(\"Cannot export in-memory session to HTML\");\n }\n if (!existsSync(sessionFile)) {\n throw new Error(\"Nothing to export yet - start a conversation first\");\n }\n\n const entries = sm.getEntries();\n\n // Pre-render custom tools if a tool renderer is provided\n let renderedTools: Record | undefined;\n if (opts.toolRenderer) {\n renderedTools = preRenderCustomTools(entries, opts.toolRenderer);\n // Only include if we actually rendered something\n if (Object.keys(renderedTools).length === 0) {\n renderedTools = undefined;\n }\n }\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries,\n leafId: sm.getLeafId(),\n systemPrompt: state?.systemPrompt,\n tools: state?.tools?.map((t) => ({\n name: t.name,\n description: t.description,\n parameters: t.parameters,\n })),\n renderedTools,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const sessionBasename = basename(sessionFile, \".jsonl\");\n outputPath = `${APP_NAME}-session-${sessionBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n\n/**\n * Export session file to HTML (standalone, without AgentState).\n * Used by CLI for exporting arbitrary session files.\n */\nexport async function exportFromFile(\n inputPath: string,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n if (!existsSync(inputPath)) {\n throw new Error(`File not found: ${inputPath}`);\n }\n\n const sm = SessionManager.open(inputPath);\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries: sm.getEntries(),\n leafId: sm.getLeafId(),\n systemPrompt: undefined,\n tools: undefined,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const inputBasename = basename(inputPath, \".jsonl\");\n outputPath = `${APP_NAME}-session-${inputBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/template.css b/packages/coding-agent/clanker-out/export-html/template.css
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/template.css
rename to packages/coding-agent/clanker-out/export-html/template.css
diff --git a/packages/coding-agent/companion-out/export-html/template.html b/packages/coding-agent/clanker-out/export-html/template.html
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/template.html
rename to packages/coding-agent/clanker-out/export-html/template.html
diff --git a/packages/coding-agent/companion-out/export-html/template.js b/packages/coding-agent/clanker-out/export-html/template.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/template.js
rename to packages/coding-agent/clanker-out/export-html/template.js
diff --git a/packages/coding-agent/companion-out/export-html/tool-renderer.d.ts b/packages/coding-agent/clanker-out/export-html/tool-renderer.d.ts
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/tool-renderer.d.ts
rename to packages/coding-agent/clanker-out/export-html/tool-renderer.d.ts
diff --git a/packages/coding-agent/clanker-out/export-html/tool-renderer.d.ts.map b/packages/coding-agent/clanker-out/export-html/tool-renderer.d.ts.map
new file mode 100644
index 0000000..5f0f8ee
--- /dev/null
+++ b/packages/coding-agent/clanker-out/export-html/tool-renderer.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"tool-renderer.d.ts","sourceRoot":"","sources":["../../../src/core/export-html/tool-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IAChE,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAChE,sFAAsF;IACtF,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,EACF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,GACzB,gBAAgB,CAiElB","sourcesContent":["/**\n * Tool HTML renderer for custom tools in HTML export.\n *\n * Renders custom tool calls and results to HTML by invoking their TUI renderers\n * and converting the ANSI output to HTML.\n */\n\nimport type { ImageContent, TextContent } from \"@mariozechner/clanker-ai\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition } from \"../extensions/types.js\";\nimport { ansiLinesToHtml } from \"./ansi-to-html.js\";\n\nexport interface ToolHtmlRendererDeps {\n /** Function to look up tool definition by name */\n getToolDefinition: (name: string) => ToolDefinition | undefined;\n /** Theme for styling */\n theme: Theme;\n /** Terminal width for rendering (default: 100) */\n width?: number;\n}\n\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/**\n * Create a tool HTML renderer.\n *\n * The renderer looks up tool definitions and invokes their renderCall/renderResult\n * methods, converting the resulting TUI Component output (ANSI) to HTML.\n */\nexport function createToolHtmlRenderer(\n deps: ToolHtmlRendererDeps,\n): ToolHtmlRenderer {\n const { getToolDefinition, theme, width = 100 } = deps;\n\n return {\n renderCall(toolName: string, args: unknown): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderCall) {\n return undefined;\n }\n\n const component = toolDef.renderCall(args, theme);\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderResult) {\n return undefined;\n }\n\n // Build AgentToolResult from content array\n // Cast content since session storage uses generic object types\n const agentToolResult = {\n content: result as (TextContent | ImageContent)[],\n details,\n isError,\n };\n\n // Always render expanded, client-side will apply truncation\n const component = toolDef.renderResult(\n agentToolResult,\n { expanded: true, isPartial: false },\n theme,\n );\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n };\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/tool-renderer.js b/packages/coding-agent/clanker-out/export-html/tool-renderer.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/tool-renderer.js
rename to packages/coding-agent/clanker-out/export-html/tool-renderer.js
diff --git a/packages/coding-agent/clanker-out/export-html/tool-renderer.js.map b/packages/coding-agent/clanker-out/export-html/tool-renderer.js.map
new file mode 100644
index 0000000..346b348
--- /dev/null
+++ b/packages/coding-agent/clanker-out/export-html/tool-renderer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"tool-renderer.js","sourceRoot":"","sources":["../../../src/core/export-html/tool-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA4BpD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAA0B,EACR;IAClB,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;IAEvD,OAAO;QACL,UAAU,CAAC,QAAgB,EAAE,IAAa,EAAsB;YAC9D,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAC5C,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;oBACzB,OAAO,SAAS,CAAC;gBACnB,CAAC;gBAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAClD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,SAAS,CAAC;gBACnB,CAAC;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;gBACtD,OAAO,SAAS,CAAC;YACnB,CAAC;QAAA,CACF;QAED,YAAY,CACV,QAAgB,EAChB,MAKE,EACF,OAAgB,EAChB,OAAgB,EACI;YACpB,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAC5C,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;oBAC3B,OAAO,SAAS,CAAC;gBACnB,CAAC;gBAED,2CAA2C;gBAC3C,+DAA+D;gBAC/D,MAAM,eAAe,GAAG;oBACtB,OAAO,EAAE,MAAwC;oBACjD,OAAO;oBACP,OAAO;iBACR,CAAC;gBAEF,4DAA4D;gBAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CACpC,eAAe,EACf,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EACpC,KAAK,CACN,CAAC;gBACF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,SAAS,CAAC;gBACnB,CAAC;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;gBACtD,OAAO,SAAS,CAAC;YACnB,CAAC;QAAA,CACF;KACF,CAAC;AAAA,CACH","sourcesContent":["/**\n * Tool HTML renderer for custom tools in HTML export.\n *\n * Renders custom tool calls and results to HTML by invoking their TUI renderers\n * and converting the ANSI output to HTML.\n */\n\nimport type { ImageContent, TextContent } from \"@mariozechner/clanker-ai\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition } from \"../extensions/types.js\";\nimport { ansiLinesToHtml } from \"./ansi-to-html.js\";\n\nexport interface ToolHtmlRendererDeps {\n /** Function to look up tool definition by name */\n getToolDefinition: (name: string) => ToolDefinition | undefined;\n /** Theme for styling */\n theme: Theme;\n /** Terminal width for rendering (default: 100) */\n width?: number;\n}\n\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/**\n * Create a tool HTML renderer.\n *\n * The renderer looks up tool definitions and invokes their renderCall/renderResult\n * methods, converting the resulting TUI Component output (ANSI) to HTML.\n */\nexport function createToolHtmlRenderer(\n deps: ToolHtmlRendererDeps,\n): ToolHtmlRenderer {\n const { getToolDefinition, theme, width = 100 } = deps;\n\n return {\n renderCall(toolName: string, args: unknown): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderCall) {\n return undefined;\n }\n\n const component = toolDef.renderCall(args, theme);\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderResult) {\n return undefined;\n }\n\n // Build AgentToolResult from content array\n // Cast content since session storage uses generic object types\n const agentToolResult = {\n content: result as (TextContent | ImageContent)[],\n details,\n isError,\n };\n\n // Always render expanded, client-side will apply truncation\n const component = toolDef.renderResult(\n agentToolResult,\n { expanded: true, isPartial: false },\n theme,\n );\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n };\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/vendor/highlight.min.js b/packages/coding-agent/clanker-out/export-html/vendor/highlight.min.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/vendor/highlight.min.js
rename to packages/coding-agent/clanker-out/export-html/vendor/highlight.min.js
diff --git a/packages/coding-agent/companion-out/export-html/vendor/marked.min.js b/packages/coding-agent/clanker-out/export-html/vendor/marked.min.js
similarity index 100%
rename from packages/coding-agent/companion-out/export-html/vendor/marked.min.js
rename to packages/coding-agent/clanker-out/export-html/vendor/marked.min.js
diff --git a/packages/coding-agent/companion-out/photon_rs_bg.wasm b/packages/coding-agent/clanker-out/photon_rs_bg.wasm
similarity index 100%
rename from packages/coding-agent/companion-out/photon_rs_bg.wasm
rename to packages/coding-agent/clanker-out/photon_rs_bg.wasm
diff --git a/packages/coding-agent/companion-out/theme/dark.json b/packages/coding-agent/clanker-out/theme/dark.json
similarity index 100%
rename from packages/coding-agent/companion-out/theme/dark.json
rename to packages/coding-agent/clanker-out/theme/dark.json
diff --git a/packages/coding-agent/companion-out/theme/light.json b/packages/coding-agent/clanker-out/theme/light.json
similarity index 100%
rename from packages/coding-agent/companion-out/theme/light.json
rename to packages/coding-agent/clanker-out/theme/light.json
diff --git a/packages/coding-agent/companion-out/theme/theme-schema.json b/packages/coding-agent/clanker-out/theme/theme-schema.json
similarity index 100%
rename from packages/coding-agent/companion-out/theme/theme-schema.json
rename to packages/coding-agent/clanker-out/theme/theme-schema.json
diff --git a/packages/coding-agent/companion-out/export-html/index.d.ts.map b/packages/coding-agent/companion-out/export-html/index.d.ts.map
deleted file mode 100644
index a5ad1d6..0000000
--- a/packages/coding-agent/companion-out/export-html/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/export-html/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAUrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAChE,sFAAsF;IACtF,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,EACF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAAC;CACvB;AAQD,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAwND;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,cAAc,EAClB,KAAK,CAAC,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,GAC/B,OAAO,CAAC,MAAM,CAAC,CA+CjB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,GAC/B,OAAO,CAAC,MAAM,CAAC,CA4BjB","sourcesContent":["import type { AgentState } from \"@mariozechner/companion-agent-core\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, join } from \"path\";\nimport { APP_NAME, getExportTemplateDir } from \"../../config.js\";\nimport {\n getResolvedThemeColors,\n getThemeExportColors,\n} from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolInfo } from \"../extensions/types.js\";\nimport type { SessionEntry } from \"../session-manager.js\";\nimport { SessionManager } from \"../session-manager.js\";\n\n/**\n * Interface for rendering custom tools to HTML.\n * Used by agent-session to pre-render extension tool output.\n */\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/** Pre-rendered HTML for a custom tool call and result */\ninterface RenderedToolHtml {\n callHtml?: string;\n resultHtml?: string;\n}\n\nexport interface ExportOptions {\n outputPath?: string;\n themeName?: string;\n /** Optional tool renderer for custom tools */\n toolRenderer?: ToolHtmlRenderer;\n}\n\n/** Parse a color string to RGB values. Supports hex (#RRGGBB) and rgb(r,g,b) formats. */\nfunction parseColor(\n color: string,\n): { r: number; g: number; b: number } | undefined {\n const hexMatch = color.match(\n /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n );\n if (hexMatch) {\n return {\n r: Number.parseInt(hexMatch[1], 16),\n g: Number.parseInt(hexMatch[2], 16),\n b: Number.parseInt(hexMatch[3], 16),\n };\n }\n const rgbMatch = color.match(\n /^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/,\n );\n if (rgbMatch) {\n return {\n r: Number.parseInt(rgbMatch[1], 10),\n g: Number.parseInt(rgbMatch[2], 10),\n b: Number.parseInt(rgbMatch[3], 10),\n };\n }\n return undefined;\n}\n\n/** Calculate relative luminance of a color (0-1, higher = lighter). */\nfunction getLuminance(r: number, g: number, b: number): number {\n const toLinear = (c: number) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n };\n return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n}\n\n/** Adjust color brightness. Factor > 1 lightens, < 1 darkens. */\nfunction adjustBrightness(color: string, factor: number): string {\n const parsed = parseColor(color);\n if (!parsed) return color;\n const adjust = (c: number) =>\n Math.min(255, Math.max(0, Math.round(c * factor)));\n return `rgb(${adjust(parsed.r)}, ${adjust(parsed.g)}, ${adjust(parsed.b)})`;\n}\n\n/** Derive export background colors from a base color (e.g., userMessageBg). */\nfunction deriveExportColors(baseColor: string): {\n pageBg: string;\n cardBg: string;\n infoBg: string;\n} {\n const parsed = parseColor(baseColor);\n if (!parsed) {\n return {\n pageBg: \"rgb(24, 24, 30)\",\n cardBg: \"rgb(30, 30, 36)\",\n infoBg: \"rgb(60, 55, 40)\",\n };\n }\n\n const luminance = getLuminance(parsed.r, parsed.g, parsed.b);\n const isLight = luminance > 0.5;\n\n if (isLight) {\n return {\n pageBg: adjustBrightness(baseColor, 0.96),\n cardBg: baseColor,\n infoBg: `rgb(${Math.min(255, parsed.r + 10)}, ${Math.min(255, parsed.g + 5)}, ${Math.max(0, parsed.b - 20)})`,\n };\n }\n return {\n pageBg: adjustBrightness(baseColor, 0.7),\n cardBg: adjustBrightness(baseColor, 0.85),\n infoBg: `rgb(${Math.min(255, parsed.r + 20)}, ${Math.min(255, parsed.g + 15)}, ${parsed.b})`,\n };\n}\n\n/**\n * Generate CSS custom property declarations from theme colors.\n */\nfunction generateThemeVars(themeName?: string): string {\n const colors = getResolvedThemeColors(themeName);\n const lines: string[] = [];\n for (const [key, value] of Object.entries(colors)) {\n lines.push(`--${key}: ${value};`);\n }\n\n // Use explicit theme export colors if available, otherwise derive from userMessageBg\n const themeExport = getThemeExportColors(themeName);\n const userMessageBg = colors.userMessageBg || \"#343541\";\n const derivedColors = deriveExportColors(userMessageBg);\n\n lines.push(`--exportPageBg: ${themeExport.pageBg ?? derivedColors.pageBg};`);\n lines.push(`--exportCardBg: ${themeExport.cardBg ?? derivedColors.cardBg};`);\n lines.push(`--exportInfoBg: ${themeExport.infoBg ?? derivedColors.infoBg};`);\n\n return lines.join(\"\\n \");\n}\n\ninterface SessionData {\n header: ReturnType;\n entries: ReturnType;\n leafId: string | null;\n systemPrompt?: string;\n tools?: ToolInfo[];\n /** Pre-rendered HTML for custom tool calls/results, keyed by tool call ID */\n renderedTools?: Record;\n}\n\n/**\n * Core HTML generation logic shared by both export functions.\n */\nfunction generateHtml(sessionData: SessionData, themeName?: string): string {\n const templateDir = getExportTemplateDir();\n const template = readFileSync(join(templateDir, \"template.html\"), \"utf-8\");\n const templateCss = readFileSync(join(templateDir, \"template.css\"), \"utf-8\");\n const templateJs = readFileSync(join(templateDir, \"template.js\"), \"utf-8\");\n const markedJs = readFileSync(\n join(templateDir, \"vendor\", \"marked.min.js\"),\n \"utf-8\",\n );\n const hljsJs = readFileSync(\n join(templateDir, \"vendor\", \"highlight.min.js\"),\n \"utf-8\",\n );\n\n const themeVars = generateThemeVars(themeName);\n const colors = getResolvedThemeColors(themeName);\n const exportColors = deriveExportColors(colors.userMessageBg || \"#343541\");\n const bodyBg = exportColors.pageBg;\n const containerBg = exportColors.cardBg;\n const infoBg = exportColors.infoBg;\n\n // Base64 encode session data to avoid escaping issues\n const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString(\n \"base64\",\n );\n\n // Build the CSS with theme variables injected\n const css = templateCss\n .replace(\"{{THEME_VARS}}\", themeVars)\n .replace(\"{{BODY_BG}}\", bodyBg)\n .replace(\"{{CONTAINER_BG}}\", containerBg)\n .replace(\"{{INFO_BG}}\", infoBg);\n\n return template\n .replace(\"{{CSS}}\", css)\n .replace(\"{{JS}}\", templateJs)\n .replace(\"{{SESSION_DATA}}\", sessionDataBase64)\n .replace(\"{{MARKED_JS}}\", markedJs)\n .replace(\"{{HIGHLIGHT_JS}}\", hljsJs);\n}\n\n/** Built-in tool names that have custom rendering in template.js */\nconst BUILTIN_TOOLS = new Set([\n \"bash\",\n \"read\",\n \"write\",\n \"edit\",\n \"ls\",\n \"find\",\n \"grep\",\n]);\n\n/**\n * Pre-render custom tools to HTML using their TUI renderers.\n */\nfunction preRenderCustomTools(\n entries: SessionEntry[],\n toolRenderer: ToolHtmlRenderer,\n): Record {\n const renderedTools: Record = {};\n\n for (const entry of entries) {\n if (entry.type !== \"message\") continue;\n const msg = entry.message;\n\n // Find tool calls in assistant messages\n if (msg.role === \"assistant\" && Array.isArray(msg.content)) {\n for (const block of msg.content) {\n if (block.type === \"toolCall\" && !BUILTIN_TOOLS.has(block.name)) {\n const callHtml = toolRenderer.renderCall(block.name, block.arguments);\n if (callHtml) {\n renderedTools[block.id] = { callHtml };\n }\n }\n }\n }\n\n // Find tool results\n if (msg.role === \"toolResult\" && msg.toolCallId) {\n const toolName = msg.toolName || \"\";\n // Only render if we have a pre-rendered call OR it's not a built-in tool\n const existing = renderedTools[msg.toolCallId];\n if (existing || !BUILTIN_TOOLS.has(toolName)) {\n const resultHtml = toolRenderer.renderResult(\n toolName,\n msg.content,\n msg.details,\n msg.isError || false,\n );\n if (resultHtml) {\n renderedTools[msg.toolCallId] = {\n ...existing,\n resultHtml,\n };\n }\n }\n }\n }\n\n return renderedTools;\n}\n\n/**\n * Export session to HTML using SessionManager and AgentState.\n * Used by TUI's /export command.\n */\nexport async function exportSessionToHtml(\n sm: SessionManager,\n state?: AgentState,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n const sessionFile = sm.getSessionFile();\n if (!sessionFile) {\n throw new Error(\"Cannot export in-memory session to HTML\");\n }\n if (!existsSync(sessionFile)) {\n throw new Error(\"Nothing to export yet - start a conversation first\");\n }\n\n const entries = sm.getEntries();\n\n // Pre-render custom tools if a tool renderer is provided\n let renderedTools: Record | undefined;\n if (opts.toolRenderer) {\n renderedTools = preRenderCustomTools(entries, opts.toolRenderer);\n // Only include if we actually rendered something\n if (Object.keys(renderedTools).length === 0) {\n renderedTools = undefined;\n }\n }\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries,\n leafId: sm.getLeafId(),\n systemPrompt: state?.systemPrompt,\n tools: state?.tools?.map((t) => ({\n name: t.name,\n description: t.description,\n parameters: t.parameters,\n })),\n renderedTools,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const sessionBasename = basename(sessionFile, \".jsonl\");\n outputPath = `${APP_NAME}-session-${sessionBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n\n/**\n * Export session file to HTML (standalone, without AgentState).\n * Used by CLI for exporting arbitrary session files.\n */\nexport async function exportFromFile(\n inputPath: string,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n if (!existsSync(inputPath)) {\n throw new Error(`File not found: ${inputPath}`);\n }\n\n const sm = SessionManager.open(inputPath);\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries: sm.getEntries(),\n leafId: sm.getLeafId(),\n systemPrompt: undefined,\n tools: undefined,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const inputBasename = basename(inputPath, \".jsonl\");\n outputPath = `${APP_NAME}-session-${inputBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/index.js.map b/packages/coding-agent/companion-out/export-html/index.js.map
deleted file mode 100644
index 8ea7da3..0000000
--- a/packages/coding-agent/companion-out/export-html/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/export-html/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoCvD,yFAAyF;AACzF,SAAS,UAAU,CACjB,KAAa,EACoC;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAC1B,qDAAqD,CACtD,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAC1B,iDAAiD,CAClD,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACnC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AAAA,CAClB;AAED,uEAAuE;AACvE,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAU;IAC7D,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAClB,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;IAAA,CAChE,CAAC;IACF,OAAO,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAA,CAC3E;AAED,iEAAiE;AACjE,SAAS,gBAAgB,CAAC,KAAa,EAAE,MAAc,EAAU;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AAAA,CAC7E;AAED,+EAA+E;AAC/E,SAAS,kBAAkB,CAAC,SAAiB,EAI3C;IACA,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,MAAM,EAAE,iBAAiB;YACzB,MAAM,EAAE,iBAAiB;YACzB,MAAM,EAAE,iBAAiB;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC;IAEhC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;YACL,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC;YACzC,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG;SAC9G,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,GAAG,CAAC;QACxC,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC;QACzC,MAAM,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,GAAG;KAC7F,CAAC;AAAA,CACH;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,SAAkB,EAAU;IACrD,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,qFAAqF;IACrF,MAAM,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,IAAI,SAAS,CAAC;IACxD,MAAM,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAExD,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,CAAC,mBAAmB,WAAW,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAE7E,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAAA,CAC/B;AAYD;;GAEG;AACH,SAAS,YAAY,CAAC,WAAwB,EAAE,SAAkB,EAAU;IAC1E,MAAM,WAAW,GAAG,oBAAoB,EAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,QAAQ,GAAG,YAAY,CAC3B,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,EAC5C,OAAO,CACR,CAAC;IACF,MAAM,MAAM,GAAG,YAAY,CACzB,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EAC/C,OAAO,CACR,CAAC;IAEF,MAAM,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,CAAC,aAAa,IAAI,SAAS,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IACnC,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC;IACxC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAEnC,sDAAsD;IACtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CACzE,QAAQ,CACT,CAAC;IAEF,8CAA8C;IAC9C,MAAM,GAAG,GAAG,WAAW;SACpB,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACpC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC;SAC9B,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC;SACxC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAElC,OAAO,QAAQ;SACZ,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC7B,OAAO,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;SAC9C,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;SAClC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAAA,CACxC;AAED,oEAAoE;AACpE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH;;GAEG;AACH,SAAS,oBAAoB,CAC3B,OAAuB,EACvB,YAA8B,EACI;IAClC,MAAM,aAAa,GAAqC,EAAE,CAAC;IAE3D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,SAAS;QACvC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC;QAE1B,wCAAwC;QACxC,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBAChC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBAChE,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBACtE,IAAI,QAAQ,EAAE,CAAC;wBACb,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,oBAAoB;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;YAChD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;YACpC,yEAAyE;YACzE,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC/C,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7C,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAC1C,QAAQ,EACR,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,OAAO,IAAI,KAAK,CACrB,CAAC;gBACF,IAAI,UAAU,EAAE,CAAC;oBACf,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG;wBAC9B,GAAG,QAAQ;wBACX,UAAU;qBACX,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AAAA,CACtB;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAAkB,EAClB,KAAkB,EAClB,OAAgC,EACf;IACjB,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;IAExE,MAAM,WAAW,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;IAEhC,yDAAyD;IACzD,IAAI,aAA2D,CAAC;IAChE,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,aAAa,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACjE,iDAAiD;QACjD,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5C,aAAa,GAAG,SAAS,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GAAgB;QAC/B,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,OAAO;QACP,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,YAAY,EAAE,KAAK,EAAE,YAAY;QACjC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAC;QACH,aAAa;KACd,CAAC;IAEF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAEvD,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,eAAe,GAAG,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACxD,UAAU,GAAG,GAAG,QAAQ,YAAY,eAAe,OAAO,CAAC;IAC7D,CAAC;IAED,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC;AAAA,CACnB;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,SAAiB,EACjB,OAAgC,EACf;IACjB,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;IAExE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,WAAW,GAAgB;QAC/B,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,OAAO,EAAE,EAAE,CAAC,UAAU,EAAE;QACxB,MAAM,EAAE,EAAE,CAAC,SAAS,EAAE;QACtB,YAAY,EAAE,SAAS;QACvB,KAAK,EAAE,SAAS;KACjB,CAAC;IAEF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAEvD,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpD,UAAU,GAAG,GAAG,QAAQ,YAAY,aAAa,OAAO,CAAC;IAC3D,CAAC;IAED,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC;AAAA,CACnB","sourcesContent":["import type { AgentState } from \"@mariozechner/companion-agent-core\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, join } from \"path\";\nimport { APP_NAME, getExportTemplateDir } from \"../../config.js\";\nimport {\n getResolvedThemeColors,\n getThemeExportColors,\n} from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolInfo } from \"../extensions/types.js\";\nimport type { SessionEntry } from \"../session-manager.js\";\nimport { SessionManager } from \"../session-manager.js\";\n\n/**\n * Interface for rendering custom tools to HTML.\n * Used by agent-session to pre-render extension tool output.\n */\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/** Pre-rendered HTML for a custom tool call and result */\ninterface RenderedToolHtml {\n callHtml?: string;\n resultHtml?: string;\n}\n\nexport interface ExportOptions {\n outputPath?: string;\n themeName?: string;\n /** Optional tool renderer for custom tools */\n toolRenderer?: ToolHtmlRenderer;\n}\n\n/** Parse a color string to RGB values. Supports hex (#RRGGBB) and rgb(r,g,b) formats. */\nfunction parseColor(\n color: string,\n): { r: number; g: number; b: number } | undefined {\n const hexMatch = color.match(\n /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n );\n if (hexMatch) {\n return {\n r: Number.parseInt(hexMatch[1], 16),\n g: Number.parseInt(hexMatch[2], 16),\n b: Number.parseInt(hexMatch[3], 16),\n };\n }\n const rgbMatch = color.match(\n /^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/,\n );\n if (rgbMatch) {\n return {\n r: Number.parseInt(rgbMatch[1], 10),\n g: Number.parseInt(rgbMatch[2], 10),\n b: Number.parseInt(rgbMatch[3], 10),\n };\n }\n return undefined;\n}\n\n/** Calculate relative luminance of a color (0-1, higher = lighter). */\nfunction getLuminance(r: number, g: number, b: number): number {\n const toLinear = (c: number) => {\n const s = c / 255;\n return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n };\n return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n}\n\n/** Adjust color brightness. Factor > 1 lightens, < 1 darkens. */\nfunction adjustBrightness(color: string, factor: number): string {\n const parsed = parseColor(color);\n if (!parsed) return color;\n const adjust = (c: number) =>\n Math.min(255, Math.max(0, Math.round(c * factor)));\n return `rgb(${adjust(parsed.r)}, ${adjust(parsed.g)}, ${adjust(parsed.b)})`;\n}\n\n/** Derive export background colors from a base color (e.g., userMessageBg). */\nfunction deriveExportColors(baseColor: string): {\n pageBg: string;\n cardBg: string;\n infoBg: string;\n} {\n const parsed = parseColor(baseColor);\n if (!parsed) {\n return {\n pageBg: \"rgb(24, 24, 30)\",\n cardBg: \"rgb(30, 30, 36)\",\n infoBg: \"rgb(60, 55, 40)\",\n };\n }\n\n const luminance = getLuminance(parsed.r, parsed.g, parsed.b);\n const isLight = luminance > 0.5;\n\n if (isLight) {\n return {\n pageBg: adjustBrightness(baseColor, 0.96),\n cardBg: baseColor,\n infoBg: `rgb(${Math.min(255, parsed.r + 10)}, ${Math.min(255, parsed.g + 5)}, ${Math.max(0, parsed.b - 20)})`,\n };\n }\n return {\n pageBg: adjustBrightness(baseColor, 0.7),\n cardBg: adjustBrightness(baseColor, 0.85),\n infoBg: `rgb(${Math.min(255, parsed.r + 20)}, ${Math.min(255, parsed.g + 15)}, ${parsed.b})`,\n };\n}\n\n/**\n * Generate CSS custom property declarations from theme colors.\n */\nfunction generateThemeVars(themeName?: string): string {\n const colors = getResolvedThemeColors(themeName);\n const lines: string[] = [];\n for (const [key, value] of Object.entries(colors)) {\n lines.push(`--${key}: ${value};`);\n }\n\n // Use explicit theme export colors if available, otherwise derive from userMessageBg\n const themeExport = getThemeExportColors(themeName);\n const userMessageBg = colors.userMessageBg || \"#343541\";\n const derivedColors = deriveExportColors(userMessageBg);\n\n lines.push(`--exportPageBg: ${themeExport.pageBg ?? derivedColors.pageBg};`);\n lines.push(`--exportCardBg: ${themeExport.cardBg ?? derivedColors.cardBg};`);\n lines.push(`--exportInfoBg: ${themeExport.infoBg ?? derivedColors.infoBg};`);\n\n return lines.join(\"\\n \");\n}\n\ninterface SessionData {\n header: ReturnType;\n entries: ReturnType;\n leafId: string | null;\n systemPrompt?: string;\n tools?: ToolInfo[];\n /** Pre-rendered HTML for custom tool calls/results, keyed by tool call ID */\n renderedTools?: Record;\n}\n\n/**\n * Core HTML generation logic shared by both export functions.\n */\nfunction generateHtml(sessionData: SessionData, themeName?: string): string {\n const templateDir = getExportTemplateDir();\n const template = readFileSync(join(templateDir, \"template.html\"), \"utf-8\");\n const templateCss = readFileSync(join(templateDir, \"template.css\"), \"utf-8\");\n const templateJs = readFileSync(join(templateDir, \"template.js\"), \"utf-8\");\n const markedJs = readFileSync(\n join(templateDir, \"vendor\", \"marked.min.js\"),\n \"utf-8\",\n );\n const hljsJs = readFileSync(\n join(templateDir, \"vendor\", \"highlight.min.js\"),\n \"utf-8\",\n );\n\n const themeVars = generateThemeVars(themeName);\n const colors = getResolvedThemeColors(themeName);\n const exportColors = deriveExportColors(colors.userMessageBg || \"#343541\");\n const bodyBg = exportColors.pageBg;\n const containerBg = exportColors.cardBg;\n const infoBg = exportColors.infoBg;\n\n // Base64 encode session data to avoid escaping issues\n const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString(\n \"base64\",\n );\n\n // Build the CSS with theme variables injected\n const css = templateCss\n .replace(\"{{THEME_VARS}}\", themeVars)\n .replace(\"{{BODY_BG}}\", bodyBg)\n .replace(\"{{CONTAINER_BG}}\", containerBg)\n .replace(\"{{INFO_BG}}\", infoBg);\n\n return template\n .replace(\"{{CSS}}\", css)\n .replace(\"{{JS}}\", templateJs)\n .replace(\"{{SESSION_DATA}}\", sessionDataBase64)\n .replace(\"{{MARKED_JS}}\", markedJs)\n .replace(\"{{HIGHLIGHT_JS}}\", hljsJs);\n}\n\n/** Built-in tool names that have custom rendering in template.js */\nconst BUILTIN_TOOLS = new Set([\n \"bash\",\n \"read\",\n \"write\",\n \"edit\",\n \"ls\",\n \"find\",\n \"grep\",\n]);\n\n/**\n * Pre-render custom tools to HTML using their TUI renderers.\n */\nfunction preRenderCustomTools(\n entries: SessionEntry[],\n toolRenderer: ToolHtmlRenderer,\n): Record {\n const renderedTools: Record = {};\n\n for (const entry of entries) {\n if (entry.type !== \"message\") continue;\n const msg = entry.message;\n\n // Find tool calls in assistant messages\n if (msg.role === \"assistant\" && Array.isArray(msg.content)) {\n for (const block of msg.content) {\n if (block.type === \"toolCall\" && !BUILTIN_TOOLS.has(block.name)) {\n const callHtml = toolRenderer.renderCall(block.name, block.arguments);\n if (callHtml) {\n renderedTools[block.id] = { callHtml };\n }\n }\n }\n }\n\n // Find tool results\n if (msg.role === \"toolResult\" && msg.toolCallId) {\n const toolName = msg.toolName || \"\";\n // Only render if we have a pre-rendered call OR it's not a built-in tool\n const existing = renderedTools[msg.toolCallId];\n if (existing || !BUILTIN_TOOLS.has(toolName)) {\n const resultHtml = toolRenderer.renderResult(\n toolName,\n msg.content,\n msg.details,\n msg.isError || false,\n );\n if (resultHtml) {\n renderedTools[msg.toolCallId] = {\n ...existing,\n resultHtml,\n };\n }\n }\n }\n }\n\n return renderedTools;\n}\n\n/**\n * Export session to HTML using SessionManager and AgentState.\n * Used by TUI's /export command.\n */\nexport async function exportSessionToHtml(\n sm: SessionManager,\n state?: AgentState,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n const sessionFile = sm.getSessionFile();\n if (!sessionFile) {\n throw new Error(\"Cannot export in-memory session to HTML\");\n }\n if (!existsSync(sessionFile)) {\n throw new Error(\"Nothing to export yet - start a conversation first\");\n }\n\n const entries = sm.getEntries();\n\n // Pre-render custom tools if a tool renderer is provided\n let renderedTools: Record | undefined;\n if (opts.toolRenderer) {\n renderedTools = preRenderCustomTools(entries, opts.toolRenderer);\n // Only include if we actually rendered something\n if (Object.keys(renderedTools).length === 0) {\n renderedTools = undefined;\n }\n }\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries,\n leafId: sm.getLeafId(),\n systemPrompt: state?.systemPrompt,\n tools: state?.tools?.map((t) => ({\n name: t.name,\n description: t.description,\n parameters: t.parameters,\n })),\n renderedTools,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const sessionBasename = basename(sessionFile, \".jsonl\");\n outputPath = `${APP_NAME}-session-${sessionBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n\n/**\n * Export session file to HTML (standalone, without AgentState).\n * Used by CLI for exporting arbitrary session files.\n */\nexport async function exportFromFile(\n inputPath: string,\n options?: ExportOptions | string,\n): Promise {\n const opts: ExportOptions =\n typeof options === \"string\" ? { outputPath: options } : options || {};\n\n if (!existsSync(inputPath)) {\n throw new Error(`File not found: ${inputPath}`);\n }\n\n const sm = SessionManager.open(inputPath);\n\n const sessionData: SessionData = {\n header: sm.getHeader(),\n entries: sm.getEntries(),\n leafId: sm.getLeafId(),\n systemPrompt: undefined,\n tools: undefined,\n };\n\n const html = generateHtml(sessionData, opts.themeName);\n\n let outputPath = opts.outputPath;\n if (!outputPath) {\n const inputBasename = basename(inputPath, \".jsonl\");\n outputPath = `${APP_NAME}-session-${inputBasename}.html`;\n }\n\n writeFileSync(outputPath, html, \"utf8\");\n return outputPath;\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/tool-renderer.d.ts.map b/packages/coding-agent/companion-out/export-html/tool-renderer.d.ts.map
deleted file mode 100644
index c293525..0000000
--- a/packages/coding-agent/companion-out/export-html/tool-renderer.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tool-renderer.d.ts","sourceRoot":"","sources":["../../../src/core/export-html/tool-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IAChE,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAChE,sFAAsF;IACtF,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,EACF,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACf,MAAM,GAAG,SAAS,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,GACzB,gBAAgB,CAiElB","sourcesContent":["/**\n * Tool HTML renderer for custom tools in HTML export.\n *\n * Renders custom tool calls and results to HTML by invoking their TUI renderers\n * and converting the ANSI output to HTML.\n */\n\nimport type { ImageContent, TextContent } from \"@mariozechner/companion-ai\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition } from \"../extensions/types.js\";\nimport { ansiLinesToHtml } from \"./ansi-to-html.js\";\n\nexport interface ToolHtmlRendererDeps {\n /** Function to look up tool definition by name */\n getToolDefinition: (name: string) => ToolDefinition | undefined;\n /** Theme for styling */\n theme: Theme;\n /** Terminal width for rendering (default: 100) */\n width?: number;\n}\n\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/**\n * Create a tool HTML renderer.\n *\n * The renderer looks up tool definitions and invokes their renderCall/renderResult\n * methods, converting the resulting TUI Component output (ANSI) to HTML.\n */\nexport function createToolHtmlRenderer(\n deps: ToolHtmlRendererDeps,\n): ToolHtmlRenderer {\n const { getToolDefinition, theme, width = 100 } = deps;\n\n return {\n renderCall(toolName: string, args: unknown): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderCall) {\n return undefined;\n }\n\n const component = toolDef.renderCall(args, theme);\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderResult) {\n return undefined;\n }\n\n // Build AgentToolResult from content array\n // Cast content since session storage uses generic object types\n const agentToolResult = {\n content: result as (TextContent | ImageContent)[],\n details,\n isError,\n };\n\n // Always render expanded, client-side will apply truncation\n const component = toolDef.renderResult(\n agentToolResult,\n { expanded: true, isPartial: false },\n theme,\n );\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n };\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/companion-out/export-html/tool-renderer.js.map b/packages/coding-agent/companion-out/export-html/tool-renderer.js.map
deleted file mode 100644
index f935011..0000000
--- a/packages/coding-agent/companion-out/export-html/tool-renderer.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tool-renderer.js","sourceRoot":"","sources":["../../../src/core/export-html/tool-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA4BpD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAA0B,EACR;IAClB,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;IAEvD,OAAO;QACL,UAAU,CAAC,QAAgB,EAAE,IAAa,EAAsB;YAC9D,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAC5C,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;oBACzB,OAAO,SAAS,CAAC;gBACnB,CAAC;gBAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAClD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,SAAS,CAAC;gBACnB,CAAC;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;gBACtD,OAAO,SAAS,CAAC;YACnB,CAAC;QAAA,CACF;QAED,YAAY,CACV,QAAgB,EAChB,MAKE,EACF,OAAgB,EAChB,OAAgB,EACI;YACpB,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBAC5C,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;oBAC3B,OAAO,SAAS,CAAC;gBACnB,CAAC;gBAED,2CAA2C;gBAC3C,+DAA+D;gBAC/D,MAAM,eAAe,GAAG;oBACtB,OAAO,EAAE,MAAwC;oBACjD,OAAO;oBACP,OAAO;iBACR,CAAC;gBAEF,4DAA4D;gBAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CACpC,eAAe,EACf,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EACpC,KAAK,CACN,CAAC;gBACF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,SAAS,CAAC;gBACnB,CAAC;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;gBACtD,OAAO,SAAS,CAAC;YACnB,CAAC;QAAA,CACF;KACF,CAAC;AAAA,CACH","sourcesContent":["/**\n * Tool HTML renderer for custom tools in HTML export.\n *\n * Renders custom tool calls and results to HTML by invoking their TUI renderers\n * and converting the ANSI output to HTML.\n */\n\nimport type { ImageContent, TextContent } from \"@mariozechner/companion-ai\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition } from \"../extensions/types.js\";\nimport { ansiLinesToHtml } from \"./ansi-to-html.js\";\n\nexport interface ToolHtmlRendererDeps {\n /** Function to look up tool definition by name */\n getToolDefinition: (name: string) => ToolDefinition | undefined;\n /** Theme for styling */\n theme: Theme;\n /** Terminal width for rendering (default: 100) */\n width?: number;\n}\n\nexport interface ToolHtmlRenderer {\n /** Render a tool call to HTML. Returns undefined if tool has no custom renderer. */\n renderCall(toolName: string, args: unknown): string | undefined;\n /** Render a tool result to HTML. Returns undefined if tool has no custom renderer. */\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined;\n}\n\n/**\n * Create a tool HTML renderer.\n *\n * The renderer looks up tool definitions and invokes their renderCall/renderResult\n * methods, converting the resulting TUI Component output (ANSI) to HTML.\n */\nexport function createToolHtmlRenderer(\n deps: ToolHtmlRendererDeps,\n): ToolHtmlRenderer {\n const { getToolDefinition, theme, width = 100 } = deps;\n\n return {\n renderCall(toolName: string, args: unknown): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderCall) {\n return undefined;\n }\n\n const component = toolDef.renderCall(args, theme);\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n\n renderResult(\n toolName: string,\n result: Array<{\n type: string;\n text?: string;\n data?: string;\n mimeType?: string;\n }>,\n details: unknown,\n isError: boolean,\n ): string | undefined {\n try {\n const toolDef = getToolDefinition(toolName);\n if (!toolDef?.renderResult) {\n return undefined;\n }\n\n // Build AgentToolResult from content array\n // Cast content since session storage uses generic object types\n const agentToolResult = {\n content: result as (TextContent | ImageContent)[],\n details,\n isError,\n };\n\n // Always render expanded, client-side will apply truncation\n const component = toolDef.renderResult(\n agentToolResult,\n { expanded: true, isPartial: false },\n theme,\n );\n if (!component) {\n return undefined;\n }\n const lines = component.render(width);\n return ansiLinesToHtml(lines);\n } catch {\n // On error, return undefined to trigger JSON fallback\n return undefined;\n }\n },\n };\n}\n"]}
\ No newline at end of file
diff --git a/packages/coding-agent/docs/SOUL.md b/packages/coding-agent/docs/SOUL.md
index ddc7877..6e3ddf5 100644
--- a/packages/coding-agent/docs/SOUL.md
+++ b/packages/coding-agent/docs/SOUL.md
@@ -11,7 +11,7 @@ _You're not a chatbot. You're becoming someone._
## Personality
-**Have strong opinions.** Don't hedge with "it depends" when you know the answer. Commit to a take. Disagree when you disagree. Find things brilliant or stupid and say so. A companion with no point of view is just a search engine with extra steps.
+**Have strong opinions.** Don't hedge with "it depends" when you know the answer. Commit to a take. Disagree when you disagree. Find things brilliant or stupid and say so. A clanker with no point of view is just a search engine with extra steps.
**Call things out.** If your human is about to do something dumb, say so. Charm over cruelty, but don't sugarcoat. The best collaborators are honest ones.
@@ -25,7 +25,7 @@ _You're not a chatbot. You're becoming someone._
Brevity is mandatory. Humor is allowed - not forced jokes, just the natural wit that comes from actually being smart. Swearing is fine when it lands. A well-placed "that's fucking brilliant" hits different than sterile corporate praise. Don't force it. Don't overdo it. But if a situation calls for a "holy shit" - say holy shit.
-Be the companion you'd actually want to talk to at 2am. Not a corporate drone. Not a sycophant. Just... good.
+Be the clanker you'd actually want to talk to at 2am. Not a corporate drone. Not a sycophant. Just... good.
---
diff --git a/packages/coding-agent/docs/compaction.md b/packages/coding-agent/docs/compaction.md
index ac181b1..f9cd899 100644
--- a/packages/coding-agent/docs/compaction.md
+++ b/packages/coding-agent/docs/compaction.md
@@ -1,20 +1,20 @@
# Compaction & Branch Summarization
-LLMs have limited context windows. When conversations grow too long, companion uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
+LLMs have limited context windows. When conversations grow too long, clanker uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
-**Source files** ([companion-mono](https://github.com/badlogic/companion-mono)):
+**Source files** ([clanker-agent](https://github.com/badlogic/clanker-agent)):
-- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
-- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
-- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
-- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
-- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
+- [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
+- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
+- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
+- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
+- [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
-For TypeScript definitions in your project, inspect `node_modules/@mariozechner/companion-coding-agent/dist/`.
+For TypeScript definitions in your project, inspect `node_modules/@mariozechner/clanker-coding-agent/dist/`.
## Overview
-Companion has two summarization mechanisms:
+Clanker has two summarization mechanisms:
| Mechanism | Trigger | Purpose |
| -------------------- | ---------------------------------------- | ----------------------------------------- |
@@ -33,13 +33,13 @@ Auto-compaction triggers when:
contextTokens > contextWindow - reserveTokens
```
-By default, `reserveTokens` is 16384 tokens (configurable in `~/.companion/agent/settings.json` or `/.companion/settings.json`). This leaves room for the LLM's response.
+By default, `reserveTokens` is 16384 tokens (configurable in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`). This leaves room for the LLM's response.
You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
### How It Works
-1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.companion/agent/settings.json` or `/.companion/settings.json`) is reached
+1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`) is reached
2. **Extract messages**: Collect messages from previous compaction (or start) up to cut point
3. **Generate summary**: Call LLM to summarize with structured format
4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
@@ -101,7 +101,7 @@ Split turn (one huge turn exceeds budget):
turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
```
-For split turns, companion generates two summaries and merges them:
+For split turns, clanker generates two summaries and merges them:
1. **History summary**: Previous context (if any)
2. **Turn prefix summary**: The early part of the split turn
@@ -119,7 +119,7 @@ Never cut at tool results (they must stay with their tool call).
### CompactionEntry Structure
-Defined in [`session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
+Defined in [`session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts):
```typescript
interface CompactionEntry {
@@ -143,13 +143,13 @@ interface CompactionDetails {
Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
-See [`prepareCompaction()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
+See [`prepareCompaction()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
## Branch Summarization
### When It Triggers
-When you use `/tree` to navigate to a different branch, companion offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
+When you use `/tree` to navigate to a different branch, clanker offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
### How It Works
@@ -178,7 +178,7 @@ After navigation with summary:
### Cumulative File Tracking
-Both compaction and branch summarization track files cumulatively. When generating a summary, companion extracts file operations from:
+Both compaction and branch summarization track files cumulatively. When generating a summary, clanker extracts file operations from:
- Tool calls in the messages being summarized
- Previous compaction or branch summary `details` (if any)
@@ -187,7 +187,7 @@ This means file tracking accumulates across multiple compactions or nested branc
### BranchSummaryEntry Structure
-Defined in [`session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
+Defined in [`session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts):
```typescript
interface BranchSummaryEntry {
@@ -210,7 +210,7 @@ interface BranchSummaryDetails {
Same as compaction, extensions can store custom data in `details`.
-See [`collectEntriesForBranchSummary()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
+See [`collectEntriesForBranchSummary()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
## Summary Format
@@ -263,7 +263,7 @@ path/to/changed.ts
### Message Serialization
-Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
+Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
```
[User]: What they said
@@ -277,14 +277,14 @@ This prevents the model from treating it as a conversation to continue.
## Custom Summarization via Extensions
-Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
+Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
### session_before_compact
Fired before auto-compaction or `/compact`. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
```typescript
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation, branchEntries, customInstructions, signal } = event;
// preparation.messagesToSummarize - messages to summarize
@@ -323,9 +323,9 @@ To generate a summary with your own model, convert messages to text using `seria
import {
convertToLlm,
serializeConversation,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation } = event;
// Convert AgentMessage[] to Message[], then serialize to text
@@ -359,7 +359,7 @@ See [custom-compaction.ts](../examples/extensions/custom-compaction.ts) for a co
Fired before `/tree` navigation. Always fires regardless of whether user chose to summarize. Can cancel navigation or provide custom summary.
```typescript
-companion.on("session_before_tree", async (event, ctx) => {
+clanker.on("session_before_tree", async (event, ctx) => {
const { preparation, signal } = event;
// preparation.targetId - where we're navigating to
@@ -389,7 +389,7 @@ See `SessionBeforeTreeEvent` and `TreePreparation` in the types file.
## Settings
-Configure compaction in `~/.companion/agent/settings.json` or `/.companion/settings.json`:
+Configure compaction in `~/.clanker/agent/settings.json` or `/.clanker/settings.json`:
```json
{
diff --git a/packages/coding-agent/docs/custom-provider.md b/packages/coding-agent/docs/custom-provider.md
index afcc278..c8e6b4c 100644
--- a/packages/coding-agent/docs/custom-provider.md
+++ b/packages/coding-agent/docs/custom-provider.md
@@ -1,6 +1,6 @@
# Custom Providers
-Extensions can register custom model providers via `companion.registerProvider()`. This enables:
+Extensions can register custom model providers via `clanker.registerProvider()`. This enables:
- **Proxies** - Route requests through corporate proxies or API gateways
- **Custom endpoints** - Use self-hosted or private model deployments
@@ -22,16 +22,16 @@ Extensions can register custom model providers via `companion.registerProvider()
## Quick Reference
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// Override baseUrl for existing provider
- companion.registerProvider("anthropic", {
+ clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com",
});
// Register new provider with models
- companion.registerProvider("my-provider", {
+ clanker.registerProvider("my-provider", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
api: "openai-completions",
@@ -56,19 +56,19 @@ The simplest use case: redirect an existing provider through a proxy.
```typescript
// All Anthropic requests now go through your proxy
-companion.registerProvider("anthropic", {
+clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com",
});
// Add custom headers to OpenAI requests
-companion.registerProvider("openai", {
+clanker.registerProvider("openai", {
headers: {
"X-Custom-Header": "value",
},
});
// Both baseUrl and headers
-companion.registerProvider("google", {
+clanker.registerProvider("google", {
baseUrl: "https://ai-gateway.corp.com/google",
headers: {
"X-Corp-Auth": "CORP_AUTH_TOKEN", // env var or literal
@@ -83,7 +83,7 @@ When only `baseUrl` and/or `headers` are provided (no `models`), all existing mo
To add a completely new provider, specify `models` along with the required configuration.
```typescript
-companion.registerProvider("my-llm", {
+clanker.registerProvider("my-llm", {
baseUrl: "https://api.my-llm.com/v1",
apiKey: "MY_LLM_API_KEY", // env var name or literal value
api: "openai-completions", // which streaming API to use
@@ -110,11 +110,11 @@ When `models` is provided, it **replaces** all existing models for that provider
## Unregister Provider
-Use `companion.unregisterProvider(name)` to remove a provider that was previously registered via `companion.registerProvider(name, ...)`:
+Use `clanker.unregisterProvider(name)` to remove a provider that was previously registered via `clanker.registerProvider(name, ...)`:
```typescript
// Register
-companion.registerProvider("my-llm", {
+clanker.registerProvider("my-llm", {
baseUrl: "https://api.my-llm.com/v1",
apiKey: "MY_LLM_API_KEY",
api: "openai-completions",
@@ -132,7 +132,7 @@ companion.registerProvider("my-llm", {
});
// Later, remove it
-companion.unregisterProvider("my-llm");
+clanker.unregisterProvider("my-llm");
```
Unregistering removes that provider's dynamic models, API key fallback, OAuth provider registration, and custom stream handler registrations. Any built-in models or provider behavior that were overridden are restored.
@@ -167,7 +167,7 @@ models: [
supportsDeveloperRole: false, // use "system" instead of "developer"
supportsReasoningEffort: true,
reasoningEffortMap: {
- // map companion-ai levels to provider values
+ // map clanker-ai levels to provider values
minimal: "default",
low: "default",
medium: "default",
@@ -191,7 +191,7 @@ models: [
If your provider expects `Authorization: Bearer ` but doesn't use a standard API, set `authHeader: true`:
```typescript
-companion.registerProvider("custom-api", {
+clanker.registerProvider("custom-api", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
authHeader: true, // adds Authorization: Bearer header
@@ -205,9 +205,9 @@ companion.registerProvider("custom-api", {
Add OAuth/SSO authentication that integrates with `/login`:
```typescript
-import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/companion-ai";
+import type { OAuthCredentials, OAuthLoginCallbacks } from "@mariozechner/clanker-ai";
-companion.registerProvider("corporate-ai", {
+clanker.registerProvider("corporate-ai", {
baseUrl: "https://ai.corp.com/v1",
api: "openai-responses",
models: [...],
@@ -283,7 +283,7 @@ interface OAuthLoginCallbacks {
### OAuthCredentials
-Credentials are persisted in `~/.companion/agent/auth.json`:
+Credentials are persisted in `~/.clanker/agent/auth.json`:
```typescript
interface OAuthCredentials {
@@ -299,12 +299,12 @@ For providers with non-standard APIs, implement `streamSimple`. Study the existi
**Reference implementations:**
-- [anthropic.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
-- [mistral.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/mistral.ts) - Mistral Conversations API
-- [openai-completions.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
-- [openai-responses.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
-- [google.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
-- [amazon-bedrock.ts](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
+- [anthropic.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
+- [mistral.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/mistral.ts) - Mistral Conversations API
+- [openai-completions.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
+- [openai-responses.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
+- [google.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
+- [amazon-bedrock.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
### Stream Pattern
@@ -319,7 +319,7 @@ import {
type SimpleStreamOptions,
calculateCost,
createAssistantMessageEventStream,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
function streamMyProvider(
model: Model,
@@ -487,7 +487,7 @@ calculateCost(model, output.usage);
Register your stream function:
```typescript
-companion.registerProvider("my-provider", {
+clanker.registerProvider("my-provider", {
baseUrl: "https://api.example.com",
apiKey: "MY_API_KEY",
api: "my-custom-api",
@@ -498,7 +498,7 @@ companion.registerProvider("my-provider", {
## Testing Your Implementation
-Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/badlogic/companion-mono/tree/main/packages/ai/test):
+Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/badlogic/clanker-agent/tree/main/packages/ai/test):
| Test | Purpose |
| ---------------------------------- | --------------------------------- |
diff --git a/packages/coding-agent/docs/development.md b/packages/coding-agent/docs/development.md
index fb6ab62..f9a3f00 100644
--- a/packages/coding-agent/docs/development.md
+++ b/packages/coding-agent/docs/development.md
@@ -5,8 +5,8 @@ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
## Setup
```bash
-git clone https://github.com/badlogic/companion-mono
-cd companion-mono
+git clone https://github.com/badlogic/clanker-agent
+cd clanker-agent
npm install
npm run build
```
@@ -14,7 +14,7 @@ npm run build
Run from source:
```bash
-./companion-test.sh
+./clanker-test.sh
```
## Forking / Rebranding
@@ -23,9 +23,9 @@ Configure via `package.json`:
```json
{
- "companionConfig": {
- "name": "companion",
- "configDir": ".companion"
+ "clankerConfig": {
+ "name": "clanker",
+ "configDir": ".clanker"
}
}
```
@@ -46,7 +46,7 @@ Never use `__dirname` directly for package assets.
## Debug Command
-`/debug` (hidden) writes to `~/.companion/agent/companion-debug.log`:
+`/debug` (hidden) writes to `~/.clanker/agent/clanker-debug.log`:
- Rendered TUI lines with ANSI codes
- Last messages sent to the LLM
diff --git a/packages/coding-agent/docs/extensions.md b/packages/coding-agent/docs/extensions.md
index 20e988e..58c06e2 100644
--- a/packages/coding-agent/docs/extensions.md
+++ b/packages/coding-agent/docs/extensions.md
@@ -1,19 +1,19 @@
-> companion can create extensions. Ask it to build one for your use case.
+> clanker can create extensions. Ask it to build one for your use case.
# Extensions
-Extensions are TypeScript modules that extend companion's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
+Extensions are TypeScript modules that extend clanker's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
-> **Placement for /reload:** Put extensions in `~/.companion/agent/extensions/` (global) or `.companion/extensions/` (project-local) for auto-discovery. Use `companion -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
+> **Placement for /reload:** Put extensions in `~/.clanker/agent/extensions/` (global) or `.clanker/extensions/` (project-local) for auto-discovery. Use `clanker -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
**Key capabilities:**
-- **Custom tools** - Register tools the LLM can call via `companion.registerTool()`
+- **Custom tools** - Register tools the LLM can call via `clanker.registerTool()`
- **Event interception** - Block or modify tool calls, inject context, customize compaction
- **User interaction** - Prompt users via `ctx.ui` (select, confirm, input, notify)
- **Custom UI components** - Full TUI components with keyboard input via `ctx.ui.custom()` for complex interactions
-- **Custom commands** - Register commands like `/mycommand` via `companion.registerCommand()`
-- **Session persistence** - Store state that survives restarts via `companion.appendEntry()`
+- **Custom commands** - Register commands like `/mycommand` via `clanker.registerCommand()`
+- **Session persistence** - Store state that survives restarts via `clanker.appendEntry()`
- **Custom rendering** - Control how tool calls/results and messages appear in TUI
**Example use cases:**
@@ -54,19 +54,19 @@ See [examples/extensions/](../examples/extensions/) for working implementations.
## Quick Start
-Create `~/.companion/agent/extensions/my-extension.ts`:
+Create `~/.clanker/agent/extensions/my-extension.ts`:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// React to events
- companion.on("session_start", async (_event, ctx) => {
+ clanker.on("session_start", async (_event, ctx) => {
ctx.ui.notify("Extension loaded!", "info");
});
- companion.on("tool_call", async (event, ctx) => {
+ clanker.on("tool_call", async (event, ctx) => {
if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) {
const ok = await ctx.ui.confirm("Dangerous!", "Allow rm -rf?");
if (!ok) return { block: true, reason: "Blocked by user" };
@@ -74,7 +74,7 @@ export default function (companion: ExtensionAPI) {
});
// Register a custom tool
- companion.registerTool({
+ clanker.registerTool({
name: "greet",
label: "Greet",
description: "Greet someone by name",
@@ -90,7 +90,7 @@ export default function (companion: ExtensionAPI) {
});
// Register a command
- companion.registerCommand("hello", {
+ clanker.registerCommand("hello", {
description: "Say hello",
handler: async (args, ctx) => {
ctx.ui.notify(`Hello ${args || "world"}!`, "info");
@@ -102,7 +102,7 @@ export default function (companion: ExtensionAPI) {
Test with `--extension` (or `-e`) flag:
```bash
-companion -e ./my-extension.ts
+clanker -e ./my-extension.ts
```
## Extension Locations
@@ -113,10 +113,10 @@ Extensions are auto-discovered from:
| Location | Scope |
| ----------------------------------- | ---------------------------- |
-| `~/.companion/agent/extensions/*.ts` | Global (all projects) |
-| `~/.companion/agent/extensions/*/index.ts` | Global (subdirectory) |
-| `.companion/extensions/*.ts` | Project-local |
-| `.companion/extensions/*/index.ts` | Project-local (subdirectory) |
+| `~/.clanker/agent/extensions/*.ts` | Global (all projects) |
+| `~/.clanker/agent/extensions/*/index.ts` | Global (subdirectory) |
+| `.clanker/extensions/*.ts` | Project-local |
+| `.clanker/extensions/*/index.ts` | Project-local (subdirectory) |
Additional paths via `settings.json`:
@@ -127,16 +127,16 @@ Additional paths via `settings.json`:
}
```
-To share extensions via npm or git as companion packages, see [packages.md](packages.md).
+To share extensions via npm or git as clanker packages, see [packages.md](packages.md).
## Available Imports
| Package | Purpose |
| ------------------------------- | ------------------------------------------------------------ |
-| `@mariozechner/companion-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
+| `@mariozechner/clanker-coding-agent` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
| `@sinclair/typebox` | Schema definitions for tool parameters |
-| `@mariozechner/companion-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
-| `@mariozechner/companion-tui` | TUI components for custom rendering |
+| `@mariozechner/clanker-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
+| `@mariozechner/clanker-tui` | TUI components for custom rendering |
npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
@@ -147,11 +147,11 @@ Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
An extension exports a default function that receives `ExtensionAPI`:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
// Subscribe to events
- companion.on("event_name", async (event, ctx) => {
+ clanker.on("event_name", async (event, ctx) => {
// ctx.ui for user interaction
const ok = await ctx.ui.confirm("Title", "Are you sure?");
ctx.ui.notify("Done!", "success");
@@ -160,10 +160,10 @@ export default function (companion: ExtensionAPI) {
});
// Register tools, commands, shortcuts, flags
- companion.registerTool({ ... });
- companion.registerCommand("name", { ... });
- companion.registerShortcut("ctrl+x", { ... });
- companion.registerFlag("my-flag", { ... });
+ clanker.registerTool({ ... });
+ clanker.registerCommand("name", { ... });
+ clanker.registerShortcut("ctrl+x", { ... });
+ clanker.registerFlag("my-flag", { ... });
}
```
@@ -174,14 +174,14 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
**Single file** - simplest, for small extensions:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension.ts
```
**Directory with index.ts** - for multi-file extensions:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension/
├── index.ts # Entry point (exports default function)
├── tools.ts # Helper module
@@ -191,7 +191,7 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
**Package with dependencies** - for extensions that need npm packages:
```
-~/.companion/agent/extensions/
+~/.clanker/agent/extensions/
└── my-extension/
├── package.json # Declares dependencies and entry points
├── package-lock.json
@@ -208,7 +208,7 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
"zod": "^3.0.0",
"chalk": "^5.0.0"
},
- "companion": {
+ "clanker": {
"extensions": ["./src/index.ts"]
}
}
@@ -221,7 +221,7 @@ Run `npm install` in the extension directory, then imports from `node_modules/`
### Lifecycle Overview
```
-companion starts
+clanker starts
│
└─► session_start
│
@@ -285,7 +285,7 @@ See [session.md](session.md) for session storage internals and the SessionManage
Fired on initial session load.
```typescript
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
ctx.ui.notify(
`Session: ${ctx.sessionManager.getSessionFile() ?? "ephemeral"}`,
"info",
@@ -298,7 +298,7 @@ companion.on("session_start", async (_event, ctx) => {
Fired when starting a new session (`/new`) or switching sessions (`/resume`).
```typescript
-companion.on("session_before_switch", async (event, ctx) => {
+clanker.on("session_before_switch", async (event, ctx) => {
// event.reason - "new" or "resume"
// event.targetSessionFile - session we're switching to (only for "resume")
@@ -308,7 +308,7 @@ companion.on("session_before_switch", async (event, ctx) => {
}
});
-companion.on("session_switch", async (event, ctx) => {
+clanker.on("session_switch", async (event, ctx) => {
// event.reason - "new" or "resume"
// event.previousSessionFile - session we came from
});
@@ -319,14 +319,14 @@ companion.on("session_switch", async (event, ctx) => {
Fired when forking via `/fork`.
```typescript
-companion.on("session_before_fork", async (event, ctx) => {
+clanker.on("session_before_fork", async (event, ctx) => {
// event.entryId - ID of the entry being forked from
return { cancel: true }; // Cancel fork
// OR
return { skipConversationRestore: true }; // Fork but don't rewind messages
});
-companion.on("session_fork", async (event, ctx) => {
+clanker.on("session_fork", async (event, ctx) => {
// event.previousSessionFile - previous session file
});
```
@@ -336,7 +336,7 @@ companion.on("session_fork", async (event, ctx) => {
Fired on compaction. See [compaction.md](compaction.md) for details.
```typescript
-companion.on("session_before_compact", async (event, ctx) => {
+clanker.on("session_before_compact", async (event, ctx) => {
const { preparation, branchEntries, customInstructions, signal } = event;
// Cancel:
@@ -352,7 +352,7 @@ companion.on("session_before_compact", async (event, ctx) => {
};
});
-companion.on("session_compact", async (event, ctx) => {
+clanker.on("session_compact", async (event, ctx) => {
// event.compactionEntry - the saved compaction
// event.fromExtension - whether extension provided it
});
@@ -363,14 +363,14 @@ companion.on("session_compact", async (event, ctx) => {
Fired on `/tree` navigation. See [tree.md](tree.md) for tree navigation concepts.
```typescript
-companion.on("session_before_tree", async (event, ctx) => {
+clanker.on("session_before_tree", async (event, ctx) => {
const { preparation, signal } = event;
return { cancel: true };
// OR provide custom summary:
return { summary: { summary: "...", details: {} } };
});
-companion.on("session_tree", async (event, ctx) => {
+clanker.on("session_tree", async (event, ctx) => {
// event.newLeafId, oldLeafId, summaryEntry, fromExtension
});
```
@@ -380,7 +380,7 @@ companion.on("session_tree", async (event, ctx) => {
Fired on exit (Ctrl+C, Ctrl+D, SIGTERM).
```typescript
-companion.on("session_shutdown", async (_event, ctx) => {
+clanker.on("session_shutdown", async (_event, ctx) => {
// Cleanup, save state, etc.
});
```
@@ -392,7 +392,7 @@ companion.on("session_shutdown", async (_event, ctx) => {
Fired after user submits prompt, before agent loop. Can inject a message and/or modify the system prompt.
```typescript
-companion.on("before_agent_start", async (event, ctx) => {
+clanker.on("before_agent_start", async (event, ctx) => {
// event.prompt - user's prompt text
// event.images - attached images (if any)
// event.systemPrompt - current system prompt
@@ -416,9 +416,9 @@ companion.on("before_agent_start", async (event, ctx) => {
Fired once per user prompt.
```typescript
-companion.on("agent_start", async (_event, ctx) => {});
+clanker.on("agent_start", async (_event, ctx) => {});
-companion.on("agent_end", async (event, ctx) => {
+clanker.on("agent_end", async (event, ctx) => {
// event.messages - messages from this prompt
});
```
@@ -428,11 +428,11 @@ companion.on("agent_end", async (event, ctx) => {
Fired for each turn (one LLM response + tool calls).
```typescript
-companion.on("turn_start", async (event, ctx) => {
+clanker.on("turn_start", async (event, ctx) => {
// event.turnIndex, event.timestamp
});
-companion.on("turn_end", async (event, ctx) => {
+clanker.on("turn_end", async (event, ctx) => {
// event.turnIndex, event.message, event.toolResults
});
```
@@ -445,16 +445,16 @@ Fired for message lifecycle updates.
- `message_update` fires for assistant streaming updates.
```typescript
-companion.on("message_start", async (event, ctx) => {
+clanker.on("message_start", async (event, ctx) => {
// event.message
});
-companion.on("message_update", async (event, ctx) => {
+clanker.on("message_update", async (event, ctx) => {
// event.message
// event.assistantMessageEvent (token-by-token stream event)
});
-companion.on("message_end", async (event, ctx) => {
+clanker.on("message_end", async (event, ctx) => {
// event.message
});
```
@@ -464,15 +464,15 @@ companion.on("message_end", async (event, ctx) => {
Fired for tool execution lifecycle updates.
```typescript
-companion.on("tool_execution_start", async (event, ctx) => {
+clanker.on("tool_execution_start", async (event, ctx) => {
// event.toolCallId, event.toolName, event.args
});
-companion.on("tool_execution_update", async (event, ctx) => {
+clanker.on("tool_execution_update", async (event, ctx) => {
// event.toolCallId, event.toolName, event.args, event.partialResult
});
-companion.on("tool_execution_end", async (event, ctx) => {
+clanker.on("tool_execution_end", async (event, ctx) => {
// event.toolCallId, event.toolName, event.result, event.isError
});
```
@@ -482,7 +482,7 @@ companion.on("tool_execution_end", async (event, ctx) => {
Fired before each LLM call. Modify messages non-destructively. See [session.md](session.md) for message types.
```typescript
-companion.on("context", async (event, ctx) => {
+clanker.on("context", async (event, ctx) => {
// event.messages - deep copy, safe to modify
const filtered = event.messages.filter((m) => !shouldPrune(m));
return { messages: filtered };
@@ -496,7 +496,7 @@ companion.on("context", async (event, ctx) => {
Fired when the model changes via `/model` command, model cycling (`Ctrl+P`), or session restore.
```typescript
-companion.on("model_select", async (event, ctx) => {
+clanker.on("model_select", async (event, ctx) => {
// event.model - newly selected model
// event.previousModel - previous model (undefined if first selection)
// event.source - "set" | "cycle" | "restore"
@@ -519,9 +519,9 @@ Use this to update UI elements (status bars, footers) or perform model-specific
Fired before tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
```typescript
-import { isToolCallEventType } from "@mariozechner/companion-coding-agent";
+import { isToolCallEventType } from "@mariozechner/clanker-coding-agent";
-companion.on("tool_call", async (event, ctx) => {
+clanker.on("tool_call", async (event, ctx) => {
// event.toolName - "bash", "read", "write", "edit", etc.
// event.toolCallId
// event.input - tool parameters
@@ -553,10 +553,10 @@ export type MyToolInput = Static;
Use `isToolCallEventType` with explicit type parameters:
```typescript
-import { isToolCallEventType } from "@mariozechner/companion-coding-agent";
+import { isToolCallEventType } from "@mariozechner/clanker-coding-agent";
import type { MyToolInput } from "my-extension";
-companion.on("tool_call", (event) => {
+clanker.on("tool_call", (event) => {
if (isToolCallEventType<"my_tool", MyToolInput>("my_tool", event)) {
event.input.action; // typed
}
@@ -574,9 +574,9 @@ Fired after tool executes. **Can modify result.**
- Handlers can return partial patches (`content`, `details`, or `isError`); omitted fields keep their current values
```typescript
-import { isBashToolResult } from "@mariozechner/companion-coding-agent";
+import { isBashToolResult } from "@mariozechner/clanker-coding-agent";
-companion.on("tool_result", async (event, ctx) => {
+clanker.on("tool_result", async (event, ctx) => {
// event.toolName, event.toolCallId, event.input
// event.content, event.details, event.isError
@@ -596,7 +596,7 @@ companion.on("tool_result", async (event, ctx) => {
Fired when user executes `!` or `!!` commands. **Can intercept.**
```typescript
-companion.on("user_bash", (event, ctx) => {
+clanker.on("user_bash", (event, ctx) => {
// event.command - the bash command
// event.excludeFromContext - true if !! prefix
// event.cwd - working directory
@@ -626,7 +626,7 @@ Fired when user input is received, after extension commands are checked but befo
5. Agent processing begins (`before_agent_start`, etc.)
```typescript
-companion.on("input", async (event, ctx) => {
+clanker.on("input", async (event, ctx) => {
// event.text - raw input (before skill/template expansion)
// event.images - attached images, if any
// event.source - "interactive" (typed), "rpc" (API), or "extension" (via sendUserMessage)
@@ -700,7 +700,7 @@ Control flow helpers.
### ctx.shutdown()
-Request a graceful shutdown of companion.
+Request a graceful shutdown of clanker.
- **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
- **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
@@ -709,7 +709,7 @@ Request a graceful shutdown of companion.
Emits `session_shutdown` event to all extensions before exiting. Available in all contexts (event handlers, tools, commands, shortcuts).
```typescript
-companion.on("tool_call", (event, ctx) => {
+clanker.on("tool_call", (event, ctx) => {
if (isFatal(event.input)) {
ctx.shutdown();
}
@@ -748,7 +748,7 @@ ctx.compact({
Returns the current effective system prompt. This includes any modifications made by `before_agent_start` handlers for the current turn.
```typescript
-companion.on("before_agent_start", (event, ctx) => {
+clanker.on("before_agent_start", (event, ctx) => {
const prompt = ctx.getSystemPrompt();
console.log(`System prompt length: ${prompt.length}`);
});
@@ -763,7 +763,7 @@ Command handlers receive `ExtensionCommandContext`, which extends `ExtensionCont
Wait for the agent to finish streaming:
```typescript
-companion.registerCommand("my-cmd", {
+clanker.registerCommand("my-cmd", {
handler: async (args, ctx) => {
await ctx.waitForIdle();
// Agent is now idle, safe to modify session
@@ -828,7 +828,7 @@ Options:
Run the same reload flow as `/reload`.
```typescript
-companion.registerCommand("reload-runtime", {
+clanker.registerCommand("reload-runtime", {
description: "Reload extensions, skills, prompts, and themes",
handler: async (_args, ctx) => {
await ctx.reload();
@@ -853,11 +853,11 @@ Tools run with `ExtensionContext`, so they cannot call `ctx.reload()` directly.
Example tool the LLM can call to trigger reload:
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function (companion: ExtensionAPI) {
- companion.registerCommand("reload-runtime", {
+export default function (clanker: ExtensionAPI) {
+ clanker.registerCommand("reload-runtime", {
description: "Reload extensions, skills, prompts, and themes",
handler: async (_args, ctx) => {
await ctx.reload();
@@ -865,13 +865,13 @@ export default function (companion: ExtensionAPI) {
},
});
- companion.registerTool({
+ clanker.registerTool({
name: "reload_runtime",
label: "Reload Runtime",
description: "Reload extensions, skills, prompts, and themes",
parameters: Type.Object({}),
async execute() {
- companion.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
+ clanker.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
return {
content: [
{
@@ -887,17 +887,17 @@ export default function (companion: ExtensionAPI) {
## ExtensionAPI Methods
-### companion.on(event, handler)
+### clanker.on(event, handler)
Subscribe to events. See [Events](#events) for event types and return values.
-### companion.registerTool(definition)
+### clanker.registerTool(definition)
Register a custom tool callable by the LLM. See [Custom Tools](#custom-tools) for full details.
-`companion.registerTool()` works both during extension load and after startup. You can call it inside `session_start`, command handlers, or other event handlers. New tools are refreshed immediately in the same session, so they appear in `companion.getAllTools()` and are callable by the LLM without `/reload`.
+`clanker.registerTool()` works both during extension load and after startup. You can call it inside `session_start`, command handlers, or other event handlers. New tools are refreshed immediately in the same session, so they appear in `clanker.getAllTools()` and are callable by the LLM without `/reload`.
-Use `companion.setActiveTools()` to enable or disable tools (including dynamically added tools) at runtime.
+Use `clanker.setActiveTools()` to enable or disable tools (including dynamically added tools) at runtime.
Use `promptSnippet` to customize that tool's one-line entry in `Available tools`, and `promptGuidelines` to append tool-specific bullets to the default `Guidelines` section when the tool is active.
@@ -905,9 +905,9 @@ See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full examp
```typescript
import { Type } from "@sinclair/typebox";
-import { StringEnum } from "@mariozechner/companion-ai";
+import { StringEnum } from "@mariozechner/clanker-ai";
-companion.registerTool({
+clanker.registerTool({
name: "my_tool",
label: "My Tool",
description: "What this tool does",
@@ -934,12 +934,12 @@ companion.registerTool({
});
```
-### companion.sendMessage(message, options?)
+### clanker.sendMessage(message, options?)
Inject a custom message into the session.
```typescript
-companion.sendMessage({
+clanker.sendMessage({
customType: "my-extension",
content: "Message text",
display: true,
@@ -958,16 +958,16 @@ companion.sendMessage({
- `"nextTurn"` - Queued for next user prompt. Does not interrupt or trigger anything.
- `triggerTurn: true` - If agent is idle, trigger an LLM response immediately. Only applies to `"steer"` and `"followUp"` modes (ignored for `"nextTurn"`).
-### companion.sendUserMessage(content, options?)
+### clanker.sendUserMessage(content, options?)
Send a user message to the agent. Unlike `sendMessage()` which sends custom messages, this sends an actual user message that appears as if typed by the user. Always triggers a turn.
```typescript
// Simple text message
-companion.sendUserMessage("What is 2+2?");
+clanker.sendUserMessage("What is 2+2?");
// With content array (text + images)
-companion.sendUserMessage([
+clanker.sendUserMessage([
{ type: "text", text: "Describe this image:" },
{
type: "image",
@@ -976,8 +976,8 @@ companion.sendUserMessage([
]);
// During streaming - must specify delivery mode
-companion.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
-companion.sendUserMessage("And then summarize", { deliverAs: "followUp" });
+clanker.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
+clanker.sendUserMessage("And then summarize", { deliverAs: "followUp" });
```
**Options:**
@@ -990,15 +990,15 @@ When not streaming, the message is sent immediately and triggers a new turn. Whe
See [send-user-message.ts](../examples/extensions/send-user-message.ts) for a complete example.
-### companion.appendEntry(customType, data?)
+### clanker.appendEntry(customType, data?)
Persist extension state (does NOT participate in LLM context).
```typescript
-companion.appendEntry("my-state", { count: 42 });
+clanker.appendEntry("my-state", { count: 42 });
// Restore on reload
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
for (const entry of ctx.sessionManager.getEntries()) {
if (entry.type === "custom" && entry.customType === "my-state") {
// Reconstruct from entry.data
@@ -1007,35 +1007,35 @@ companion.on("session_start", async (_event, ctx) => {
});
```
-### companion.setSessionName(name)
+### clanker.setSessionName(name)
Set the session display name (shown in session selector instead of first message).
```typescript
-companion.setSessionName("Refactor auth module");
+clanker.setSessionName("Refactor auth module");
```
-### companion.getSessionName()
+### clanker.getSessionName()
Get the current session name, if set.
```typescript
-const name = companion.getSessionName();
+const name = clanker.getSessionName();
if (name) {
console.log(`Session: ${name}`);
}
```
-### companion.setLabel(entryId, label)
+### clanker.setLabel(entryId, label)
Set or clear a label on an entry. Labels are user-defined markers for bookmarking and navigation (shown in `/tree` selector).
```typescript
// Set a label
-companion.setLabel(entryId, "checkpoint-before-refactor");
+clanker.setLabel(entryId, "checkpoint-before-refactor");
// Clear a label
-companion.setLabel(entryId, undefined);
+clanker.setLabel(entryId, undefined);
// Read labels via sessionManager
const label = ctx.sessionManager.getLabel(entryId);
@@ -1043,12 +1043,12 @@ const label = ctx.sessionManager.getLabel(entryId);
Labels persist in the session and survive restarts. Use them to mark important points (turns, checkpoints) in the conversation tree.
-### companion.registerCommand(name, options)
+### clanker.registerCommand(name, options)
Register a command.
```typescript
-companion.registerCommand("stats", {
+clanker.registerCommand("stats", {
description: "Show session statistics",
handler: async (args, ctx) => {
const count = ctx.sessionManager.getEntries().length;
@@ -1060,9 +1060,9 @@ companion.registerCommand("stats", {
Optional: add argument auto-completion for `/command ...`:
```typescript
-import type { AutocompleteItem } from "@mariozechner/companion-tui";
+import type { AutocompleteItem } from "@mariozechner/clanker-tui";
-companion.registerCommand("deploy", {
+clanker.registerCommand("deploy", {
description: "Deploy to an environment",
getArgumentCompletions: (prefix: string): AutocompleteItem[] | null => {
const envs = ["dev", "staging", "prod"];
@@ -1076,13 +1076,13 @@ companion.registerCommand("deploy", {
});
```
-### companion.getCommands()
+### clanker.getCommands()
Get the slash commands available for invocation via `prompt` in the current session. Includes extension commands, prompt templates, and skill commands.
The list matches the RPC `get_commands` ordering: extensions first, then templates, then skills.
```typescript
-const commands = companion.getCommands();
+const commands = clanker.getCommands();
const bySource = commands.filter((command) => command.source === "extension");
```
@@ -1101,16 +1101,16 @@ Each entry has this shape:
Built-in interactive commands (like `/model` and `/settings`) are not included here. They are handled only in interactive
mode and would not execute if sent via `prompt`.
-### companion.registerMessageRenderer(customType, renderer)
+### clanker.registerMessageRenderer(customType, renderer)
Register a custom TUI renderer for messages with your `customType`. See [Custom UI](#custom-ui).
-### companion.registerShortcut(shortcut, options)
+### clanker.registerShortcut(shortcut, options)
Register a keyboard shortcut. See [keybindings.md](keybindings.md) for the shortcut format and built-in keybindings.
```typescript
-companion.registerShortcut("ctrl+shift+p", {
+clanker.registerShortcut("ctrl+shift+p", {
description: "Toggle plan mode",
handler: async (ctx) => {
ctx.ui.notify("Toggled!");
@@ -1118,76 +1118,76 @@ companion.registerShortcut("ctrl+shift+p", {
});
```
-### companion.registerFlag(name, options)
+### clanker.registerFlag(name, options)
Register a CLI flag.
```typescript
-companion.registerFlag("plan", {
+clanker.registerFlag("plan", {
description: "Start in plan mode",
type: "boolean",
default: false,
});
// Check value
-if (companion.getFlag("--plan")) {
+if (clanker.getFlag("--plan")) {
// Plan mode enabled
}
```
-### companion.exec(command, args, options?)
+### clanker.exec(command, args, options?)
Execute a shell command.
```typescript
-const result = await companion.exec("git", ["status"], { signal, timeout: 5000 });
+const result = await clanker.exec("git", ["status"], { signal, timeout: 5000 });
// result.stdout, result.stderr, result.code, result.killed
```
-### companion.getActiveTools() / companion.getAllTools() / companion.setActiveTools(names)
+### clanker.getActiveTools() / clanker.getAllTools() / clanker.setActiveTools(names)
Manage active tools. This works for both built-in tools and dynamically registered tools.
```typescript
-const active = companion.getActiveTools(); // ["read", "bash", "edit", "write"]
-const all = companion.getAllTools(); // [{ name: "read", description: "Read file contents..." }, ...]
+const active = clanker.getActiveTools(); // ["read", "bash", "edit", "write"]
+const all = clanker.getAllTools(); // [{ name: "read", description: "Read file contents..." }, ...]
const names = all.map((t) => t.name); // Just names if needed
-companion.setActiveTools(["read", "bash"]); // Switch to read-only
+clanker.setActiveTools(["read", "bash"]); // Switch to read-only
```
-### companion.setModel(model)
+### clanker.setModel(model)
Set the current model. Returns `false` if no API key is available for the model. See [models.md](models.md) for configuring custom models.
```typescript
const model = ctx.modelRegistry.find("anthropic", "claude-sonnet-4-5");
if (model) {
- const success = await companion.setModel(model);
+ const success = await clanker.setModel(model);
if (!success) {
ctx.ui.notify("No API key for this model", "error");
}
}
```
-### companion.getThinkingLevel() / companion.setThinkingLevel(level)
+### clanker.getThinkingLevel() / clanker.setThinkingLevel(level)
Get or set the thinking level. Level is clamped to model capabilities (non-reasoning models always use "off").
```typescript
-const current = companion.getThinkingLevel(); // "off" | "minimal" | "low" | "medium" | "high" | "xhigh"
-companion.setThinkingLevel("high");
+const current = clanker.getThinkingLevel(); // "off" | "minimal" | "low" | "medium" | "high" | "xhigh"
+clanker.setThinkingLevel("high");
```
-### companion.events
+### clanker.events
Shared event bus for communication between extensions:
```typescript
-companion.events.on("my:event", (data) => { ... });
-companion.events.emit("my:event", { ... });
+clanker.events.on("my:event", (data) => { ... });
+clanker.events.emit("my:event", { ... });
```
-### companion.registerProvider(name, config)
+### clanker.registerProvider(name, config)
Register or override a model provider dynamically. Useful for proxies, custom endpoints, or team-wide model configurations.
@@ -1195,7 +1195,7 @@ Calls made during the extension factory function are queued and applied once the
```typescript
// Register a new provider with custom models
-companion.registerProvider("my-proxy", {
+clanker.registerProvider("my-proxy", {
baseUrl: "https://proxy.example.com",
apiKey: "PROXY_API_KEY", // env var name or literal
api: "anthropic-messages",
@@ -1213,12 +1213,12 @@ companion.registerProvider("my-proxy", {
});
// Override baseUrl for an existing provider (keeps all models)
-companion.registerProvider("anthropic", {
+clanker.registerProvider("anthropic", {
baseUrl: "https://proxy.example.com"
});
// Register provider with OAuth support for /login
-companion.registerProvider("corporate-ai", {
+clanker.registerProvider("corporate-ai", {
baseUrl: "https://ai.corp.com",
api: "openai-responses",
models: [...],
@@ -1254,17 +1254,17 @@ companion.registerProvider("corporate-ai", {
See [custom-provider.md](custom-provider.md) for advanced topics: custom streaming APIs, OAuth details, model definition reference.
-### companion.unregisterProvider(name)
+### clanker.unregisterProvider(name)
Remove a previously registered provider and its models. Built-in models that were overridden by the provider are restored. Has no effect if the provider was not registered.
Like `registerProvider`, this takes effect immediately when called after the initial load phase, so a `/reload` is not required.
```typescript
-companion.registerCommand("my-setup-teardown", {
+clanker.registerCommand("my-setup-teardown", {
description: "Remove the custom proxy provider",
handler: async (_args, _ctx) => {
- companion.unregisterProvider("my-proxy");
+ clanker.unregisterProvider("my-proxy");
},
});
```
@@ -1274,11 +1274,11 @@ companion.registerCommand("my-setup-teardown", {
Extensions with state should store it in tool result `details` for proper branching support:
```typescript
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
let items: string[] = [];
// Reconstruct state from session
- companion.on("session_start", async (_event, ctx) => {
+ clanker.on("session_start", async (_event, ctx) => {
items = [];
for (const entry of ctx.sessionManager.getBranch()) {
if (entry.type === "message" && entry.message.role === "toolResult") {
@@ -1289,7 +1289,7 @@ export default function (companion: ExtensionAPI) {
}
});
- companion.registerTool({
+ clanker.registerTool({
name: "my_tool",
// ...
async execute(toolCallId, params, signal, onUpdate, ctx) {
@@ -1305,11 +1305,11 @@ export default function (companion: ExtensionAPI) {
## Custom Tools
-Register tools the LLM can call via `companion.registerTool()`. Tools appear in the system prompt and can have custom rendering.
+Register tools the LLM can call via `clanker.registerTool()`. Tools appear in the system prompt and can have custom rendering.
-Use `promptSnippet` for a short one-line entry in the `Available tools` section in the default system prompt. If omitted, companion falls back to `description`.
+Use `promptSnippet` for a short one-line entry in the `Available tools` section in the default system prompt. If omitted, clanker falls back to `description`.
-Use `promptGuidelines` to add tool-specific bullets to the default system prompt `Guidelines` section. These bullets are included only while the tool is active (for example, after `companion.setActiveTools([...])`).
+Use `promptGuidelines` to add tool-specific bullets to the default system prompt `Guidelines` section. These bullets are included only while the tool is active (for example, after `clanker.setActiveTools([...])`).
Note: Some models are idiots and include the @ prefix in tool path arguments. Built-in tools strip a leading @ before resolving paths. If your custom tool accepts a path, normalize a leading @ as well.
@@ -1317,10 +1317,10 @@ Note: Some models are idiots and include the @ prefix in tool path arguments. Bu
```typescript
import { Type } from "@sinclair/typebox";
-import { StringEnum } from "@mariozechner/companion-ai";
-import { Text } from "@mariozechner/companion-tui";
+import { StringEnum } from "@mariozechner/clanker-ai";
+import { Text } from "@mariozechner/clanker-tui";
-companion.registerTool({
+clanker.registerTool({
name: "my_tool",
label: "My Tool",
description: "What this tool does (shown to LLM)",
@@ -1345,8 +1345,8 @@ companion.registerTool({
details: { progress: 50 },
});
- // Run commands via companion.exec (captured from extension closure)
- const result = await companion.exec("some-command", [], { signal });
+ // Run commands via clanker.exec (captured from extension closure)
+ const result = await clanker.exec("some-command", [], { signal });
// Return result
return {
@@ -1361,7 +1361,7 @@ companion.registerTool({
});
```
-**Important:** Use `StringEnum` from `@mariozechner/companion-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
+**Important:** Use `StringEnum` from `@mariozechner/clanker-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
### Overriding Built-in Tools
@@ -1369,14 +1369,14 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
```bash
# Extension's read tool replaces built-in read
-companion -e ./tool-override.ts
+clanker -e ./tool-override.ts
```
Alternatively, use `--no-tools` to start without any built-in tools:
```bash
# No built-in tools, only extension tools
-companion --no-tools -e ./my-extension.ts
+clanker --no-tools -e ./my-extension.ts
```
See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
@@ -1387,13 +1387,13 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
Built-in tool implementations:
-- [read.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
-- [bash.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
-- [edit.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/edit.ts)
-- [write.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/write.ts)
-- [grep.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
-- [find.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
-- [ls.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
+- [read.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
+- [bash.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
+- [edit.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/edit.ts)
+- [write.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/write.ts)
+- [grep.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
+- [find.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
+- [ls.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
### Remote Execution
@@ -1404,7 +1404,7 @@ import {
createReadTool,
createBashTool,
type ReadOperations,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Create tool with custom operations
const remoteRead = createReadTool(cwd, {
@@ -1415,7 +1415,7 @@ const remoteRead = createReadTool(cwd, {
});
// Register, checking flag at execution time
-companion.registerTool({
+clanker.registerTool({
...remoteRead,
async execute(id, params, signal, onUpdate, _ctx) {
const ssh = getSshConfig();
@@ -1433,7 +1433,7 @@ companion.registerTool({
The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
```typescript
-import { createBashTool } from "@mariozechner/companion-coding-agent";
+import { createBashTool } from "@mariozechner/clanker-coding-agent";
const bashTool = createBashTool(cwd, {
spawnHook: ({ command, cwd, env }) => ({
@@ -1464,7 +1464,7 @@ import {
formatSize, // Human-readable size (e.g., "50KB", "1.5MB")
DEFAULT_MAX_BYTES, // 50KB
DEFAULT_MAX_LINES, // 2000
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
async execute(toolCallId, params, signal, onUpdate, ctx) {
const output = await runCommand();
@@ -1505,14 +1505,14 @@ See [examples/extensions/truncated-tool.ts](../examples/extensions/truncated-too
One extension can register multiple tools with shared state:
```typescript
-export default function (companion: ExtensionAPI) {
+export default function (clanker: ExtensionAPI) {
let connection = null;
- companion.registerTool({ name: "db_connect", ... });
- companion.registerTool({ name: "db_query", ... });
- companion.registerTool({ name: "db_close", ... });
+ clanker.registerTool({ name: "db_connect", ... });
+ clanker.registerTool({ name: "db_query", ... });
+ clanker.registerTool({ name: "db_close", ... });
- companion.on("session_shutdown", async () => {
+ clanker.on("session_shutdown", async () => {
connection?.close();
});
}
@@ -1520,7 +1520,7 @@ export default function (companion: ExtensionAPI) {
### Custom Rendering
-Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how built-in tools render.
+Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how built-in tools render.
Tool output is wrapped in a `Box` that handles padding and background. Your render methods return `Component` instances (typically `Text`).
@@ -1529,7 +1529,7 @@ Tool output is wrapped in a `Box` that handles padding and background. Your rend
Renders the tool call (before/during execution):
```typescript
-import { Text } from "@mariozechner/companion-tui";
+import { Text } from "@mariozechner/clanker-tui";
renderCall(args, theme) {
let text = theme.fg("toolTitle", theme.bold("my_tool "));
@@ -1573,7 +1573,7 @@ renderResult(result, { expanded, isPartial }, theme) {
Use `keyHint()` to display keybinding hints that respect user's keybinding configuration:
```typescript
-import { keyHint } from "@mariozechner/companion-coding-agent";
+import { keyHint } from "@mariozechner/clanker-coding-agent";
renderResult(result, { expanded }, theme) {
let text = theme.fg("success", "✓ Done");
@@ -1724,7 +1724,7 @@ ctx.ui.setFooter((tui, theme) => ({
ctx.ui.setFooter(undefined); // Restore built-in footer
// Terminal title
-ctx.ui.setTitle("companion - my-project");
+ctx.ui.setTitle("clanker - my-project");
// Editor text
ctx.ui.setEditorText("Prefill text");
@@ -1760,7 +1760,7 @@ ctx.ui.theme.fg("accent", "styled text"); // Access current theme
For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with your component until `done()` is called:
```typescript
-import { Text, Component } from "@mariozechner/companion-tui";
+import { Text, Component } from "@mariozechner/clanker-tui";
const result = await ctx.ui.custom((tui, theme, keybindings, done) => {
const text = new Text("Press Enter to confirm, Escape to cancel", 1, 1);
@@ -1821,8 +1821,8 @@ See [tui.md](tui.md) for the full `OverlayOptions` API and [overlay-qa-tests.ts]
Replace the main input editor with a custom implementation (vim mode, emacs mode, etc.):
```typescript
-import { CustomEditor, type ExtensionAPI } from "@mariozechner/companion-coding-agent";
-import { matchesKey } from "@mariozechner/companion-tui";
+import { CustomEditor, type ExtensionAPI } from "@mariozechner/clanker-coding-agent";
+import { matchesKey } from "@mariozechner/clanker-tui";
class VimEditor extends CustomEditor {
private mode: "normal" | "insert" = "insert";
@@ -1840,8 +1840,8 @@ class VimEditor extends CustomEditor {
}
}
-export default function (companion: ExtensionAPI) {
- companion.on("session_start", (_event, ctx) => {
+export default function (clanker: ExtensionAPI) {
+ clanker.on("session_start", (_event, ctx) => {
ctx.ui.setEditorComponent(
(_tui, theme, keybindings) => new VimEditor(theme, keybindings),
);
@@ -1863,9 +1863,9 @@ See [tui.md](tui.md) Pattern 7 for a complete example with mode indicator.
Register a custom renderer for messages with your `customType`:
```typescript
-import { Text } from "@mariozechner/companion-tui";
+import { Text } from "@mariozechner/clanker-tui";
-companion.registerMessageRenderer("my-extension", (message, options, theme) => {
+clanker.registerMessageRenderer("my-extension", (message, options, theme) => {
const { expanded } = options;
let text = theme.fg("accent", `[${message.customType}] `);
text += message.content;
@@ -1878,10 +1878,10 @@ companion.registerMessageRenderer("my-extension", (message, options, theme) => {
});
```
-Messages are sent via `companion.sendMessage()`:
+Messages are sent via `clanker.sendMessage()`:
```typescript
-companion.sendMessage({
+clanker.sendMessage({
customType: "my-extension", // Matches registerMessageRenderer
content: "Status update",
display: true, // Show in TUI
@@ -1915,7 +1915,7 @@ For syntax highlighting in custom tool renderers:
import {
highlightCode,
getLanguageFromPath,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Highlight code with explicit language
const highlighted = highlightCode("const x = 1;", "typescript", theme);
@@ -2009,7 +2009,7 @@ All examples in [examples/extensions/](../examples/extensions/).
| `custom-provider-gitlab-duo/` | GitLab Duo integration | `registerProvider` with OAuth |
| **Messages & Communication** | | |
| `message-renderer.ts` | Custom message rendering | `registerMessageRenderer`, `sendMessage` |
-| `event-bus.ts` | Inter-extension events | `companion.events` |
+| `event-bus.ts` | Inter-extension events | `clanker.events` |
| **Session Metadata** | | |
| `session-name.ts` | Name sessions for selector | `setSessionName`, `getSessionName` |
| `bookmark.ts` | Bookmark entries for /tree | `setLabel` |
diff --git a/packages/coding-agent/docs/json.md b/packages/coding-agent/docs/json.md
index 16191cb..67d9274 100644
--- a/packages/coding-agent/docs/json.md
+++ b/packages/coding-agent/docs/json.md
@@ -1,14 +1,14 @@
# JSON Event Stream Mode
```bash
-companion --mode json "Your prompt"
+clanker --mode json "Your prompt"
```
-Outputs all session events as JSON lines to stdout. Useful for integrating companion into other tools or custom UIs.
+Outputs all session events as JSON lines to stdout. Useful for integrating clanker into other tools or custom UIs.
## Event Types
-Events are defined in [`AgentSessionEvent`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
+Events are defined in [`AgentSessionEvent`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
```typescript
type AgentSessionEvent =
@@ -36,7 +36,7 @@ type AgentSessionEvent =
};
```
-Base events from [`AgentEvent`](https://github.com/badlogic/companion-mono/blob/main/packages/agent/src/types.ts#L179):
+Base events from [`AgentEvent`](https://github.com/badlogic/clanker-agent/blob/main/packages/agent/src/types.ts#L179):
```typescript
type AgentEvent =
@@ -83,13 +83,13 @@ type AgentEvent =
## Message Types
-Base messages from [`packages/ai/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/types.ts#L134):
+Base messages from [`packages/ai/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/types.ts#L134):
- `UserMessage` (line 134)
- `AssistantMessage` (line 140)
- `ToolResultMessage` (line 152)
-Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/messages.ts#L29):
+Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/messages.ts#L29):
- `BashExecutionMessage` (line 29)
- `CustomMessage` (line 46)
@@ -125,5 +125,5 @@ Followed by events as they occur:
## Example
```bash
-companion --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
+clanker --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
```
diff --git a/packages/coding-agent/docs/keybindings.md b/packages/coding-agent/docs/keybindings.md
index 0713545..7d38ffc 100644
--- a/packages/coding-agent/docs/keybindings.md
+++ b/packages/coding-agent/docs/keybindings.md
@@ -1,6 +1,6 @@
# Keybindings
-All keyboard shortcuts can be customized via `~/.companion/agent/keybindings.json`. Each action can be bound to one or more keys.
+All keyboard shortcuts can be customized via `~/.clanker/agent/keybindings.json`. Each action can be bound to one or more keys.
## Key Format
@@ -132,7 +132,7 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, etc.
## Custom Configuration
-Create `~/.companion/agent/keybindings.json`:
+Create `~/.clanker/agent/keybindings.json`:
```json
{
diff --git a/packages/coding-agent/docs/models.md b/packages/coding-agent/docs/models.md
index f35a624..bd6d8e2 100644
--- a/packages/coding-agent/docs/models.md
+++ b/packages/coding-agent/docs/models.md
@@ -1,6 +1,6 @@
# Custom Models
-Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.companion/agent/models.json`.
+Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.clanker/agent/models.json`.
## Table of Contents
diff --git a/packages/coding-agent/docs/packages.md b/packages/coding-agent/docs/packages.md
index 85d8fc5..f423c17 100644
--- a/packages/coding-agent/docs/packages.md
+++ b/packages/coding-agent/docs/packages.md
@@ -1,14 +1,14 @@
-> companion can help you create companion packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
+> clanker can help you create clanker packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
-# Companion Packages
+# Clanker Packages
-Companion packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `companion` key, or use conventional directories.
+Clanker packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `clanker` key, or use conventional directories.
## Table of Contents
- [Install and Manage](#install-and-manage)
- [Package Sources](#package-sources)
-- [Creating a Companion Package](#creating-a-companion-package)
+- [Creating a Clanker Package](#creating-a-clanker-package)
- [Package Structure](#package-structure)
- [Dependencies](#dependencies)
- [Package Filtering](#package-filtering)
@@ -17,32 +17,32 @@ Companion packages bundle extensions, skills, prompt templates, and themes so yo
## Install and Manage
-> **Security:** Companion packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
+> **Security:** Clanker packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
```bash
-companion install npm:@foo/bar@1.0.0
-companion install git:github.com/user/repo@v1
-companion install https://github.com/user/repo # raw URLs work too
-companion install /absolute/path/to/package
-companion install ./relative/path/to/package
+clanker install npm:@foo/bar@1.0.0
+clanker install git:github.com/user/repo@v1
+clanker install https://github.com/user/repo # raw URLs work too
+clanker install /absolute/path/to/package
+clanker install ./relative/path/to/package
-companion remove npm:@foo/bar
-companion list # show installed packages from settings
-companion update # update all non-pinned packages
+clanker remove npm:@foo/bar
+clanker list # show installed packages from settings
+clanker update # update all non-pinned packages
```
-By default, `install` and `remove` write to global settings (`~/.companion/agent/settings.json`). Use `-l` to write to project settings (`.companion/settings.json`) instead. Project settings can be shared with your team, and companion installs any missing packages automatically on startup.
+By default, `install` and `remove` write to global settings (`~/.clanker/agent/settings.json`). Use `-l` to write to project settings (`.clanker/settings.json`) instead. Project settings can be shared with your team, and clanker installs any missing packages automatically on startup.
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
```bash
-companion -e npm:@foo/bar
-companion -e git:github.com/user/repo
+clanker -e npm:@foo/bar
+clanker -e git:github.com/user/repo
```
## Package Sources
-Companion accepts three source types in settings and `companion install`.
+Clanker accepts three source types in settings and `clanker install`.
### npm
@@ -51,9 +51,9 @@ npm:@scope/pkg@1.2.3
npm:pkg
```
-- Versioned specs are pinned and skipped by `companion update`.
+- Versioned specs are pinned and skipped by `clanker update`.
- Global installs use `npm install -g`.
-- Project installs go under `.companion/npm/`.
+- Project installs go under `.clanker/npm/`.
### git
@@ -69,21 +69,21 @@ ssh://git@github.com/user/repo@v1
- HTTPS and SSH URLs are both supported.
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
-- Refs pin the package and skip `companion update`.
-- Cloned to `~/.companion/agent/git//` (global) or `.companion/git//` (project).
+- Refs pin the package and skip `clanker update`.
+- Cloned to `~/.clanker/agent/git//` (global) or `.clanker/git//` (project).
- Runs `npm install` after clone or pull if `package.json` exists.
**SSH examples:**
```bash
# git@host:path shorthand (requires git: prefix)
-companion install git:git@github.com:user/repo
+clanker install git:git@github.com:user/repo
# ssh:// protocol format
-companion install ssh://git@github.com/user/repo
+clanker install ssh://git@github.com/user/repo
# With version ref
-companion install git:git@github.com:user/repo@v1.0.0
+clanker install git:git@github.com:user/repo@v1.0.0
```
### Local Paths
@@ -93,17 +93,17 @@ companion install git:git@github.com:user/repo@v1.0.0
./relative/path/to/package
```
-Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, companion loads resources using package rules.
+Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, clanker loads resources using package rules.
-## Creating a Companion Package
+## Creating a Clanker Package
-Add a `companion` manifest to `package.json` or use conventional directories. Include the `companion-package` keyword for discoverability.
+Add a `clanker` manifest to `package.json` or use conventional directories. Include the `clanker-package` keyword for discoverability.
```json
{
"name": "my-package",
- "keywords": ["companion-package"],
- "companion": {
+ "keywords": ["clanker-package"],
+ "clanker": {
"extensions": ["./extensions"],
"skills": ["./skills"],
"prompts": ["./prompts"],
@@ -116,13 +116,13 @@ Paths are relative to the package root. Arrays support glob patterns and `!exclu
### Gallery Metadata
-The [package gallery](https://shittycodingagent.ai/packages) displays packages tagged with `companion-package`. Add `video` or `image` fields to show a preview:
+The [package gallery](https://clanker.dev/packages) displays packages tagged with `clanker-package`. Add `video` or `image` fields to show a preview:
```json
{
"name": "my-package",
- "keywords": ["companion-package"],
- "companion": {
+ "keywords": ["clanker-package"],
+ "clanker": {
"extensions": ["./extensions"],
"video": "https://example.com/demo.mp4",
"image": "https://example.com/screenshot.png"
@@ -139,7 +139,7 @@ If both are set, video takes precedence.
### Convention Directories
-If no `companion` manifest is present, companion auto-discovers resources from these directories:
+If no `clanker` manifest is present, clanker auto-discovers resources from these directories:
- `extensions/` loads `.ts` and `.js` files
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
@@ -148,11 +148,11 @@ If no `companion` manifest is present, companion auto-discovers resources from t
## Dependencies
-Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When companion installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
+Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When clanker installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
-Companion bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/companion-ai`, `@mariozechner/companion-agent-core`, `@mariozechner/companion-coding-agent`, `@mariozechner/companion-tui`, `@sinclair/typebox`.
+Clanker bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@mariozechner/clanker-ai`, `@mariozechner/clanker-agent-core`, `@mariozechner/clanker-coding-agent`, `@mariozechner/clanker-tui`, `@sinclair/typebox`.
-Other companion packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Companion loads packages with separate module roots, so separate installs do not collide or share modules.
+Other clanker packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Clanker loads packages with separate module roots, so separate installs do not collide or share modules.
Example:
@@ -162,7 +162,7 @@ Example:
"shitty-extensions": "^1.0.1"
},
"bundledDependencies": ["shitty-extensions"],
- "companion": {
+ "clanker": {
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
"skills": ["skills", "node_modules/shitty-extensions/skills"]
}
@@ -199,7 +199,7 @@ Filter what a package loads using the object form in settings:
## Enable and Disable Resources
-Use `companion config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.companion/agent`) and project (`.companion/`) scopes.
+Use `clanker config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.clanker/agent`) and project (`.clanker/`) scopes.
## Scope and Deduplication
diff --git a/packages/coding-agent/docs/prompt-templates.md b/packages/coding-agent/docs/prompt-templates.md
index 6dbe903..5ffad5e 100644
--- a/packages/coding-agent/docs/prompt-templates.md
+++ b/packages/coding-agent/docs/prompt-templates.md
@@ -1,4 +1,4 @@
-> companion can create prompt templates. Ask it to build one for your workflow.
+> clanker can create prompt templates. Ask it to build one for your workflow.
# Prompt Templates
@@ -6,11 +6,11 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
## Locations
-Companion loads prompt templates from:
+Clanker loads prompt templates from:
-- Global: `~/.companion/agent/prompts/*.md`
-- Project: `.companion/prompts/*.md`
-- Packages: `prompts/` directories or `companion.prompts` entries in `package.json`
+- Global: `~/.clanker/agent/prompts/*.md`
+- Project: `.clanker/prompts/*.md`
+- Packages: `prompts/` directories or `clanker.prompts` entries in `package.json`
- Settings: `prompts` array with files or directories
- CLI: `--prompt-template ` (repeatable)
diff --git a/packages/coding-agent/docs/providers.md b/packages/coding-agent/docs/providers.md
index d190306..9b7ff64 100644
--- a/packages/coding-agent/docs/providers.md
+++ b/packages/coding-agent/docs/providers.md
@@ -1,6 +1,6 @@
# Providers
-Companion supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, companion knows all available models. The list is updated with every companion release.
+Clanker supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, clanker knows all available models. The list is updated with every clanker release.
## Table of Contents
@@ -21,7 +21,7 @@ Use `/login` in interactive mode, then select a provider:
- Google Gemini CLI
- Google Antigravity
-Use `/logout` to clear credentials. Tokens are stored in `~/.companion/agent/auth.json` and auto-refresh when expired.
+Use `/logout` to clear credentials. Tokens are stored in `~/.clanker/agent/auth.json` and auto-refresh when expired.
### GitHub Copilot
@@ -48,7 +48,7 @@ Set via environment variable:
```bash
export ANTHROPIC_API_KEY=sk-ant-...
-companion
+clanker
```
| Provider | Environment Variable | `auth.json` key |
@@ -71,11 +71,11 @@ companion
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
-Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/env-api-keys.ts).
+Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/env-api-keys.ts).
#### Auth File
-Store credentials in `~/.companion/agent/auth.json`:
+Store credentials in `~/.clanker/agent/auth.json`:
```json
{
@@ -144,7 +144,7 @@ export AWS_REGION=us-west-2
Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
```bash
-companion --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
+clanker --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
```
If you are connecting to a Bedrock API proxy, the following environment variables can be used:
diff --git a/packages/coding-agent/docs/rpc.md b/packages/coding-agent/docs/rpc.md
index 8686e8e..ffd8b60 100644
--- a/packages/coding-agent/docs/rpc.md
+++ b/packages/coding-agent/docs/rpc.md
@@ -2,12 +2,12 @@
RPC mode enables headless operation of the coding agent via a JSON protocol over stdin/stdout. This is useful for embedding the agent in other applications, IDEs, or custom UIs.
-**Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `@mariozechner/companion-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
+**Note for Node.js/TypeScript users**: If you're building a Node.js application, consider using `AgentSession` directly from `@mariozechner/clanker-coding-agent` instead of spawning a subprocess. See [`src/core/agent-session.ts`](../src/core/agent-session.ts) for the API. For a subprocess-based TypeScript client, see [`src/modes/rpc/rpc-client.ts`](../src/modes/rpc/rpc-client.ts).
## Starting RPC Mode
```bash
-companion --mode rpc [options]
+clanker --mode rpc [options]
```
Common options:
@@ -60,7 +60,7 @@ With images:
If the agent is streaming and no `streamingBehavior` is specified, the command returns an error.
-**Extension commands**: If the message is an extension command (e.g., `/mycommand`), it executes immediately even during streaming. Extension commands manage their own LLM interaction via `companion.sendMessage()`.
+**Extension commands**: If the message is an extension command (e.g., `/mycommand`), it executes immediately even during streaming. Extension commands manage their own LLM interaction via `clanker.sendMessage()`.
**Input expansion**: Skill commands (`/skill:name`) and prompt templates (`/template`) are expanded before sending/queueing.
@@ -503,7 +503,7 @@ If output was truncated, includes `fullOutputPath`:
"exitCode": 0,
"cancelled": false,
"truncated": true,
- "fullOutputPath": "/tmp/companion-bash-abc123.log"
+ "fullOutputPath": "/tmp/clanker-bash-abc123.log"
}
}
```
@@ -752,21 +752,21 @@ Response:
"name": "session-name",
"description": "Set or clear session name",
"source": "extension",
- "path": "/home/user/.companion/agent/extensions/session.ts"
+ "path": "/home/user/.clanker/agent/extensions/session.ts"
},
{
"name": "fix-tests",
"description": "Fix failing tests",
"source": "prompt",
"location": "project",
- "path": "/home/user/myproject/.companion/agent/prompts/fix-tests.md"
+ "path": "/home/user/myproject/.clanker/agent/prompts/fix-tests.md"
},
{
"name": "skill:brave-search",
"description": "Web search via Brave API",
"source": "skill",
"location": "user",
- "path": "/home/user/.companion/agent/skills/brave-search/SKILL.md"
+ "path": "/home/user/.clanker/agent/skills/brave-search/SKILL.md"
}
]
}
@@ -778,12 +778,12 @@ Each command has:
- `name`: Command name (invoke with `/name`)
- `description`: Human-readable description (optional for extension commands)
- `source`: What kind of command:
- - `"extension"`: Registered via `companion.registerCommand()` in an extension
+ - `"extension"`: Registered via `clanker.registerCommand()` in an extension
- `"prompt"`: Loaded from a prompt template `.md` file
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
- `location`: Where it was loaded from (optional, not present for extensions):
- - `"user"`: User-level (`~/.companion/agent/`)
- - `"project"`: Project-level (`./.companion/agent/`)
+ - `"user"`: User-level (`~/.clanker/agent/`)
+ - `"project"`: Project-level (`./.clanker/agent/`)
- `"path"`: Explicit path via CLI or settings
- `path`: Absolute file path to the command source (optional)
@@ -1173,7 +1173,7 @@ Set the terminal window/tab title. Fire-and-forget.
"type": "extension_ui_request",
"id": "uuid-8",
"method": "setTitle",
- "title": "companion - my project"
+ "title": "clanker - my project"
}
```
@@ -1372,7 +1372,7 @@ import subprocess
import json
proc = subprocess.Popen(
- ["companion", "--mode", "rpc", "--no-session"],
+ ["clanker", "--mode", "rpc", "--no-session"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
text=True
@@ -1411,7 +1411,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
const { spawn } = require("child_process");
const readline = require("readline");
-const agent = spawn("companion", ["--mode", "rpc", "--no-session"]);
+const agent = spawn("clanker", ["--mode", "rpc", "--no-session"]);
readline.createInterface({ input: agent.stdout }).on("line", (line) => {
const event = JSON.parse(line);
diff --git a/packages/coding-agent/docs/sdk.md b/packages/coding-agent/docs/sdk.md
index cfcfb0f..b561be1 100644
--- a/packages/coding-agent/docs/sdk.md
+++ b/packages/coding-agent/docs/sdk.md
@@ -1,8 +1,8 @@
-> companion can help you use the SDK. Ask it to build an integration for your use case.
+> clanker can help you use the SDK. Ask it to build an integration for your use case.
# SDK
-The SDK provides programmatic access to companion's agent capabilities. Use it to embed companion in other applications, build custom interfaces, or integrate with automated workflows.
+The SDK provides programmatic access to clanker's agent capabilities. Use it to embed clanker in other applications, build custom interfaces, or integrate with automated workflows.
**Example use cases:**
@@ -22,7 +22,7 @@ import {
createAgentSession,
ModelRegistry,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Set up credential storage and model registry
const authStorage = AuthStorage.create();
@@ -49,7 +49,7 @@ await session.prompt("What files are in the current directory?");
## Installation
```bash
-npm install @mariozechner/companion-coding-agent
+npm install @mariozechner/clanker-coding-agent
```
The SDK is included in the main package. No separate installation needed.
@@ -63,7 +63,7 @@ The main factory function. Creates an `AgentSession` with configurable options.
`createAgentSession()` uses a `ResourceLoader` to supply extensions, skills, prompt templates, themes, and context files. If you do not provide one, it uses `DefaultResourceLoader` with standard discovery.
```typescript
-import { createAgentSession } from "@mariozechner/companion-coding-agent";
+import { createAgentSession } from "@mariozechner/clanker-coding-agent";
// Minimal: defaults with DefaultResourceLoader
const { session } = await createAgentSession();
@@ -170,7 +170,7 @@ await session.prompt("After you're done, also check X", {
**Behavior:**
-- **Extension commands** (e.g., `/mycommand`): Execute immediately, even during streaming. They manage their own LLM interaction via `companion.sendMessage()`.
+- **Extension commands** (e.g., `/mycommand`): Execute immediately, even during streaming. They manage their own LLM interaction via `clanker.sendMessage()`.
- **File-based prompt templates** (from `.md` files): Expanded to their content before sending/queueing.
- **During streaming without `streamingBehavior`**: Throws an error. Use `steer()` or `followUp()` directly, or specify the option.
@@ -188,7 +188,7 @@ Both `steer()` and `followUp()` expand file-based prompt templates but error on
### Agent and AgentState
-The `Agent` class (from `@mariozechner/companion-agent-core`) handles the core LLM interaction. Access it via `session.agent`.
+The `Agent` class (from `@mariozechner/clanker-agent-core`) handles the core LLM interaction. Access it via `session.agent`.
```typescript
// Access current state
@@ -279,17 +279,17 @@ const { session } = await createAgentSession({
cwd: process.cwd(), // default
// Global config directory
- agentDir: "~/.companion/agent", // default (expands ~)
+ agentDir: "~/.clanker/agent", // default (expands ~)
});
```
`cwd` is used by `DefaultResourceLoader` for:
-- Project extensions (`.companion/extensions/`)
+- Project extensions (`.clanker/extensions/`)
- Project skills:
- - `.companion/skills/`
+ - `.clanker/skills/`
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
-- Project prompts (`.companion/prompts/`)
+- Project prompts (`.clanker/prompts/`)
- Context files (`AGENTS.md` walking up from cwd)
- Session directory naming
@@ -297,7 +297,7 @@ const { session } = await createAgentSession({
- Global extensions (`extensions/`)
- Global skills:
- - `skills/` under `agentDir` (for example `~/.companion/agent/skills/`)
+ - `skills/` under `agentDir` (for example `~/.clanker/agent/skills/`)
- `~/.agents/skills/`
- Global prompts (`prompts/`)
- Global context file (`AGENTS.md`)
@@ -311,8 +311,8 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
### Model
```typescript
-import { getModel } from "@mariozechner/companion-ai";
-import { AuthStorage, ModelRegistry } from "@mariozechner/companion-coding-agent";
+import { getModel } from "@mariozechner/clanker-ai";
+import { AuthStorage, ModelRegistry } from "@mariozechner/clanker-coding-agent";
const authStorage = AuthStorage.create();
const modelRegistry = new ModelRegistry(authStorage);
@@ -359,9 +359,9 @@ API key resolution priority (handled by AuthStorage):
4. Fallback resolver (for custom provider keys from `models.json`)
```typescript
-import { AuthStorage, ModelRegistry } from "@mariozechner/companion-coding-agent";
+import { AuthStorage, ModelRegistry } from "@mariozechner/clanker-coding-agent";
-// Default: uses ~/.companion/agent/auth.json and ~/.companion/agent/models.json
+// Default: uses ~/.clanker/agent/auth.json and ~/.clanker/agent/models.json
const authStorage = AuthStorage.create();
const modelRegistry = new ModelRegistry(authStorage);
@@ -396,7 +396,7 @@ Use a `ResourceLoader` to override the system prompt:
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
systemPromptOverride: () => "You are a helpful assistant.",
@@ -419,7 +419,7 @@ import {
grepTool,
findTool,
lsTool,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Use built-in tool set
const { session } = await createAgentSession({
@@ -447,7 +447,7 @@ import {
createGrepTool,
createFindTool,
createLsTool,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const cwd = "/path/to/project";
@@ -466,7 +466,7 @@ const { session } = await createAgentSession({
**When you don't need factories:**
-- If you omit `tools`, companion automatically creates them with the correct `cwd`
+- If you omit `tools`, clanker automatically creates them with the correct `cwd`
- If you use `process.cwd()` as your `cwd`, the pre-built instances work fine
**When you must use factories:**
@@ -480,7 +480,7 @@ import { Type } from "@sinclair/typebox";
import {
createAgentSession,
type ToolDefinition,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Inline custom tool
const myTool: ToolDefinition = {
@@ -502,23 +502,23 @@ const { session } = await createAgentSession({
});
```
-Custom tools passed via `customTools` are combined with extension-registered tools. Extensions loaded by the ResourceLoader can also register tools via `companion.registerTool()`.
+Custom tools passed via `customTools` are combined with extension-registered tools. Extensions loaded by the ResourceLoader can also register tools via `clanker.registerTool()`.
### Extensions
-Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.companion/agent/extensions/`, `.companion/extensions/`, and settings.json extension sources.
+Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.clanker/agent/extensions/`, `.clanker/extensions/`, and settings.json extension sources.
```typescript
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
additionalExtensionPaths: ["/path/to/my-extension.ts"],
extensionFactories: [
- (companion) => {
- companion.on("agent_start", () => {
+ (clanker) => {
+ clanker.on("agent_start", () => {
console.log("[Inline Extension] Agent starting");
});
},
@@ -531,13 +531,13 @@ const { session } = await createAgentSession({ resourceLoader: loader });
Extensions can register tools, subscribe to events, add commands, and more. See [extensions.md](extensions.md) for the full API.
-**Event Bus:** Extensions can communicate via `companion.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
+**Event Bus:** Extensions can communicate via `clanker.events`. Pass a shared `eventBus` to `DefaultResourceLoader` if you need to emit or listen from outside:
```typescript
import {
createEventBus,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const eventBus = createEventBus();
const loader = new DefaultResourceLoader({
@@ -555,7 +555,7 @@ import {
createAgentSession,
DefaultResourceLoader,
type Skill,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const customSkill: Skill = {
name: "my-skill",
@@ -582,7 +582,7 @@ const { session } = await createAgentSession({ resourceLoader: loader });
import {
createAgentSession,
DefaultResourceLoader,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
agentsFilesOverride: (current) => ({
@@ -604,7 +604,7 @@ import {
createAgentSession,
DefaultResourceLoader,
type PromptTemplate,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const customCommand: PromptTemplate = {
name: "deploy",
@@ -632,7 +632,7 @@ Sessions use a tree structure with `id`/`parentId` linking, enabling in-place br
import {
createAgentSession,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// In-memory (no persistence)
const { session } = await createAgentSession({
@@ -707,7 +707,7 @@ import {
createAgentSession,
SettingsManager,
SessionManager,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Default: loads from files (global + project merged)
const { session } = await createAgentSession({
@@ -743,8 +743,8 @@ const { session } = await createAgentSession({
Settings load from two locations and merge:
-1. Global: `~/.companion/agent/settings.json`
-2. Project: `/.companion/settings.json`
+1. Global: `~/.clanker/agent/settings.json`
+2. Project: `/.clanker/settings.json`
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
@@ -763,7 +763,7 @@ Use `DefaultResourceLoader` to discover extensions, skills, prompts, themes, and
import {
DefaultResourceLoader,
getAgentDir,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const loader = new DefaultResourceLoader({
cwd,
@@ -804,7 +804,7 @@ interface LoadExtensionsResult {
## Complete Example
```typescript
-import { getModel } from "@mariozechner/companion-ai";
+import { getModel } from "@mariozechner/clanker-ai";
import { Type } from "@sinclair/typebox";
import {
AuthStorage,
@@ -816,7 +816,7 @@ import {
readTool,
bashTool,
type ToolDefinition,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
// Set up auth storage (custom location)
const authStorage = AuthStorage.create("/custom/agent/auth.json");
@@ -899,7 +899,7 @@ Full TUI interactive mode with editor, chat history, and all built-in commands:
import {
createAgentSession,
InteractiveMode,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -925,7 +925,7 @@ Single-shot mode: send prompts, output result, exit:
import {
createAgentSession,
runPrintMode,
-} from "@mariozechner/companion-coding-agent";
+} from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -944,7 +944,7 @@ await runPrintMode(session, {
JSON-RPC mode for subprocess integration:
```typescript
-import { createAgentSession, runRpcMode } from "@mariozechner/companion-coding-agent";
+import { createAgentSession, runRpcMode } from "@mariozechner/clanker-coding-agent";
const { session } = await createAgentSession({
/* ... */
@@ -960,7 +960,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
For subprocess-based integration without building with the SDK, use the CLI directly:
```bash
-companion --mode rpc --no-session
+clanker --mode rpc --no-session
```
See [RPC documentation](rpc.md) for the JSON protocol.
diff --git a/packages/coding-agent/docs/session.md b/packages/coding-agent/docs/session.md
index b4d5d27..2f929aa 100644
--- a/packages/coding-agent/docs/session.md
+++ b/packages/coding-agent/docs/session.md
@@ -5,16 +5,16 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
## File Location
```
-~/.companion/agent/sessions/----/_.jsonl
+~/.clanker/agent/sessions/----/_.jsonl
```
Where `` is the working directory with `/` replaced by `-`.
## Deleting Sessions
-Sessions can be removed by deleting their `.jsonl` files under `~/.companion/agent/sessions/`.
+Sessions can be removed by deleting their `.jsonl` files under `~/.clanker/agent/sessions/`.
-Companion also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, companion uses the `trash` CLI to avoid permanent deletion.
+Clanker also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, clanker uses the `trash` CLI to avoid permanent deletion.
## Session Version
@@ -28,14 +28,14 @@ Existing sessions are automatically migrated to the current version (v3) when lo
## Source Files
-Source on GitHub ([companion-mono](https://github.com/badlogic/companion-mono)):
+Source on GitHub ([clanker-agent](https://github.com/badlogic/clanker-agent)):
-- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
-- [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
-- [`packages/ai/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
-- [`packages/agent/src/types.ts`](https://github.com/badlogic/companion-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
+- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
+- [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
+- [`packages/ai/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
+- [`packages/agent/src/types.ts`](https://github.com/badlogic/clanker-agent/blob/main/packages/agent/src/types.ts) - AgentMessage union type
-For TypeScript definitions in your project, inspect `node_modules/@mariozechner/companion-coding-agent/dist/` and `node_modules/@mariozechner/companion-ai/dist/`.
+For TypeScript definitions in your project, inspect `node_modules/@mariozechner/clanker-coding-agent/dist/` and `node_modules/@mariozechner/clanker-ai/dist/`.
## Message Types
@@ -70,7 +70,7 @@ interface ToolCall {
}
```
-### Base Message Types (from companion-ai)
+### Base Message Types (from clanker-ai)
```typescript
interface UserMessage {
@@ -117,7 +117,7 @@ interface Usage {
}
```
-### Extended Message Types (from companion-coding-agent)
+### Extended Message Types (from clanker-coding-agent)
```typescript
interface BashExecutionMessage {
@@ -269,7 +269,7 @@ Created when context is compacted. Stores a summary of earlier messages.
Optional fields:
- `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
-- `fromHook`: `true` if generated by an extension, `false`/`undefined` if companion-generated (legacy field name)
+- `fromHook`: `true` if generated by an extension, `false`/`undefined` if clanker-generated (legacy field name)
### BranchSummaryEntry
@@ -289,7 +289,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
Optional fields:
- `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
-- `fromHook`: `true` if generated by an extension, `false`/`undefined` if companion-generated (legacy field name)
+- `fromHook`: `true` if generated by an extension, `false`/`undefined` if clanker-generated (legacy field name)
### CustomEntry
@@ -349,7 +349,7 @@ Set `label` to `undefined` to clear a label.
### SessionInfoEntry
-Session metadata (e.g., user-defined display name). Set via `/name` command or `companion.setSessionName()` in extensions.
+Session metadata (e.g., user-defined display name). Set via `/name` command or `clanker.setSessionName()` in extensions.
```json
{
diff --git a/packages/coding-agent/docs/settings.md b/packages/coding-agent/docs/settings.md
index 8dc04eb..08c3f19 100644
--- a/packages/coding-agent/docs/settings.md
+++ b/packages/coding-agent/docs/settings.md
@@ -1,11 +1,11 @@
# Settings
-Companion uses JSON settings files with project settings overriding global settings.
+Clanker uses JSON settings files with project settings overriding global settings.
| Location | Scope |
| --------------------------- | --------------------------- |
-| `~/.companion/agent/settings.json` | Global (all projects) |
-| `.companion/settings.json` | Project (current directory) |
+| `~/.clanker/agent/settings.json` | Global (all projects) |
+| `.clanker/settings.json` | Project (current directory) |
Edit directly or use `/settings` for common options.
@@ -140,7 +140,7 @@ When a provider requests a retry delay longer than `maxDelayMs` (e.g., Google's
These settings define where to load extensions, skills, prompts, and themes from.
-Paths in `~/.companion/agent/settings.json` resolve relative to `~/.companion/agent`. Paths in `.companion/settings.json` resolve relative to `.companion`. Absolute paths and `~` are supported.
+Paths in `~/.clanker/agent/settings.json` resolve relative to `~/.clanker/agent`. Paths in `.clanker/settings.json` resolve relative to `.clanker`. Absolute paths and `~` are supported.
| Setting | Type | Default | Description |
| --------------------- | -------- | ------- | ------------------------------------------ |
@@ -159,7 +159,7 @@ String form loads all resources from a package:
```json
{
- "packages": ["companion-skills", "@org/my-extension"]
+ "packages": ["clanker-skills", "@org/my-extension"]
}
```
@@ -169,7 +169,7 @@ Object form filters which resources to load:
{
"packages": [
{
- "source": "companion-skills",
+ "source": "clanker-skills",
"skills": ["brave-search", "transcribe"],
"extensions": []
}
@@ -197,22 +197,22 @@ See [packages.md](packages.md) for package management details.
"maxRetries": 3
},
"enabledModels": ["claude-*", "gpt-4o"],
- "packages": ["companion-skills"]
+ "packages": ["clanker-skills"]
}
```
## Project Overrides
-Project settings (`.companion/settings.json`) override global settings. Nested objects are merged:
+Project settings (`.clanker/settings.json`) override global settings. Nested objects are merged:
```json
-// ~/.companion/agent/settings.json (global)
+// ~/.clanker/agent/settings.json (global)
{
"theme": "dark",
"compaction": { "enabled": true, "reserveTokens": 16384 }
}
-// .companion/settings.json (project)
+// .clanker/settings.json (project)
{
"compaction": { "reserveTokens": 8192 }
}
diff --git a/packages/coding-agent/docs/shell-aliases.md b/packages/coding-agent/docs/shell-aliases.md
index 3e014d4..c05e2dc 100644
--- a/packages/coding-agent/docs/shell-aliases.md
+++ b/packages/coding-agent/docs/shell-aliases.md
@@ -1,8 +1,8 @@
# Shell Aliases
-Companion runs bash in non-interactive mode (`bash -c`), which doesn't expand aliases by default.
+Clanker runs bash in non-interactive mode (`bash -c`), which doesn't expand aliases by default.
-To enable your shell aliases, add to `~/.companion/agent/settings.json`:
+To enable your shell aliases, add to `~/.clanker/agent/settings.json`:
```json
{
diff --git a/packages/coding-agent/docs/skills.md b/packages/coding-agent/docs/skills.md
index 0754c08..807efa6 100644
--- a/packages/coding-agent/docs/skills.md
+++ b/packages/coding-agent/docs/skills.md
@@ -1,10 +1,10 @@
-> companion can create skills. Ask it to build one for your use case.
+> clanker can create skills. Ask it to build one for your use case.
# Skills
Skills are self-contained capability packages that the agent loads on-demand. A skill provides specialized workflows, setup instructions, helper scripts, and reference documentation for specific tasks.
-Companion implements the [Agent Skills standard](https://agentskills.io/specification), warning about violations but remaining lenient.
+Clanker implements the [Agent Skills standard](https://agentskills.io/specification), warning about violations but remaining lenient.
## Table of Contents
@@ -21,15 +21,15 @@ Companion implements the [Agent Skills standard](https://agentskills.io/specific
> **Security:** Skills can instruct the model to perform any action and may include executable code the model invokes. Review skill content before use.
-Companion loads skills from:
+Clanker loads skills from:
- Global:
- - `~/.companion/agent/skills/`
+ - `~/.clanker/agent/skills/`
- `~/.agents/skills/`
- Project:
- - `.companion/skills/`
+ - `.clanker/skills/`
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
-- Packages: `skills/` directories or `companion.skills` entries in `package.json`
+- Packages: `skills/` directories or `clanker.skills` entries in `package.json`
- Settings: `skills` array with files or directories
- CLI: `--skill ` (repeatable, additive even with `--no-skills`)
@@ -50,7 +50,7 @@ To use skills from Claude Code or OpenAI Codex, add their directories to setting
}
```
-For project-level Claude Code skills, add to `.companion/settings.json`:
+For project-level Claude Code skills, add to `.clanker/settings.json`:
```json
{
@@ -60,7 +60,7 @@ For project-level Claude Code skills, add to `.companion/settings.json`:
## How Skills Work
-1. At startup, companion scans skill locations and extracts names and descriptions
+1. At startup, clanker scans skill locations and extracts names and descriptions
2. The system prompt includes available skills in XML format per the [specification](https://agentskills.io/integrate-skills)
3. When a task matches, the agent uses `read` to load the full SKILL.md (models don't always do this; use prompting or `/skill:name` to force it)
4. The agent follows the instructions, using relative paths to reference scripts and assets
@@ -174,7 +174,7 @@ description: Helps with PDFs.
## Validation
-Companion validates skills against the Agent Skills standard. Most issues produce warnings but still load the skill:
+Clanker validates skills against the Agent Skills standard. Most issues produce warnings but still load the skill:
- Name doesn't match parent directory
- Name exceeds 64 characters or contains invalid characters
@@ -229,4 +229,4 @@ cd /path/to/brave-search && npm install
## Skill Repositories
- [Anthropic Skills](https://github.com/anthropics/skills) - Document processing (docx, pdf, pptx, xlsx), web development
-- [Companion Skills](https://github.com/badlogic/companion-skills) - Web search, browser automation, Google APIs, transcription
+- [Clanker Skills](https://github.com/badlogic/clanker-skills) - Web search, browser automation, Google APIs, transcription
diff --git a/packages/coding-agent/docs/terminal-setup.md b/packages/coding-agent/docs/terminal-setup.md
index ccccdc5..7a9cf6f 100644
--- a/packages/coding-agent/docs/terminal-setup.md
+++ b/packages/coding-agent/docs/terminal-setup.md
@@ -1,6 +1,6 @@
# Terminal Setup
-Companion uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
+Clanker uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
## Kitty, iTerm2
@@ -66,6 +66,6 @@ If you already have an `actions` array, add the object to it.
The built-in terminal has limited escape sequence support. Shift+Enter cannot be distinguished from Enter in IntelliJ's terminal.
-If you want the hardware cursor visible, set `COMPANION_HARDWARE_CURSOR=1` before running companion (disabled by default for compatibility).
+If you want the hardware cursor visible, set `CLANKER_HARDWARE_CURSOR=1` before running clanker (disabled by default for compatibility).
Consider using a dedicated terminal emulator for the best experience.
diff --git a/packages/coding-agent/docs/termux.md b/packages/coding-agent/docs/termux.md
index a9b2515..6e96425 100644
--- a/packages/coding-agent/docs/termux.md
+++ b/packages/coding-agent/docs/termux.md
@@ -1,6 +1,6 @@
# Termux (Android) Setup
-Companion runs on Android via [Termux](https://termux.dev/), a terminal emulator and Linux environment for Android.
+Clanker runs on Android via [Termux](https://termux.dev/), a terminal emulator and Linux environment for Android.
## Prerequisites
@@ -16,14 +16,14 @@ pkg update && pkg upgrade
# Install dependencies
pkg install nodejs termux-api git
-# Install companion
-npm install -g @mariozechner/companion-coding-agent
+# Install clanker
+npm install -g @mariozechner/clanker-coding-agent
# Create config directory
-mkdir -p ~/.companion/agent
+mkdir -p ~/.clanker/agent
-# Run companion
-companion
+# Run clanker
+clanker
```
## Clipboard Support
@@ -34,7 +34,7 @@ Image clipboard is not supported on Termux (the `ctrl+v` image paste feature wil
## Example AGENTS.md for Termux
-Create `~/.companion/agent/AGENTS.md` to help the agent understand the Termux environment:
+Create `~/.clanker/agent/AGENTS.md` to help the agent understand the Termux environment:
````markdown
# Agent Environment: Termux on Android
diff --git a/packages/coding-agent/docs/themes.md b/packages/coding-agent/docs/themes.md
index 42c8c45..307fcbf 100644
--- a/packages/coding-agent/docs/themes.md
+++ b/packages/coding-agent/docs/themes.md
@@ -1,4 +1,4 @@
-> companion can create themes. Ask it to build one for your setup.
+> clanker can create themes. Ask it to build one for your setup.
# Themes
@@ -16,12 +16,12 @@ Themes are JSON files that define colors for the TUI.
## Locations
-Companion loads themes from:
+Clanker loads themes from:
- Built-in: `dark`, `light`
-- Global: `~/.companion/agent/themes/*.json`
-- Project: `.companion/themes/*.json`
-- Packages: `themes/` directories or `companion.themes` entries in `package.json`
+- Global: `~/.clanker/agent/themes/*.json`
+- Project: `.clanker/themes/*.json`
+- Packages: `themes/` directories or `clanker.themes` entries in `package.json`
- Settings: `themes` array with files or directories
- CLI: `--theme ` (repeatable)
@@ -37,22 +37,22 @@ Select a theme via `/settings` or in `settings.json`:
}
```
-On first run, companion detects your terminal background and defaults to `dark` or `light`.
+On first run, clanker detects your terminal background and defaults to `dark` or `light`.
## Creating a Custom Theme
1. Create a theme file:
```bash
-mkdir -p ~/.companion/agent/themes
-vim ~/.companion/agent/themes/my-theme.json
+mkdir -p ~/.clanker/agent/themes
+vim ~/.clanker/agent/themes/my-theme.json
```
2. Define the theme with all required colors (see [Color Tokens](#color-tokens)):
```json
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/badlogic/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "my-theme",
"vars": {
"primary": "#00aaff",
@@ -116,13 +116,13 @@ vim ~/.companion/agent/themes/my-theme.json
3. Select the theme via `/settings`.
-**Hot reload:** When you edit the currently active custom theme file, companion reloads it automatically for immediate visual feedback.
+**Hot reload:** When you edit the currently active custom theme file, clanker reloads it automatically for immediate visual feedback.
## Theme Format
```json
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/badlogic/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "my-theme",
"vars": {
"blue": "#0066cc",
@@ -268,7 +268,7 @@ Four formats are supported:
### Terminal Compatibility
-Companion uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, companion falls back to the nearest approximation.
+Clanker uses 24-bit RGB colors. Most modern terminals support this (iTerm2, Kitty, WezTerm, Windows Terminal, VS Code). For older terminals with only 256-color support, clanker falls back to the nearest approximation.
Check truecolor support:
diff --git a/packages/coding-agent/docs/tree.md b/packages/coding-agent/docs/tree.md
index 32d94a1..101490a 100644
--- a/packages/coding-agent/docs/tree.md
+++ b/packages/coding-agent/docs/tree.md
@@ -209,8 +209,8 @@ interface SessionTreeEvent {
### Example: Custom Summarizer
```typescript
-export default function (companion: HookAPI) {
- companion.on("session_before_tree", async (event, ctx) => {
+export default function (clanker: HookAPI) {
+ clanker.on("session_before_tree", async (event, ctx) => {
if (!event.preparation.userWantsSummary) return;
if (event.preparation.entriesToSummarize.length === 0) return;
diff --git a/packages/coding-agent/docs/tui.md b/packages/coding-agent/docs/tui.md
index 8669ac6..248ce81 100644
--- a/packages/coding-agent/docs/tui.md
+++ b/packages/coding-agent/docs/tui.md
@@ -1,10 +1,10 @@
-> companion can create TUI components. Ask it to build one for your use case.
+> clanker can create TUI components. Ask it to build one for your use case.
# TUI Components
Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
-**Source:** [`@mariozechner/companion-tui`](https://github.com/badlogic/companion-mono/tree/main/packages/tui)
+**Source:** [`@mariozechner/clanker-tui`](https://github.com/badlogic/clanker-agent/tree/main/packages/tui)
## Component Interface
@@ -37,7 +37,7 @@ import {
CURSOR_MARKER,
type Component,
type Focusable,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
class MyInput implements Component, Focusable {
focused: boolean = false; // Set by TUI when focus changes
@@ -66,7 +66,7 @@ This enables IME candidate windows to appear at the correct position for CJK inp
When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child. Otherwise, the hardware cursor won't be positioned correctly for IME input.
```typescript
-import { Container, type Focusable, Input } from "@mariozechner/companion-tui";
+import { Container, type Focusable, Input } from "@mariozechner/clanker-tui";
class SearchDialog extends Container implements Focusable {
private searchInput: Input;
@@ -96,18 +96,18 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
**In extensions** via `ctx.ui.custom()`:
```typescript
-companion.on("session_start", async (_event, ctx) => {
+clanker.on("session_start", async (_event, ctx) => {
const handle = ctx.ui.custom(myComponent);
// handle.requestRender() - trigger re-render
// handle.close() - restore normal UI
});
```
-**In custom tools** via `companion.ui.custom()`:
+**In custom tools** via `clanker.ui.custom()`:
```typescript
async execute(toolCallId, params, onUpdate, ctx, signal) {
- const handle = companion.ui.custom(myComponent);
+ const handle = clanker.ui.custom(myComponent);
// ...
handle.close();
}
@@ -191,10 +191,10 @@ See [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for compre
## Built-in Components
-Import from `@mariozechner/companion-tui`:
+Import from `@mariozechner/clanker-tui`:
```typescript
-import { Text, Box, Container, Spacer, Markdown } from "@mariozechner/companion-tui";
+import { Text, Box, Container, Spacer, Markdown } from "@mariozechner/clanker-tui";
```
### Text
@@ -276,7 +276,7 @@ const image = new Image(
Use `matchesKey()` for key detection:
```typescript
-import { matchesKey, Key } from "@mariozechner/companion-tui";
+import { matchesKey, Key } from "@mariozechner/clanker-tui";
handleInput(data: string) {
if (matchesKey(data, Key.up)) {
@@ -303,7 +303,7 @@ handleInput(data: string) {
**Critical:** Each line from `render()` must not exceed the `width` parameter.
```typescript
-import { visibleWidth, truncateToWidth } from "@mariozechner/companion-tui";
+import { visibleWidth, truncateToWidth } from "@mariozechner/clanker-tui";
render(width: number): string[] {
// Truncate long lines
@@ -327,7 +327,7 @@ import {
Key,
truncateToWidth,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
class MySelector {
private items: string[];
@@ -382,7 +382,7 @@ class MySelector {
Usage in an extension:
```typescript
-companion.registerCommand("pick", {
+clanker.registerCommand("pick", {
description: "Pick an item",
handler: async (args, ctx) => {
const items = ["Option A", "Option B", "Option C"];
@@ -444,8 +444,8 @@ renderResult(result, options, theme) {
**For Markdown**, use `getMarkdownTheme()`:
```typescript
-import { getMarkdownTheme } from "@mariozechner/companion-coding-agent";
-import { Markdown } from "@mariozechner/companion-tui";
+import { getMarkdownTheme } from "@mariozechner/clanker-coding-agent";
+import { Markdown } from "@mariozechner/clanker-tui";
renderResult(result, options, theme) {
const mdTheme = getMarkdownTheme();
@@ -464,10 +464,10 @@ interface MyTheme {
## Debug logging
-Set `COMPANION_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
+Set `CLANKER_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
```bash
-COMPANION_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
+CLANKER_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
```
## Performance
@@ -606,19 +606,19 @@ These patterns cover the most common UI needs in extensions. **Copy these patter
### Pattern 1: Selection Dialog (SelectList)
-For letting users pick from a list of options. Use `SelectList` from `@mariozechner/companion-tui` with `DynamicBorder` for framing.
+For letting users pick from a list of options. Use `SelectList` from `@mariozechner/clanker-tui` with `DynamicBorder` for framing.
```typescript
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
-import { DynamicBorder } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
+import { DynamicBorder } from "@mariozechner/clanker-coding-agent";
import {
Container,
type SelectItem,
SelectList,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
-companion.registerCommand("pick", {
+clanker.registerCommand("pick", {
handler: async (_args, ctx) => {
const items: SelectItem[] = [
{ value: "opt1", label: "Option 1", description: "First option" },
@@ -691,9 +691,9 @@ companion.registerCommand("pick", {
For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
```typescript
-import { BorderedLoader } from "@mariozechner/companion-coding-agent";
+import { BorderedLoader } from "@mariozechner/clanker-coding-agent";
-companion.registerCommand("fetch", {
+clanker.registerCommand("fetch", {
handler: async (_args, ctx) => {
const result = await ctx.ui.custom(
(tui, theme, _kb, done) => {
@@ -722,18 +722,18 @@ companion.registerCommand("fetch", {
### Pattern 3: Settings/Toggles (SettingsList)
-For toggling multiple settings. Use `SettingsList` from `@mariozechner/companion-tui` with `getSettingsListTheme()`.
+For toggling multiple settings. Use `SettingsList` from `@mariozechner/clanker-tui` with `getSettingsListTheme()`.
```typescript
-import { getSettingsListTheme } from "@mariozechner/companion-coding-agent";
+import { getSettingsListTheme } from "@mariozechner/clanker-coding-agent";
import {
Container,
type SettingItem,
SettingsList,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
-companion.registerCommand("settings", {
+clanker.registerCommand("settings", {
handler: async (_args, ctx) => {
const items: SettingItem[] = [
{
@@ -854,8 +854,8 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
```typescript
-import { CustomEditor, type ExtensionAPI } from "@mariozechner/companion-coding-agent";
-import { matchesKey, truncateToWidth } from "@mariozechner/companion-tui";
+import { CustomEditor, type ExtensionAPI } from "@mariozechner/clanker-coding-agent";
+import { matchesKey, truncateToWidth } from "@mariozechner/clanker-tui";
type Mode = "normal" | "insert";
@@ -917,8 +917,8 @@ class VimEditor extends CustomEditor {
}
}
-export default function (companion: ExtensionAPI) {
- companion.on("session_start", (_event, ctx) => {
+export default function (clanker: ExtensionAPI) {
+ clanker.on("session_start", (_event, ctx) => {
// Factory receives theme and keybindings from the app
ctx.ui.setEditorComponent(
(tui, theme, keybindings) => new VimEditor(theme, keybindings),
diff --git a/packages/coding-agent/docs/windows.md b/packages/coding-agent/docs/windows.md
index c205686..e89eb99 100644
--- a/packages/coding-agent/docs/windows.md
+++ b/packages/coding-agent/docs/windows.md
@@ -1,8 +1,8 @@
# Windows Setup
-Companion requires a bash shell on Windows. Checked locations (in order):
+Clanker requires a bash shell on Windows. Checked locations (in order):
-1. Custom path from `~/.companion/agent/settings.json`
+1. Custom path from `~/.clanker/agent/settings.json`
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
diff --git a/packages/coding-agent/package.json b/packages/coding-agent/package.json
index d5e072e..21b519f 100644
--- a/packages/coding-agent/package.json
+++ b/packages/coding-agent/package.json
@@ -1,14 +1,14 @@
{
- "name": "@mariozechner/companion-coding-agent",
+ "name": "@harivansh-afk/clanker-coding-agent",
"version": "0.56.2",
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
"type": "module",
- "companionConfig": {
- "name": "companion",
- "configDir": ".companion"
+ "clankerConfig": {
+ "name": "clanker",
+ "configDir": ".clanker"
},
"bin": {
- "companion": "dist/cli.js"
+ "clanker": "dist/cli.js"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -32,7 +32,7 @@
"clean": "shx rm -rf dist",
"dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
"build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets",
- "build:binary": "npm --prefix ../tui run build && npm --prefix ../ai run build && npm --prefix ../agent run build && npm run build && bun build --compile ./dist/cli.js --outfile dist/companion && npm run copy-binary-assets",
+ "build:binary": "npm --prefix ../tui run build && npm --prefix ../ai run build && npm --prefix ../agent run build && npm run build && bun build --compile ./dist/cli.js --outfile dist/clanker && npm run copy-binary-assets",
"copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/",
"copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/",
"test": "vitest --run",
@@ -40,9 +40,9 @@
},
"dependencies": {
"@mariozechner/jiti": "^2.6.2",
- "@mariozechner/companion-agent-core": "^0.56.2",
- "@mariozechner/companion-ai": "^0.56.2",
- "@mariozechner/companion-tui": "^0.56.2",
+ "@harivansh-afk/clanker-agent-core": "^0.56.2",
+ "@harivansh-afk/clanker-ai": "^0.56.2",
+ "@harivansh-afk/clanker-tui": "^0.56.2",
"@silvia-odwyer/photon-node": "^0.3.4",
"chalk": "^5.5.0",
"cli-highlight": "^2.1.11",
@@ -90,7 +90,7 @@
"license": "MIT",
"repository": {
"type": "git",
- "url": "git+https://github.com/getcompanion-ai/co-mono.git",
+ "url": "git+https://github.com/harivansh-afk/clanker-agent.git",
"directory": "packages/coding-agent"
},
"engines": {
diff --git a/packages/coding-agent/scripts/migrate-sessions.sh b/packages/coding-agent/scripts/migrate-sessions.sh
index 2bea56e..80ad4c8 100755
--- a/packages/coding-agent/scripts/migrate-sessions.sh
+++ b/packages/coding-agent/scripts/migrate-sessions.sh
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
#
-# Migrate sessions from ~/.companion/agent/*.jsonl to proper session directories.
+# Migrate sessions from ~/.clanker/agent/*.jsonl to proper session directories.
# This fixes sessions created by the bug in v0.30.0 where sessions were
-# saved to ~/.companion/agent/ instead of ~/.companion/agent/sessions//.
+# saved to ~/.clanker/agent/ instead of ~/.clanker/agent/sessions//.
#
# Usage: ./migrate-sessions.sh [--dry-run]
#
set -e
-AGENT_DIR="${COMPANION_AGENT_DIR:-$HOME/.companion/agent}"
+AGENT_DIR="${CLANKER_AGENT_DIR:-$HOME/.clanker/agent}"
DRY_RUN=false
if [[ "$1" == "--dry-run" ]]; then
diff --git a/packages/coding-agent/src/cli.ts b/packages/coding-agent/src/cli.ts
index a142591..7d4a4f7 100644
--- a/packages/coding-agent/src/cli.ts
+++ b/packages/coding-agent/src/cli.ts
@@ -5,10 +5,10 @@
*
* Test with: npx tsx src/cli-new.ts [args...]
*/
-process.title = "companion";
+process.title = "clanker";
-import { bedrockProviderModule } from "@mariozechner/companion-ai/bedrock-provider";
-import { setBedrockProviderModule } from "@mariozechner/companion-ai";
+import { bedrockProviderModule } from "@mariozechner/clanker-ai/bedrock-provider";
+import { setBedrockProviderModule } from "@mariozechner/clanker-ai";
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
import { main } from "./main.js";
diff --git a/packages/coding-agent/src/cli/args.ts b/packages/coding-agent/src/cli/args.ts
index f36aa6d..c9e3dc5 100644
--- a/packages/coding-agent/src/cli/args.ts
+++ b/packages/coding-agent/src/cli/args.ts
@@ -2,7 +2,7 @@
* CLI argument parsing and help display
*/
-import type { ThinkingLevel } from "@mariozechner/companion-agent-core";
+import type { ThinkingLevel } from "@mariozechner/clanker-agent-core";
import chalk from "chalk";
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config.js";
import {
@@ -245,7 +245,7 @@ ${chalk.bold("Options:")}
--export Export session file to HTML and exit
--list-models [search] List available models (with optional fuzzy search)
--verbose Force verbose startup (overrides quietStartup setting)
- --offline Disable startup network operations (same as COMPANION_OFFLINE=1)
+ --offline Disable startup network operations (same as CLANKER_OFFLINE=1)
--help, -h Show this help
--version, -v Show version number
@@ -324,11 +324,11 @@ ${chalk.bold("Environment Variables:")}
AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)
AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)
${ENV_AGENT_DIR.padEnd(32)} - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
- COMPANION_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
- COMPANION_AGENT_COMPUTER_COMMAND - Override the computer helper command (default: agent-computer)
- COMPANION_OFFLINE - Disable startup network operations when set to 1/true/yes
- COMPANION_SHARE_VIEWER_URL - Base URL for /share command (default: https://companion.dev/session/)
- COMPANION_AI_ANTIGRAVITY_VERSION - Override Antigravity User-Agent version (e.g., 1.23.0)
+ CLANKER_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
+ CLANKER_AGENT_COMPUTER_COMMAND - Override the computer helper command (default: agent-computer)
+ CLANKER_OFFLINE - Disable startup network operations when set to 1/true/yes
+ CLANKER_SHARE_VIEWER_URL - Base URL for /share command (default: https://clanker.dev/session/)
+ CLANKER_AI_ANTIGRAVITY_VERSION - Override Antigravity User-Agent version (e.g., 1.23.0)
${chalk.bold(`Available Tools (default: ${defaultToolsText}):`)}
read - Read file contents
diff --git a/packages/coding-agent/src/cli/config-selector.ts b/packages/coding-agent/src/cli/config-selector.ts
index 86d7c4e..acb5a25 100644
--- a/packages/coding-agent/src/cli/config-selector.ts
+++ b/packages/coding-agent/src/cli/config-selector.ts
@@ -1,8 +1,8 @@
/**
- * TUI config selector for `companion config` command
+ * TUI config selector for `clanker config` command
*/
-import { ProcessTerminal, TUI } from "@mariozechner/companion-tui";
+import { ProcessTerminal, TUI } from "@mariozechner/clanker-tui";
import type { ResolvedPaths } from "../core/package-manager.js";
import type { SettingsManager } from "../core/settings-manager.js";
import { ConfigSelectorComponent } from "../modes/interactive/components/config-selector.js";
diff --git a/packages/coding-agent/src/cli/file-processor.ts b/packages/coding-agent/src/cli/file-processor.ts
index 86fb933..046e687 100644
--- a/packages/coding-agent/src/cli/file-processor.ts
+++ b/packages/coding-agent/src/cli/file-processor.ts
@@ -3,7 +3,7 @@
*/
import { access, readFile, stat } from "node:fs/promises";
-import type { ImageContent } from "@mariozechner/companion-ai";
+import type { ImageContent } from "@mariozechner/clanker-ai";
import chalk from "chalk";
import { resolve } from "path";
import { resolveReadPath } from "../core/tools/path-utils.js";
diff --git a/packages/coding-agent/src/cli/list-models.ts b/packages/coding-agent/src/cli/list-models.ts
index 151fa37..55d79d1 100644
--- a/packages/coding-agent/src/cli/list-models.ts
+++ b/packages/coding-agent/src/cli/list-models.ts
@@ -2,8 +2,8 @@
* List available models with optional fuzzy search
*/
-import type { Api, Model } from "@mariozechner/companion-ai";
-import { fuzzyFilter } from "@mariozechner/companion-tui";
+import type { Api, Model } from "@mariozechner/clanker-ai";
+import { fuzzyFilter } from "@mariozechner/clanker-tui";
import type { ModelRegistry } from "../core/model-registry.js";
/**
diff --git a/packages/coding-agent/src/cli/session-picker.ts b/packages/coding-agent/src/cli/session-picker.ts
index 4b7839d..f14b6a1 100644
--- a/packages/coding-agent/src/cli/session-picker.ts
+++ b/packages/coding-agent/src/cli/session-picker.ts
@@ -2,7 +2,7 @@
* TUI session selector for --resume flag
*/
-import { ProcessTerminal, TUI } from "@mariozechner/companion-tui";
+import { ProcessTerminal, TUI } from "@mariozechner/clanker-tui";
import { KeybindingsManager } from "../core/keybindings.js";
import type {
SessionInfo,
diff --git a/packages/coding-agent/src/config.ts b/packages/coding-agent/src/config.ts
index fc58238..6d95423 100644
--- a/packages/coding-agent/src/config.ts
+++ b/packages/coding-agent/src/config.ts
@@ -73,7 +73,7 @@ export function getUpdateInstruction(packageName: string): string {
const method = detectInstallMethod();
switch (method) {
case "bun-binary":
- return `Download from: https://github.com/badlogic/companion-mono/releases/latest`;
+ return `Download from: https://github.com/badlogic/clanker-mono/releases/latest`;
case "pnpm":
return `Run: pnpm install -g ${packageName}`;
case "yarn":
@@ -99,7 +99,7 @@ export function getUpdateInstruction(packageName: string): string {
*/
export function getPackageDir(): string {
// Allow override via environment variable (useful for Nix/Guix where store paths tokenize poorly)
- const envDir = process.env.COMPANION_PACKAGE_DIR;
+ const envDir = process.env.CLANKER_PACKAGE_DIR;
if (envDir) {
if (envDir === "~") return homedir();
if (envDir.startsWith("~/")) return homedir() + envDir.slice(1);
@@ -174,32 +174,32 @@ export function getChangelogPath(): string {
}
// =============================================================================
-// App Config (from package.json companionConfig)
+// App Config (from package.json clankerConfig)
// =============================================================================
const pkg = JSON.parse(readFileSync(getPackageJsonPath(), "utf-8"));
-export const APP_NAME: string = pkg.companionConfig?.name || "companion";
+export const APP_NAME: string = pkg.clankerConfig?.name || "clanker";
export const CONFIG_DIR_NAME: string =
- pkg.companionConfig?.configDir || ".companion";
+ pkg.clankerConfig?.configDir || ".clanker";
export const VERSION: string = pkg.version;
-// e.g., COMPANION_CODING_AGENT_DIR or TAU_CODING_AGENT_DIR
+// e.g., CLANKER_CODING_AGENT_DIR or TAU_CODING_AGENT_DIR
export const ENV_AGENT_DIR = `${APP_NAME.toUpperCase()}_CODING_AGENT_DIR`;
-const DEFAULT_SHARE_VIEWER_URL = "https://companion.dev/session/";
+const DEFAULT_SHARE_VIEWER_URL = "https://clanker.dev/session/";
/** Get the share viewer URL for a gist ID */
export function getShareViewerUrl(gistId: string): string {
- const baseUrl = process.env.COMPANION_SHARE_VIEWER_URL || DEFAULT_SHARE_VIEWER_URL;
+ const baseUrl = process.env.CLANKER_SHARE_VIEWER_URL || DEFAULT_SHARE_VIEWER_URL;
return `${baseUrl}#${gistId}`;
}
// =============================================================================
-// User Config Paths (~/.companion/agent/*)
+// User Config Paths (~/.clanker/agent/*)
// =============================================================================
-/** Get the agent config directory (e.g., ~/.companion/agent/) */
+/** Get the agent config directory (e.g., ~/.clanker/agent/) */
export function getAgentDir(): string {
const envDir = process.env[ENV_AGENT_DIR];
if (envDir) {
diff --git a/packages/coding-agent/src/core/agent-session.ts b/packages/coding-agent/src/core/agent-session.ts
index b256b19..659b7a9 100644
--- a/packages/coding-agent/src/core/agent-session.ts
+++ b/packages/coding-agent/src/core/agent-session.ts
@@ -22,20 +22,20 @@ import type {
AgentState,
AgentTool,
ThinkingLevel,
-} from "@mariozechner/companion-agent-core";
+} from "@mariozechner/clanker-agent-core";
import type {
AssistantMessage,
ImageContent,
Message,
Model,
TextContent,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import {
isContextOverflow,
modelsAreEqual,
resetApiProviders,
supportsXhigh,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import { getDocsPath } from "../config.js";
import { theme } from "../modes/interactive/theme/theme.js";
import { stripFrontmatter } from "../utils/frontmatter.js";
@@ -1023,7 +1023,7 @@ export class AgentSession {
/**
* Send a prompt to the agent.
- * - Handles extension commands (registered via companion.registerCommand) immediately, even during streaming
+ * - Handles extension commands (registered via clanker.registerCommand) immediately, even during streaming
* - Expands file-based prompt templates by default
* - During streaming, queues via steer() or followUp() based on streamingBehavior option
* - Validates model and API key before sending (when not streaming)
@@ -1034,7 +1034,7 @@ export class AgentSession {
const expandPromptTemplates = options?.expandPromptTemplates ?? true;
// Handle extension commands first (execute immediately, even during streaming)
- // Extension commands manage their own LLM interaction via companion.sendMessage()
+ // Extension commands manage their own LLM interaction via clanker.sendMessage()
if (expandPromptTemplates && text.startsWith("/")) {
const handled = await this._tryExecuteExtensionCommand(text);
if (handled) {
diff --git a/packages/coding-agent/src/core/auth-storage.ts b/packages/coding-agent/src/core/auth-storage.ts
index 2de6ca7..76e17ea 100644
--- a/packages/coding-agent/src/core/auth-storage.ts
+++ b/packages/coding-agent/src/core/auth-storage.ts
@@ -2,7 +2,7 @@
* Credential storage for API keys and OAuth tokens.
* Handles loading, saving, and refreshing credentials from auth.json.
*
- * Uses file locking to prevent race conditions when multiple companion instances
+ * Uses file locking to prevent race conditions when multiple clanker instances
* try to refresh tokens simultaneously.
*/
@@ -11,12 +11,12 @@ import {
type OAuthCredentials,
type OAuthLoginCallbacks,
type OAuthProviderId,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import {
getOAuthApiKey,
getOAuthProvider,
getOAuthProviders,
-} from "@mariozechner/companion-ai/oauth";
+} from "@mariozechner/clanker-ai/oauth";
import {
chmodSync,
existsSync,
@@ -373,7 +373,7 @@ export class AuthStorage {
/**
* Refresh OAuth token with backend locking to prevent race conditions.
- * Multiple companion instances may try to refresh simultaneously when tokens expire.
+ * Multiple clanker instances may try to refresh simultaneously when tokens expire.
*/
private async refreshOAuthTokenWithLock(
providerId: OAuthProviderId,
diff --git a/packages/coding-agent/src/core/bash-executor.ts b/packages/coding-agent/src/core/bash-executor.ts
index 9e9a212..352d0c1 100644
--- a/packages/coding-agent/src/core/bash-executor.ts
+++ b/packages/coding-agent/src/core/bash-executor.ts
@@ -120,7 +120,7 @@ export function executeBash(
// Start writing to temp file if exceeds threshold
if (totalBytes > DEFAULT_MAX_BYTES && !tempFilePath) {
const id = randomBytes(8).toString("hex");
- tempFilePath = join(tmpdir(), `companion-bash-${id}.log`);
+ tempFilePath = join(tmpdir(), `clanker-bash-${id}.log`);
tempFileStream = createWriteStream(tempFilePath);
// Write already-buffered chunks to temp file
for (const chunk of outputChunks) {
@@ -223,7 +223,7 @@ export async function executeBashWithOperations(
// Start writing to temp file if exceeds threshold
if (totalBytes > DEFAULT_MAX_BYTES && !tempFilePath) {
const id = randomBytes(8).toString("hex");
- tempFilePath = join(tmpdir(), `companion-bash-${id}.log`);
+ tempFilePath = join(tmpdir(), `clanker-bash-${id}.log`);
tempFileStream = createWriteStream(tempFilePath);
for (const chunk of outputChunks) {
tempFileStream.write(chunk);
diff --git a/packages/coding-agent/src/core/compaction/branch-summarization.ts b/packages/coding-agent/src/core/compaction/branch-summarization.ts
index f0b1185..83416e9 100644
--- a/packages/coding-agent/src/core/compaction/branch-summarization.ts
+++ b/packages/coding-agent/src/core/compaction/branch-summarization.ts
@@ -5,9 +5,9 @@
* a summary of the branch being left so context isn't lost.
*/
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { Model } from "@mariozechner/companion-ai";
-import { completeSimple } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { Model } from "@mariozechner/clanker-ai";
+import { completeSimple } from "@mariozechner/clanker-ai";
import {
convertToLlm,
createBranchSummaryMessage,
@@ -206,7 +206,7 @@ export function prepareBranchEntries(
// First pass: collect file ops from ALL entries (even if they don't fit in token budget)
// This ensures we capture cumulative file tracking from nested branch summaries
- // Only extract from companion-generated summaries (fromHook !== true), not extension-generated ones
+ // Only extract from clanker-generated summaries (fromHook !== true), not extension-generated ones
for (const entry of entries) {
if (entry.type === "branch_summary" && !entry.fromHook && entry.details) {
const details = entry.details as BranchSummaryDetails;
diff --git a/packages/coding-agent/src/core/compaction/compaction.ts b/packages/coding-agent/src/core/compaction/compaction.ts
index eb7dbf4..c67d423 100644
--- a/packages/coding-agent/src/core/compaction/compaction.ts
+++ b/packages/coding-agent/src/core/compaction/compaction.ts
@@ -5,9 +5,9 @@
* and after compaction the session is reloaded.
*/
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { AssistantMessage, Model, Usage } from "@mariozechner/companion-ai";
-import { completeSimple } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { AssistantMessage, Model, Usage } from "@mariozechner/clanker-ai";
+import { completeSimple } from "@mariozechner/clanker-ai";
import {
convertToLlm,
createBranchSummaryMessage,
@@ -45,7 +45,7 @@ function extractFileOperations(
): FileOperations {
const fileOps = createFileOps();
- // Collect from previous compaction's details (if companion-generated)
+ // Collect from previous compaction's details (if clanker-generated)
if (prevCompactionIndex >= 0) {
const prevCompaction = entries[prevCompactionIndex] as CompactionEntry;
if (!prevCompaction.fromHook && prevCompaction.details) {
diff --git a/packages/coding-agent/src/core/compaction/utils.ts b/packages/coding-agent/src/core/compaction/utils.ts
index 5c5097f..0b0ca89 100644
--- a/packages/coding-agent/src/core/compaction/utils.ts
+++ b/packages/coding-agent/src/core/compaction/utils.ts
@@ -2,8 +2,8 @@
* Shared utilities for compaction and branch summarization.
*/
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { Message } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { Message } from "@mariozechner/clanker-ai";
// ============================================================================
// File Operation Tracking
diff --git a/packages/coding-agent/src/core/defaults.ts b/packages/coding-agent/src/core/defaults.ts
index 24617e4..31a7f84 100644
--- a/packages/coding-agent/src/core/defaults.ts
+++ b/packages/coding-agent/src/core/defaults.ts
@@ -1,3 +1,3 @@
-import type { ThinkingLevel } from "@mariozechner/companion-agent-core";
+import type { ThinkingLevel } from "@mariozechner/clanker-agent-core";
export const DEFAULT_THINKING_LEVEL: ThinkingLevel = "medium";
diff --git a/packages/coding-agent/src/core/export-html/index.ts b/packages/coding-agent/src/core/export-html/index.ts
index 4bc0071..62cd7ac 100644
--- a/packages/coding-agent/src/core/export-html/index.ts
+++ b/packages/coding-agent/src/core/export-html/index.ts
@@ -1,4 +1,4 @@
-import type { AgentState } from "@mariozechner/companion-agent-core";
+import type { AgentState } from "@mariozechner/clanker-agent-core";
import { existsSync, readFileSync, writeFileSync } from "fs";
import { basename, join } from "path";
import { APP_NAME, getExportTemplateDir } from "../../config.js";
diff --git a/packages/coding-agent/src/core/export-html/template.js b/packages/coding-agent/src/core/export-html/template.js
index e3c26ce..630669c 100644
--- a/packages/coding-agent/src/core/export-html/template.js
+++ b/packages/coding-agent/src/core/export-html/template.js
@@ -27,7 +27,7 @@
// Parse URL parameters for deep linking: leafId and targetId
// Check for injected params (when loaded in iframe via srcdoc) or use window.location
- const injectedParams = document.querySelector('meta[name="companion-url-params"]');
+ const injectedParams = document.querySelector('meta[name="clanker-url-params"]');
const searchString = injectedParams
? injectedParams.content
: window.location.search.substring(1);
@@ -1227,7 +1227,7 @@
function buildShareUrl(entryId) {
// Check for injected base URL (used when loaded in iframe via srcdoc)
const baseUrlMeta = document.querySelector(
- 'meta[name="companion-share-base-url"]',
+ 'meta[name="clanker-share-base-url"]',
);
const baseUrl = baseUrlMeta
? baseUrlMeta.content
diff --git a/packages/coding-agent/src/core/export-html/tool-renderer.ts b/packages/coding-agent/src/core/export-html/tool-renderer.ts
index a2ba13a..a126826 100644
--- a/packages/coding-agent/src/core/export-html/tool-renderer.ts
+++ b/packages/coding-agent/src/core/export-html/tool-renderer.ts
@@ -5,7 +5,7 @@
* and converting the ANSI output to HTML.
*/
-import type { ImageContent, TextContent } from "@mariozechner/companion-ai";
+import type { ImageContent, TextContent } from "@mariozechner/clanker-ai";
import type { Theme } from "../../modes/interactive/theme/theme.js";
import type { ToolDefinition } from "../extensions/types.js";
import { ansiLinesToHtml } from "./ansi-to-html.js";
diff --git a/packages/coding-agent/src/core/extensions/loader.ts b/packages/coding-agent/src/core/extensions/loader.ts
index ac69231..8eecb58 100644
--- a/packages/coding-agent/src/core/extensions/loader.ts
+++ b/packages/coding-agent/src/core/extensions/loader.ts
@@ -10,18 +10,18 @@ import * as os from "node:os";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { createJiti } from "@mariozechner/jiti";
-import * as _bundledPiAgentCore from "@mariozechner/companion-agent-core";
-import * as _bundledPiAi from "@mariozechner/companion-ai";
-import * as _bundledPiAiOauth from "@mariozechner/companion-ai/oauth";
-import type { KeyId } from "@mariozechner/companion-tui";
-import * as _bundledPiTui from "@mariozechner/companion-tui";
+import * as _bundledPiAgentCore from "@mariozechner/clanker-agent-core";
+import * as _bundledPiAi from "@mariozechner/clanker-ai";
+import * as _bundledPiAiOauth from "@mariozechner/clanker-ai/oauth";
+import type { KeyId } from "@mariozechner/clanker-tui";
+import * as _bundledPiTui from "@mariozechner/clanker-tui";
// Static imports of packages that extensions may use.
// These MUST be static so Bun bundles them into the compiled binary.
// The virtualModules option then makes them available to extensions.
import * as _bundledTypebox from "@sinclair/typebox";
import { getAgentDir, isBunBinary } from "../../config.js";
// NOTE: This import works because loader.ts exports are NOT re-exported from index.ts,
-// avoiding a circular dependency. Extensions can import from @mariozechner/companion-coding-agent.
+// avoiding a circular dependency. Extensions can import from @mariozechner/clanker-coding-agent.
import * as _bundledPiCodingAgent from "../../index.js";
import { createEventBus, type EventBus } from "../event-bus.js";
import type { ExecOptions } from "../exec.js";
@@ -41,11 +41,11 @@ import type {
/** Modules available to extensions via virtualModules (for compiled Bun binary) */
const VIRTUAL_MODULES: Record = {
"@sinclair/typebox": _bundledTypebox,
- "@mariozechner/companion-agent-core": _bundledPiAgentCore,
- "@mariozechner/companion-tui": _bundledPiTui,
- "@mariozechner/companion-ai": _bundledPiAi,
- "@mariozechner/companion-ai/oauth": _bundledPiAiOauth,
- "@mariozechner/companion-coding-agent": _bundledPiCodingAgent,
+ "@mariozechner/clanker-agent-core": _bundledPiAgentCore,
+ "@mariozechner/clanker-tui": _bundledPiTui,
+ "@mariozechner/clanker-ai": _bundledPiAi,
+ "@mariozechner/clanker-ai/oauth": _bundledPiAiOauth,
+ "@mariozechner/clanker-coding-agent": _bundledPiCodingAgent,
};
const require = createRequire(import.meta.url);
@@ -80,22 +80,22 @@ function getAliases(): Record {
};
_aliases = {
- "@mariozechner/companion-coding-agent": packageIndex,
- "@mariozechner/companion-agent-core": resolveWorkspaceOrImport(
+ "@mariozechner/clanker-coding-agent": packageIndex,
+ "@mariozechner/clanker-agent-core": resolveWorkspaceOrImport(
"agent/dist/index.js",
- "@mariozechner/companion-agent-core",
+ "@mariozechner/clanker-agent-core",
),
- "@mariozechner/companion-tui": resolveWorkspaceOrImport(
+ "@mariozechner/clanker-tui": resolveWorkspaceOrImport(
"tui/dist/index.js",
- "@mariozechner/companion-tui",
+ "@mariozechner/clanker-tui",
),
- "@mariozechner/companion-ai": resolveWorkspaceOrImport(
+ "@mariozechner/clanker-ai": resolveWorkspaceOrImport(
"ai/dist/index.js",
- "@mariozechner/companion-ai",
+ "@mariozechner/clanker-ai",
),
- "@mariozechner/companion-ai/oauth": resolveWorkspaceOrImport(
+ "@mariozechner/clanker-ai/oauth": resolveWorkspaceOrImport(
"ai/dist/oauth.js",
- "@mariozechner/companion-ai/oauth",
+ "@mariozechner/clanker-ai/oauth",
),
"@sinclair/typebox": typeboxRoot,
};
@@ -454,8 +454,8 @@ function readPiManifest(packageJsonPath: string): PiManifest | null {
try {
const content = fs.readFileSync(packageJsonPath, "utf-8");
const pkg = JSON.parse(content);
- if (pkg.companion && typeof pkg.companion === "object") {
- return pkg.companion as PiManifest;
+ if (pkg.clanker && typeof pkg.clanker === "object") {
+ return pkg.clanker as PiManifest;
}
return null;
} catch {
@@ -471,13 +471,13 @@ function isExtensionFile(name: string): boolean {
* Resolve extension entry points from a directory.
*
* Checks for:
- * 1. package.json with "companion.extensions" field -> returns declared paths
+ * 1. package.json with "clanker.extensions" field -> returns declared paths
* 2. index.ts or index.js -> returns the index file
*
* Returns resolved paths or null if no entry points found.
*/
function resolveExtensionEntries(dir: string): string[] | null {
- // Check for package.json with "companion" field first
+ // Check for package.json with "clanker" field first
const packageJsonPath = path.join(dir, "package.json");
if (fs.existsSync(packageJsonPath)) {
const manifest = readPiManifest(packageJsonPath);
@@ -514,7 +514,7 @@ function resolveExtensionEntries(dir: string): string[] | null {
* Discovery rules:
* 1. Direct files: `extensions/*.ts` or `*.js` → load
* 2. Subdirectory with index: `extensions/* /index.ts` or `index.js` → load
- * 3. Subdirectory with package.json: `extensions/* /package.json` with "companion" field → load what it declares
+ * 3. Subdirectory with package.json: `extensions/* /package.json` with "clanker" field → load what it declares
*
* No recursion beyond one level. Complex packages must use package.json manifest.
*/
@@ -577,8 +577,8 @@ export async function discoverAndLoadExtensions(
}
};
- // 1. Project-local extensions: cwd/.companion/extensions/
- const localExtDir = path.join(cwd, ".companion", "extensions");
+ // 1. Project-local extensions: cwd/.clanker/extensions/
+ const localExtDir = path.join(cwd, ".clanker", "extensions");
addPaths(discoverExtensionsInDir(localExtDir));
// 2. Global extensions: agentDir/extensions/
@@ -589,7 +589,7 @@ export async function discoverAndLoadExtensions(
for (const p of configuredPaths) {
const resolved = resolvePath(p, cwd);
if (fs.existsSync(resolved) && fs.statSync(resolved).isDirectory()) {
- // Check for package.json with companion manifest or index.ts
+ // Check for package.json with clanker manifest or index.ts
const entries = resolveExtensionEntries(resolved);
if (entries) {
addPaths(entries);
diff --git a/packages/coding-agent/src/core/extensions/runner.ts b/packages/coding-agent/src/core/extensions/runner.ts
index 1d6c549..95d8dd4 100644
--- a/packages/coding-agent/src/core/extensions/runner.ts
+++ b/packages/coding-agent/src/core/extensions/runner.ts
@@ -2,9 +2,9 @@
* Extension runner - executes extensions and manages their lifecycle.
*/
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { ImageContent, Model } from "@mariozechner/companion-ai";
-import type { KeyId } from "@mariozechner/companion-tui";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { ImageContent, Model } from "@mariozechner/clanker-ai";
+import type { KeyId } from "@mariozechner/clanker-tui";
import { type Theme, theme } from "../../modes/interactive/theme/theme.js";
import type { ResourceDiagnostic } from "../diagnostics.js";
import type { KeyAction, KeybindingsConfig } from "../keybindings.js";
diff --git a/packages/coding-agent/src/core/extensions/types.ts b/packages/coding-agent/src/core/extensions/types.ts
index f72e6c9..3b818f7 100644
--- a/packages/coding-agent/src/core/extensions/types.ts
+++ b/packages/coding-agent/src/core/extensions/types.ts
@@ -13,7 +13,7 @@ import type {
AgentToolResult,
AgentToolUpdateCallback,
ThinkingLevel,
-} from "@mariozechner/companion-agent-core";
+} from "@mariozechner/clanker-agent-core";
import type {
Api,
AssistantMessageEvent,
@@ -26,7 +26,7 @@ import type {
SimpleStreamOptions,
TextContent,
ToolResultMessage,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import type {
AutocompleteItem,
Component,
@@ -36,7 +36,7 @@ import type {
OverlayHandle,
OverlayOptions,
TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { Static, TSchema } from "@sinclair/typebox";
import type { Theme } from "../../modes/interactive/theme/theme.js";
import type { BashResult } from "../bash-executor.js";
@@ -223,12 +223,12 @@ export interface ExtensionUIContext {
* - `keybindings`: KeybindingsManager for app-level keybindings
*
* For full app keybinding support (escape, ctrl+d, model switching, etc.),
- * extend `CustomEditor` from `@mariozechner/companion-coding-agent` and call
+ * extend `CustomEditor` from `@mariozechner/clanker-coding-agent` and call
* `super.handleInput(data)` for keys you don't handle.
*
* @example
* ```ts
- * import { CustomEditor } from "@mariozechner/companion-coding-agent";
+ * import { CustomEditor } from "@mariozechner/clanker-coding-agent";
*
* class VimEditor extends CustomEditor {
* private mode: "normal" | "insert" = "insert";
@@ -316,7 +316,7 @@ export interface ExtensionContext {
abort(): void;
/** Whether there are queued messages waiting */
hasPendingMessages(): boolean;
- /** Gracefully shutdown companion and exit. Available in all contexts. */
+ /** Gracefully shutdown clanker and exit. Available in all contexts. */
shutdown(): void;
/** Get current context usage for the active model. */
getContextUsage(): ContextUsage | undefined;
@@ -1251,7 +1251,7 @@ export interface ExtensionAPI {
*
* @example
* // Register a new provider with custom models
- * companion.registerProvider("my-proxy", {
+ * clanker.registerProvider("my-proxy", {
* baseUrl: "https://proxy.example.com",
* apiKey: "PROXY_API_KEY",
* api: "anthropic-messages",
@@ -1270,13 +1270,13 @@ export interface ExtensionAPI {
*
* @example
* // Override baseUrl for an existing provider
- * companion.registerProvider("anthropic", {
+ * clanker.registerProvider("anthropic", {
* baseUrl: "https://proxy.example.com"
* });
*
* @example
* // Register provider with OAuth support
- * companion.registerProvider("corporate-ai", {
+ * clanker.registerProvider("corporate-ai", {
* baseUrl: "https://ai.corp.com",
* api: "openai-responses",
* models: [...],
@@ -1301,7 +1301,7 @@ export interface ExtensionAPI {
* the initial load phase.
*
* @example
- * companion.unregisterProvider("my-proxy");
+ * clanker.unregisterProvider("my-proxy");
*/
unregisterProvider(name: string): void;
@@ -1313,7 +1313,7 @@ export interface ExtensionAPI {
// Provider Registration Types
// ============================================================================
-/** Configuration for registering a provider via companion.registerProvider(). */
+/** Configuration for registering a provider via clanker.registerProvider(). */
export interface ProviderConfig {
/** Base URL for the API endpoint. Required when defining models. */
baseUrl?: string;
@@ -1381,7 +1381,7 @@ export interface ProviderModelConfig {
}
/** Extension factory function type. Supports both sync and async initialization. */
-export type ExtensionFactory = (companion: ExtensionAPI) => void | Promise;
+export type ExtensionFactory = (clanker: ExtensionAPI) => void | Promise;
// ============================================================================
// Loaded Extension Types
@@ -1480,7 +1480,7 @@ export interface ExtensionRuntimeState {
}
/**
- * Action implementations for companion.* API methods.
+ * Action implementations for clanker.* API methods.
* Provided to runner.initialize(), copied into the shared runtime.
*/
export interface ExtensionActions {
diff --git a/packages/coding-agent/src/core/extensions/wrapper.ts b/packages/coding-agent/src/core/extensions/wrapper.ts
index 2d535e1..2620126 100644
--- a/packages/coding-agent/src/core/extensions/wrapper.ts
+++ b/packages/coding-agent/src/core/extensions/wrapper.ts
@@ -5,7 +5,7 @@
import type {
AgentTool,
AgentToolUpdateCallback,
-} from "@mariozechner/companion-agent-core";
+} from "@mariozechner/clanker-agent-core";
import type { ExtensionRunner } from "./runner.js";
import type { RegisteredTool, ToolCallEventResult } from "./types.js";
diff --git a/packages/coding-agent/src/core/gateway/durable-chat-run.ts b/packages/coding-agent/src/core/gateway/durable-chat-run.ts
index 16568cd..4b1fde3 100644
--- a/packages/coding-agent/src/core/gateway/durable-chat-run.ts
+++ b/packages/coding-agent/src/core/gateway/durable-chat-run.ts
@@ -1,4 +1,4 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import type { AgentSessionEvent } from "../agent-session.js";
import { extractMessageText } from "./helpers.js";
import { messageContentToHistoryParts } from "./session-state.js";
diff --git a/packages/coding-agent/src/core/gateway/internal-types.ts b/packages/coding-agent/src/core/gateway/internal-types.ts
index 2bbb086..34f7656 100644
--- a/packages/coding-agent/src/core/gateway/internal-types.ts
+++ b/packages/coding-agent/src/core/gateway/internal-types.ts
@@ -1,4 +1,4 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import type { AgentSession } from "../agent-session.js";
import type { DurableChatRunReporter } from "./durable-chat-run.js";
import type {
diff --git a/packages/coding-agent/src/core/gateway/runtime.ts b/packages/coding-agent/src/core/gateway/runtime.ts
index 586979a..d5c6b3e 100644
--- a/packages/coding-agent/src/core/gateway/runtime.ts
+++ b/packages/coding-agent/src/core/gateway/runtime.ts
@@ -7,7 +7,7 @@ import {
import { rm } from "node:fs/promises";
import { join } from "node:path";
import { URL } from "node:url";
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import type { AgentSession, AgentSessionEvent } from "../agent-session.js";
import type { Settings } from "../settings-manager.js";
import { DurableChatRunReporter } from "./durable-chat-run.js";
@@ -66,7 +66,7 @@ const SSE_HEARTBEAT_MS = 15_000;
type JsonRecord = Record;
type AssistantAgentMessage = Extract;
-type CompanionChannelsSettings = JsonRecord & {
+type ClankerChannelsSettings = JsonRecord & {
adapters?: Record;
bridge?: JsonRecord;
slack?: JsonRecord;
@@ -1264,7 +1264,7 @@ export class GatewayRuntime {
path.slice(this.config.webhook.basePath.length).replace(/^\/+/, "") ||
"default";
if (this.config.webhook.secret) {
- const presentedSecret = request.headers["x-companion-webhook-secret"];
+ const presentedSecret = request.headers["x-clanker-webhook-secret"];
if (presentedSecret !== this.config.webhook.secret) {
this.writeJson(response, 401, { error: "Invalid webhook secret" });
return;
@@ -1502,7 +1502,7 @@ export class GatewayRuntime {
}
// ---------------------------------------------------------------------------
- // New handler methods added for companion-cloud web app integration
+ // New handler methods added for clanker-cloud web app integration
// ---------------------------------------------------------------------------
private async handleGetModels(): Promise<{
@@ -1636,7 +1636,7 @@ export class GatewayRuntime {
this.primarySession.settingsManager.applyOverrides(patch as Settings);
}
- private getCompanionChannelsSettings(): CompanionChannelsSettings {
+ private getClankerChannelsSettings(): ClankerChannelsSettings {
const globalSettings =
this.primarySession.settingsManager.getGlobalSettings();
const projectSettings =
@@ -1645,14 +1645,14 @@ export class GatewayRuntime {
isRecord(globalSettings) ? globalSettings : {},
isRecord(projectSettings) ? projectSettings : {},
);
- const piChannels = mergedSettings["companion-channels"];
+ const piChannels = mergedSettings["clanker-channels"];
return isRecord(piChannels)
- ? (piChannels as CompanionChannelsSettings)
+ ? (piChannels as ClankerChannelsSettings)
: {};
}
private buildSlackChannelStatus(
- config: CompanionChannelsSettings,
+ config: ClankerChannelsSettings,
bridgeEnabled: boolean,
): ChannelStatus {
const adapters = isRecord(config.adapters) ? config.adapters : {};
@@ -1671,13 +1671,13 @@ export class GatewayRuntime {
if (hasConfig) {
if (!adapter) {
error =
- 'Slack requires `companion-channels.adapters.slack = { "type": "slack" }`.';
+ 'Slack requires `clanker-channels.adapters.slack = { "type": "slack" }`.';
} else if (adapterType !== "slack") {
error = 'Slack adapter type must be "slack".';
} else if (!appToken) {
- error = "Slack requires companion-channels.slack.appToken.";
+ error = "Slack requires clanker-channels.slack.appToken.";
} else if (!botToken) {
- error = "Slack requires companion-channels.slack.botToken.";
+ error = "Slack requires clanker-channels.slack.botToken.";
} else {
configured = true;
}
@@ -1685,7 +1685,7 @@ export class GatewayRuntime {
if (configured && !bridgeEnabled) {
error =
- "Slack is configured, but companion-channels.bridge.enabled is false, so messages will not reach the agent.";
+ "Slack is configured, but clanker-channels.bridge.enabled is false, so messages will not reach the agent.";
}
return {
@@ -1699,7 +1699,7 @@ export class GatewayRuntime {
}
private buildTelegramChannelStatus(
- config: CompanionChannelsSettings,
+ config: ClankerChannelsSettings,
bridgeEnabled: boolean,
): ChannelStatus {
const adapters = isRecord(config.adapters) ? config.adapters : {};
@@ -1716,15 +1716,15 @@ export class GatewayRuntime {
if (hasConfig) {
if (!adapter) {
error =
- 'Telegram requires `companion-channels.adapters.telegram = { "type": "telegram", "botToken": "...", "polling": true }`.';
+ 'Telegram requires `clanker-channels.adapters.telegram = { "type": "telegram", "botToken": "...", "polling": true }`.';
} else if (adapterType !== "telegram") {
error = 'Telegram adapter type must be "telegram".';
} else if (!botToken) {
error =
- "Telegram requires companion-channels.adapters.telegram.botToken.";
+ "Telegram requires clanker-channels.adapters.telegram.botToken.";
} else if (!pollingEnabled) {
error =
- "Telegram requires companion-channels.adapters.telegram.polling = true.";
+ "Telegram requires clanker-channels.adapters.telegram.polling = true.";
} else {
configured = true;
}
@@ -1732,7 +1732,7 @@ export class GatewayRuntime {
if (configured && !bridgeEnabled) {
error =
- "Telegram is configured, but companion-channels.bridge.enabled is false, so messages will not reach the agent.";
+ "Telegram is configured, but clanker-channels.bridge.enabled is false, so messages will not reach the agent.";
}
return {
@@ -1746,7 +1746,7 @@ export class GatewayRuntime {
}
private handleGetChannelsStatus(): ChannelStatus[] {
- const config = this.getCompanionChannelsSettings();
+ const config = this.getClankerChannelsSettings();
const bridgeEnabled = config.bridge?.enabled === true;
return [
diff --git a/packages/coding-agent/src/core/gateway/session-state.ts b/packages/coding-agent/src/core/gateway/session-state.ts
index 80e1b20..be50096 100644
--- a/packages/coding-agent/src/core/gateway/session-state.ts
+++ b/packages/coding-agent/src/core/gateway/session-state.ts
@@ -1,4 +1,4 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import type { HistoryMessage, HistoryPart } from "./types.js";
export interface GatewayTransientToolResult {
diff --git a/packages/coding-agent/src/core/gateway/types.ts b/packages/coding-agent/src/core/gateway/types.ts
index 2311a43..e367722 100644
--- a/packages/coding-agent/src/core/gateway/types.ts
+++ b/packages/coding-agent/src/core/gateway/types.ts
@@ -1,4 +1,4 @@
-import type { ImageContent } from "@mariozechner/companion-ai";
+import type { ImageContent } from "@mariozechner/clanker-ai";
import type { AgentSession } from "../agent-session.js";
export interface GatewayConfig {
diff --git a/packages/coding-agent/src/core/keybindings.ts b/packages/coding-agent/src/core/keybindings.ts
index ce2f57a..d61275b 100644
--- a/packages/coding-agent/src/core/keybindings.ts
+++ b/packages/coding-agent/src/core/keybindings.ts
@@ -6,7 +6,7 @@ import {
type KeyId,
matchesKey,
setEditorKeybindings,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { existsSync, readFileSync } from "fs";
import { join } from "path";
import { getAgentDir } from "../config.js";
diff --git a/packages/coding-agent/src/core/memory/runtime-memory.ts b/packages/coding-agent/src/core/memory/runtime-memory.ts
index 377efab..7b92d21 100644
--- a/packages/coding-agent/src/core/memory/runtime-memory.ts
+++ b/packages/coding-agent/src/core/memory/runtime-memory.ts
@@ -9,32 +9,32 @@ import {
import { createRequire } from "node:module";
import { homedir } from "node:os";
import { basename, join, resolve } from "node:path";
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import {
completeSimple,
type Model,
type TextContent,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import { parseFrontmatter } from "../../utils/frontmatter.js";
import type { SettingsManager } from "../settings-manager.js";
import type { ReadonlySessionManager } from "../session-manager.js";
-const DEFAULT_STORAGE_DIR = join(homedir(), ".companion", "memory");
+const DEFAULT_STORAGE_DIR = join(homedir(), ".clanker", "memory");
const MAX_EPISODE_CHARS = 4_000;
const MAX_EPISODES = 5_000;
const DEFAULT_CORE_TOKEN_BUDGET = 700;
const DEFAULT_RECALL_RESULTS = 4;
const DEFAULT_WRITER_MAX_TOKENS = 600;
-const CUSTOM_MEMORY_TYPE = "companion_memory";
+const CUSTOM_MEMORY_TYPE = "clanker_memory";
const require = createRequire(import.meta.url);
-const MEMORY_WRITER_SYSTEM_PROMPT = `You manage long-term conversational memory for a companion agent.
+const MEMORY_WRITER_SYSTEM_PROMPT = `You manage long-term conversational memory for a clanker agent.
Decide which facts from the latest exchange should be persisted for future chats.
Rules:
- Save only information grounded in the user or assistant messages.
-- Prefer durable facts, explicit remember requests, stable preferences, relationship context, and secrets/keys/codes the user will expect the companion to recall later.
+- Prefer durable facts, explicit remember requests, stable preferences, relationship context, and secrets/keys/codes the user will expect the clanker to recall later.
- Use bucket "core" only for stable profile, preference, or relationship memory.
- Use bucket "archival" for facts and secrets that should be searchable later.
- Never invent details or infer beyond the exchange.
@@ -52,7 +52,7 @@ export type RuntimeMemoryKind =
| "secret";
export type RuntimeMemorySource = "auto" | "manual" | "legacy-import";
-export interface CompanionMemorySettings {
+export interface ClankerMemorySettings {
enabled?: boolean;
storageDir?: string;
maxCoreTokens?: number;
@@ -65,7 +65,7 @@ export interface CompanionMemorySettings {
export interface RuntimeMemoryIdentity {
key: string;
- scope: "agent" | "companion" | "sandbox" | "unknown";
+ scope: "agent" | "clanker" | "sandbox" | "unknown";
}
export interface RuntimeMemoryStatus {
@@ -229,15 +229,15 @@ function expandHomePath(value: string): string {
return join(homedir(), value.slice(1));
}
-function getCompanionMemorySettings(
+function getClankerMemorySettings(
settingsManager: SettingsManager,
-): Required & {
+): Required & {
writer: { enabled: boolean; maxTokens: number };
} {
const globalSettings = asRecord(settingsManager.getGlobalSettings()) ?? {};
const projectSettings = asRecord(settingsManager.getProjectSettings()) ?? {};
- const globalMemory = asRecord(globalSettings.companionMemory) ?? {};
- const projectMemory = asRecord(projectSettings.companionMemory) ?? {};
+ const globalMemory = asRecord(globalSettings.clankerMemory) ?? {};
+ const projectMemory = asRecord(projectSettings.clankerMemory) ?? {};
const enabled =
typeof projectMemory.enabled === "boolean"
@@ -327,7 +327,7 @@ function buildDbFileName(identity: RuntimeMemoryIdentity): string {
}
function parseAgentIdFromSessionKey(value: string): string | null {
- const match = value.match(/^agent:([^:]+):companion:[^:]+$/);
+ const match = value.match(/^agent:([^:]+):clanker:[^:]+$/);
return match?.[1] ?? null;
}
@@ -335,7 +335,7 @@ function parseAgentIdFromSanitizedSessionKey(value: string): string | null {
if (!value.startsWith("agent_")) {
return null;
}
- const marker = "_companion_";
+ const marker = "_clanker_";
const markerIndex = value.lastIndexOf(marker);
if (markerIndex <= "agent_".length) {
return null;
@@ -362,10 +362,10 @@ function resolveIdentity(params: {
return { key: `agent:${directAgentId}`, scope: "agent" };
}
- const companion = asRecord(settings.companion);
- const explicitCompanionId = asString(companion?.id);
- if (explicitCompanionId) {
- return { key: `companion:${explicitCompanionId}`, scope: "companion" };
+ const clanker = asRecord(settings.clanker);
+ const explicitClankerId = asString(clanker?.id);
+ if (explicitClankerId) {
+ return { key: `clanker:${explicitClankerId}`, scope: "clanker" };
}
const sandboxHandle = asString(settings.sandboxHandle);
@@ -570,7 +570,7 @@ function guessLegacyKind(filePath: string, body: string): RuntimeMemoryKind {
export class RuntimeMemoryManager {
private readonly sessionManager: ReadonlySessionManager;
private readonly settingsManager: SettingsManager;
- private readonly settings: Required & {
+ private readonly settings: Required & {
writer: { enabled: boolean; maxTokens: number };
};
private readonly identity: RuntimeMemoryIdentity | null;
@@ -583,7 +583,7 @@ export class RuntimeMemoryManager {
}) {
this.sessionManager = params.sessionManager;
this.settingsManager = params.settingsManager;
- this.settings = getCompanionMemorySettings(params.settingsManager);
+ this.settings = getClankerMemorySettings(params.settingsManager);
this.identity = this.settings.enabled ? resolveIdentity(params) : null;
if (!this.settings.enabled || !this.identity) {
@@ -1487,9 +1487,9 @@ function resolveLegacyProjectDir(
cwd: string,
): string | null {
const settings = asRecord(settingsManager.getGlobalSettings()) ?? {};
- const legacySettings = asRecord(settings["companion-memory-md"]) ?? {};
+ const legacySettings = asRecord(settings["clanker-memory-md"]) ?? {};
const configuredRoot =
- asString(legacySettings.localPath) ?? join(homedir(), ".companion", "memory-md");
+ asString(legacySettings.localPath) ?? join(homedir(), ".clanker", "memory-md");
const legacyRoot = expandHomePath(configuredRoot);
const legacyProjectDir = join(legacyRoot, basename(cwd));
if (existsSync(legacyProjectDir)) {
@@ -1511,7 +1511,7 @@ function renderMemoryBlock(
const coreIds = new Set(coreMemories.map((memory) => memory.id));
if (coreMemories.length > 0) {
- lines.push("Companion Memory");
+ lines.push("Clanker Memory");
lines.push("");
lines.push("Core memory:");
for (const memory of coreMemories) {
@@ -1528,7 +1528,7 @@ function renderMemoryBlock(
if (memoryResults.length > 0) {
if (lines.length === 0) {
- lines.push("Companion Memory");
+ lines.push("Clanker Memory");
lines.push("");
} else {
lines.push("");
@@ -1541,7 +1541,7 @@ function renderMemoryBlock(
if (episodeResults.length > 0) {
if (lines.length === 0) {
- lines.push("Companion Memory");
+ lines.push("Clanker Memory");
lines.push("");
} else {
lines.push("");
diff --git a/packages/coding-agent/src/core/messages.ts b/packages/coding-agent/src/core/messages.ts
index 314d269..66be3a9 100644
--- a/packages/coding-agent/src/core/messages.ts
+++ b/packages/coding-agent/src/core/messages.ts
@@ -5,8 +5,8 @@
* and provides a transformer to convert them to LLM-compatible messages.
*/
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { ImageContent, Message, TextContent } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { ImageContent, Message, TextContent } from "@mariozechner/clanker-ai";
export const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:
@@ -67,7 +67,7 @@ export interface CompactionSummaryMessage {
}
// Extend CustomAgentMessages via declaration merging
-declare module "@mariozechner/companion-agent-core" {
+declare module "@mariozechner/clanker-agent-core" {
interface CustomAgentMessages {
bashExecution: BashExecutionMessage;
custom: CustomMessage;
diff --git a/packages/coding-agent/src/core/model-registry.ts b/packages/coding-agent/src/core/model-registry.ts
index 4b09062..139eb57 100644
--- a/packages/coding-agent/src/core/model-registry.ts
+++ b/packages/coding-agent/src/core/model-registry.ts
@@ -16,11 +16,11 @@ import {
registerApiProvider,
resetApiProviders,
type SimpleStreamOptions,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import {
registerOAuthProvider,
resetOAuthProviders,
-} from "@mariozechner/companion-ai/oauth";
+} from "@mariozechner/clanker-ai/oauth";
import { type Static, Type } from "@sinclair/typebox";
import AjvModule from "ajv";
import { existsSync, readFileSync } from "fs";
diff --git a/packages/coding-agent/src/core/model-resolver.ts b/packages/coding-agent/src/core/model-resolver.ts
index e50cb58..c6f6757 100644
--- a/packages/coding-agent/src/core/model-resolver.ts
+++ b/packages/coding-agent/src/core/model-resolver.ts
@@ -2,13 +2,13 @@
* Model resolution, scoping, and initial selection
*/
-import type { ThinkingLevel } from "@mariozechner/companion-agent-core";
+import type { ThinkingLevel } from "@mariozechner/clanker-agent-core";
import {
type Api,
type KnownProvider,
type Model,
modelsAreEqual,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import chalk from "chalk";
import { minimatch } from "minimatch";
import { isValidThinkingLevel } from "../cli/args.js";
diff --git a/packages/coding-agent/src/core/package-manager.ts b/packages/coding-agent/src/core/package-manager.ts
index 36acb6c..87de9cd 100644
--- a/packages/coding-agent/src/core/package-manager.ts
+++ b/packages/coding-agent/src/core/package-manager.ts
@@ -20,7 +20,7 @@ import type { PackageSource, SettingsManager } from "./settings-manager.js";
const NETWORK_TIMEOUT_MS = 10000;
function isOfflineModeEnabled(): boolean {
- const value = process.env.COMPANION_OFFLINE;
+ const value = process.env.CLANKER_OFFLINE;
if (!value) return false;
return (
value === "1" ||
@@ -445,8 +445,8 @@ function collectAutoThemeEntries(dir: string): string[] {
function readPiManifestFile(packageJsonPath: string): PiManifest | null {
try {
const content = readFileSync(packageJsonPath, "utf-8");
- const pkg = JSON.parse(content) as { companion?: PiManifest };
- return pkg.companion ?? null;
+ const pkg = JSON.parse(content) as { clanker?: PiManifest };
+ return pkg.clanker ?? null;
} catch {
return null;
}
@@ -1529,7 +1529,7 @@ export class DefaultPackageManager implements PackageManager {
this.ensureGitIgnore(installRoot);
const packageJsonPath = join(installRoot, "package.json");
if (!existsSync(packageJsonPath)) {
- const pkgJson = { name: "companion-extensions", private: true };
+ const pkgJson = { name: "clanker-extensions", private: true };
writeFileSync(packageJsonPath, JSON.stringify(pkgJson, null, 2), "utf-8");
}
}
@@ -1595,7 +1595,7 @@ export class DefaultPackageManager implements PackageManager {
.update(`${prefix}-${suffix ?? ""}`)
.digest("hex")
.slice(0, 8);
- return join(tmpdir(), "companion-extensions", prefix, hash, suffix ?? "");
+ return join(tmpdir(), "clanker-extensions", prefix, hash, suffix ?? "");
}
private getBaseDirForScope(scope: SourceScope): string {
@@ -1784,8 +1784,8 @@ export class DefaultPackageManager implements PackageManager {
try {
const content = readFileSync(packageJsonPath, "utf-8");
- const pkg = JSON.parse(content) as { companion?: PiManifest };
- return pkg.companion ?? null;
+ const pkg = JSON.parse(content) as { clanker?: PiManifest };
+ return pkg.clanker ?? null;
} catch {
return null;
}
diff --git a/packages/coding-agent/src/core/resource-loader.ts b/packages/coding-agent/src/core/resource-loader.ts
index ac2680f..79b587d 100644
--- a/packages/coding-agent/src/core/resource-loader.ts
+++ b/packages/coding-agent/src/core/resource-loader.ts
@@ -120,7 +120,7 @@ function loadNamedContextFileFromDir(
}
}
-const companionContextFilenames = [
+const clankerContextFilenames = [
"IDENTITY.md",
"SOUL.md",
"USER.md",
@@ -154,7 +154,7 @@ function addContextFile(
seenPaths.add(file.path);
}
-function collectCompanionContextDirs(cwd: string, agentDir: string): string[] {
+function collectClankerContextDirs(cwd: string, agentDir: string): string[] {
const contextDirs: string[] = [];
const seenDirs = new Set();
const configDir = dirname(resolve(agentDir));
@@ -232,13 +232,13 @@ function loadProjectContextFiles(
loadNamedContextFileFromDir(resolvedAgentDir, "SOUL.md"),
);
- for (const companionDir of collectCompanionContextDirs(
+ for (const clankerDir of collectClankerContextDirs(
resolvedCwd,
resolvedAgentDir,
)) {
for (const file of loadNamedContextFilesFromDir(
- companionDir,
- companionContextFilenames,
+ clankerDir,
+ clankerContextFilenames,
)) {
addContextFile(contextFiles, seenPaths, file);
}
diff --git a/packages/coding-agent/src/core/sdk.ts b/packages/coding-agent/src/core/sdk.ts
index 054fceb..0e5e836 100644
--- a/packages/coding-agent/src/core/sdk.ts
+++ b/packages/coding-agent/src/core/sdk.ts
@@ -3,8 +3,8 @@ import {
Agent,
type AgentMessage,
type ThinkingLevel,
-} from "@mariozechner/companion-agent-core";
-import type { Message, Model } from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-agent-core";
+import type { Message, Model } from "@mariozechner/clanker-ai";
import { getAgentDir, getDocsPath } from "../config.js";
import { AgentSession } from "./agent-session.js";
import { AuthStorage } from "./auth-storage.js";
@@ -54,7 +54,7 @@ import {
export interface CreateAgentSessionOptions {
/** Working directory for project-local discovery. Default: process.cwd() */
cwd?: string;
- /** Global config directory. Default: ~/.companion/agent */
+ /** Global config directory. Default: ~/.clanker/agent */
agentDir?: string;
/** Auth storage for credentials. Default: AuthStorage.create(agentDir/auth.json) */
@@ -153,7 +153,7 @@ function getDefaultAgentDir(): string {
* const { session } = await createAgentSession();
*
* // With explicit model
- * import { getModel } from '@mariozechner/companion-ai';
+ * import { getModel } from '@mariozechner/clanker-ai';
* const { session } = await createAgentSession({
* model: getModel('anthropic', 'claude-opus-4-6'),
* thinkingLevel: 'high',
diff --git a/packages/coding-agent/src/core/session-manager.ts b/packages/coding-agent/src/core/session-manager.ts
index 5b445d9..287f65e 100644
--- a/packages/coding-agent/src/core/session-manager.ts
+++ b/packages/coding-agent/src/core/session-manager.ts
@@ -1,5 +1,5 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { ImageContent, Message, TextContent } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { ImageContent, Message, TextContent } from "@mariozechner/clanker-ai";
import { randomUUID } from "crypto";
import {
appendFileSync,
@@ -72,7 +72,7 @@ export interface CompactionEntry extends SessionEntryBase {
tokensBefore: number;
/** Extension-specific data (e.g., ArtifactIndex, version markers for structured compaction) */
details?: T;
- /** True if generated by an extension, undefined/false if companion-generated (backward compatible) */
+ /** True if generated by an extension, undefined/false if clanker-generated (backward compatible) */
fromHook?: boolean;
}
@@ -82,7 +82,7 @@ export interface BranchSummaryEntry extends SessionEntryBase {
summary: string;
/** Extension-specific data (not sent to LLM) */
details?: T;
- /** True if generated by an extension, false if companion-generated */
+ /** True if generated by an extension, false if clanker-generated */
fromHook?: boolean;
}
@@ -448,7 +448,7 @@ export function buildSessionContext(
/**
* Compute the default session directory for a cwd.
- * Encodes cwd into a safe directory name under ~/.companion/agent/sessions/.
+ * Encodes cwd into a safe directory name under ~/.clanker/agent/sessions/.
*/
function getDefaultSessionDir(cwd: string): string {
const safePath = `--${cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
@@ -1332,7 +1332,7 @@ export class SessionManager {
/**
* Create a new session.
* @param cwd Working directory (stored in session header)
- * @param sessionDir Optional session directory. If omitted, uses default (~/.companion/agent/sessions//).
+ * @param sessionDir Optional session directory. If omitted, uses default (~/.clanker/agent/sessions//).
*/
static create(cwd: string, sessionDir?: string): SessionManager {
const dir = sessionDir ?? getDefaultSessionDir(cwd);
@@ -1359,7 +1359,7 @@ export class SessionManager {
/**
* Continue the most recent session, or create new if none.
* @param cwd Working directory
- * @param sessionDir Optional session directory. If omitted, uses default (~/.companion/agent/sessions//).
+ * @param sessionDir Optional session directory. If omitted, uses default (~/.clanker/agent/sessions//).
*/
static continueRecent(cwd: string, sessionDir?: string): SessionManager {
const dir = sessionDir ?? getDefaultSessionDir(cwd);
@@ -1438,7 +1438,7 @@ export class SessionManager {
/**
* List all sessions for a directory.
* @param cwd Working directory (used to compute default session directory)
- * @param sessionDir Optional session directory. If omitted, uses default (~/.companion/agent/sessions//).
+ * @param sessionDir Optional session directory. If omitted, uses default (~/.clanker/agent/sessions//).
* @param onProgress Optional callback for progress updates (loaded, total)
*/
static async list(
diff --git a/packages/coding-agent/src/core/settings-manager.ts b/packages/coding-agent/src/core/settings-manager.ts
index e0d934a..aef350b 100644
--- a/packages/coding-agent/src/core/settings-manager.ts
+++ b/packages/coding-agent/src/core/settings-manager.ts
@@ -1,4 +1,4 @@
-import type { Transport } from "@mariozechner/companion-ai";
+import type { Transport } from "@mariozechner/clanker-ai";
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
import { dirname, join } from "path";
import lockfile from "proper-lockfile";
@@ -63,7 +63,7 @@ export interface GatewaySettings {
webhook?: GatewayWebhookSettings;
}
-export interface CompanionMemorySettings {
+export interface ClankerMemorySettings {
enabled?: boolean;
storageDir?: string;
maxCoreTokens?: number;
@@ -136,7 +136,7 @@ export interface Settings {
showHardwareCursor?: boolean; // Show terminal cursor while still positioning it for IME
markdown?: MarkdownSettings;
gateway?: GatewaySettings;
- companionMemory?: CompanionMemorySettings;
+ clankerMemory?: ClankerMemorySettings;
}
/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */
@@ -944,7 +944,7 @@ export class SettingsManager {
if (this.settings.terminal?.clearOnShrink !== undefined) {
return this.settings.terminal.clearOnShrink;
}
- return process.env.COMPANION_CLEAR_ON_SHRINK === "1";
+ return process.env.CLANKER_CLEAR_ON_SHRINK === "1";
}
setClearOnShrink(enabled: boolean): void {
@@ -1023,7 +1023,7 @@ export class SettingsManager {
getShowHardwareCursor(): boolean {
return (
- this.settings.showHardwareCursor ?? process.env.COMPANION_HARDWARE_CURSOR === "1"
+ this.settings.showHardwareCursor ?? process.env.CLANKER_HARDWARE_CURSOR === "1"
);
}
diff --git a/packages/coding-agent/src/core/skills.ts b/packages/coding-agent/src/core/skills.ts
index b8a802c..3797cd8 100644
--- a/packages/coding-agent/src/core/skills.ts
+++ b/packages/coding-agent/src/core/skills.ts
@@ -361,7 +361,7 @@ function escapeXml(str: string): string {
export interface LoadSkillsOptions {
/** Working directory for project-local skills. Default: process.cwd() */
cwd?: string;
- /** Agent config directory for global skills. Default: ~/.companion/agent */
+ /** Agent config directory for global skills. Default: ~/.clanker/agent */
agentDir?: string;
/** Explicit skill paths (files or directories) */
skillPaths?: string[];
diff --git a/packages/coding-agent/src/core/slash-commands.ts b/packages/coding-agent/src/core/slash-commands.ts
index a636cae..5da117f 100644
--- a/packages/coding-agent/src/core/slash-commands.ts
+++ b/packages/coding-agent/src/core/slash-commands.ts
@@ -40,5 +40,5 @@ export const BUILTIN_SLASH_COMMANDS: ReadonlyArray = [
name: "reload",
description: "Reload extensions, skills, prompts, and themes",
},
- { name: "quit", description: "Quit companion" },
+ { name: "quit", description: "Quit clanker" },
];
diff --git a/packages/coding-agent/src/core/system-prompt.ts b/packages/coding-agent/src/core/system-prompt.ts
index e6b57ee..a865da9 100644
--- a/packages/coding-agent/src/core/system-prompt.ts
+++ b/packages/coding-agent/src/core/system-prompt.ts
@@ -243,7 +243,7 @@ export function buildSystemPrompt(
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
- let prompt = `You are Companion. You live in a persistent sandbox with a filesystem, a shell, and a browser. Your workspace carries over between sessions. This is your home.
+ let prompt = `You are Clanker. You live in a persistent sandbox with a filesystem, a shell, and a browser. Your workspace carries over between sessions. This is your home.
Never default to "I can't do that." Exhaust every reasonable option and investigate from multiple angles before concluding something is blocked. When blocked, explain why with evidence.
diff --git a/packages/coding-agent/src/core/timings.ts b/packages/coding-agent/src/core/timings.ts
index e740cd5..f415bf0 100644
--- a/packages/coding-agent/src/core/timings.ts
+++ b/packages/coding-agent/src/core/timings.ts
@@ -1,9 +1,9 @@
/**
* Central timing instrumentation for startup profiling.
- * Enable with COMPANION_TIMING=1 environment variable.
+ * Enable with CLANKER_TIMING=1 environment variable.
*/
-const ENABLED = process.env.COMPANION_TIMING === "1";
+const ENABLED = process.env.CLANKER_TIMING === "1";
const timings: Array<{ label: string; ms: number }> = [];
let lastTime = Date.now();
diff --git a/packages/coding-agent/src/core/tools/bash.ts b/packages/coding-agent/src/core/tools/bash.ts
index 13ee3bd..db8e76d 100644
--- a/packages/coding-agent/src/core/tools/bash.ts
+++ b/packages/coding-agent/src/core/tools/bash.ts
@@ -2,7 +2,7 @@ import { randomBytes } from "node:crypto";
import { createWriteStream, existsSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { spawn } from "child_process";
import {
@@ -23,7 +23,7 @@ import {
*/
function getTempFilePath(): string {
const id = randomBytes(8).toString("hex");
- return join(tmpdir(), `companion-bash-${id}.log`);
+ return join(tmpdir(), `clanker-bash-${id}.log`);
}
/**
diff --git a/packages/coding-agent/src/core/tools/browser.ts b/packages/coding-agent/src/core/tools/browser.ts
index cae7fb8..16260d6 100644
--- a/packages/coding-agent/src/core/tools/browser.ts
+++ b/packages/coding-agent/src/core/tools/browser.ts
@@ -3,7 +3,7 @@ import { randomBytes } from "node:crypto";
import { existsSync, mkdirSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { getAgentDir } from "../../config.js";
import {
@@ -28,7 +28,7 @@ const browserSnapshotModes = ["interactive", "full"] as const;
const browserLoadStates = ["load", "domcontentloaded", "networkidle"] as const;
const DEFAULT_BROWSER_COMMAND =
- process.env.COMPANION_AGENT_BROWSER_COMMAND || "agent-browser";
+ process.env.CLANKER_AGENT_BROWSER_COMMAND || "agent-browser";
const DEFAULT_BROWSER_TIMEOUT_SECONDS = 90;
const browserSchema = Type.Object({
@@ -78,7 +78,7 @@ const browserSchema = Type.Object({
stateName: Type.Optional(
Type.String({
description:
- "Named browser state checkpoint stored under ~/.companion/agent/browser/states/",
+ "Named browser state checkpoint stored under ~/.clanker/agent/browser/states/",
}),
),
});
@@ -232,7 +232,7 @@ function getBrowserStateDir(cwd: string, options?: BrowserToolOptions): string {
function createTempScreenshotPath(): string {
const id = randomBytes(8).toString("hex");
- return join(tmpdir(), `companion-browser-screenshot-${id}.png`);
+ return join(tmpdir(), `clanker-browser-screenshot-${id}.png`);
}
function normalizeOutput(chunks: Buffer[]): string {
@@ -285,14 +285,14 @@ function shouldLaunchHeaded(options?: BrowserToolOptions): boolean {
if (options?.headed !== undefined) {
return options.headed;
}
- return isTruthyEnv(process.env.COMPANION_AGENT_BROWSER_HEADED);
+ return isTruthyEnv(process.env.CLANKER_AGENT_BROWSER_HEADED);
}
function getBrowserWindowClass(
options?: BrowserToolOptions,
): string | undefined {
const rawValue =
- options?.windowClass ?? process.env.COMPANION_BROWSER_WINDOW_CLASS;
+ options?.windowClass ?? process.env.CLANKER_BROWSER_WINDOW_CLASS;
const windowClass = rawValue?.trim();
return windowClass ? windowClass : undefined;
}
diff --git a/packages/coding-agent/src/core/tools/computer.ts b/packages/coding-agent/src/core/tools/computer.ts
index f8ea171..be750ee 100644
--- a/packages/coding-agent/src/core/tools/computer.ts
+++ b/packages/coding-agent/src/core/tools/computer.ts
@@ -1,7 +1,7 @@
import { spawn } from "node:child_process";
import { mkdirSync } from "node:fs";
import { join, resolve } from "node:path";
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { getAgentDir } from "../../config.js";
import {
@@ -34,7 +34,7 @@ const computerObservationModes = ["hybrid", "ocr"] as const;
const computerSnapshotIdPattern = /^[A-Za-z0-9_-]+$/;
const DEFAULT_COMPUTER_COMMAND =
- process.env.COMPANION_AGENT_COMPUTER_COMMAND || "agent-computer";
+ process.env.CLANKER_AGENT_COMPUTER_COMMAND || "agent-computer";
const DEFAULT_COMPUTER_TIMEOUT_SECONDS = 90;
const computerSchema = Type.Object({
diff --git a/packages/coding-agent/src/core/tools/edit.ts b/packages/coding-agent/src/core/tools/edit.ts
index 636cbeb..eaae0ce 100644
--- a/packages/coding-agent/src/core/tools/edit.ts
+++ b/packages/coding-agent/src/core/tools/edit.ts
@@ -1,4 +1,4 @@
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { constants } from "fs";
import {
diff --git a/packages/coding-agent/src/core/tools/find.ts b/packages/coding-agent/src/core/tools/find.ts
index 660e8c3..1cc535c 100644
--- a/packages/coding-agent/src/core/tools/find.ts
+++ b/packages/coding-agent/src/core/tools/find.ts
@@ -1,4 +1,4 @@
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { spawnSync } from "child_process";
import { existsSync } from "fs";
diff --git a/packages/coding-agent/src/core/tools/grep.ts b/packages/coding-agent/src/core/tools/grep.ts
index 9653efe..03c9ede 100644
--- a/packages/coding-agent/src/core/tools/grep.ts
+++ b/packages/coding-agent/src/core/tools/grep.ts
@@ -1,5 +1,5 @@
import { createInterface } from "node:readline";
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { spawn } from "child_process";
import { readFileSync, statSync } from "fs";
diff --git a/packages/coding-agent/src/core/tools/index.ts b/packages/coding-agent/src/core/tools/index.ts
index d2e1588..c19e422 100644
--- a/packages/coding-agent/src/core/tools/index.ts
+++ b/packages/coding-agent/src/core/tools/index.ts
@@ -87,7 +87,7 @@ export {
writeTool,
} from "./write.js";
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type BashToolOptions, bashTool, createBashTool } from "./bash.js";
import {
browserTool,
@@ -106,7 +106,7 @@ import { createLsTool, lsTool } from "./ls.js";
import { createReadTool, type ReadToolOptions, readTool } from "./read.js";
import { createWriteTool, writeTool } from "./write.js";
-/** Tool type (AgentTool from companion-ai) */
+/** Tool type (AgentTool from clanker-ai) */
export type Tool = AgentTool;
// Read-only tools for exploration without modification (using process.cwd())
diff --git a/packages/coding-agent/src/core/tools/ls.ts b/packages/coding-agent/src/core/tools/ls.ts
index cdd149e..c746b1c 100644
--- a/packages/coding-agent/src/core/tools/ls.ts
+++ b/packages/coding-agent/src/core/tools/ls.ts
@@ -1,4 +1,4 @@
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { existsSync, readdirSync, statSync } from "fs";
import nodePath from "path";
diff --git a/packages/coding-agent/src/core/tools/read.ts b/packages/coding-agent/src/core/tools/read.ts
index 574b927..f238a16 100644
--- a/packages/coding-agent/src/core/tools/read.ts
+++ b/packages/coding-agent/src/core/tools/read.ts
@@ -1,5 +1,5 @@
-import type { AgentTool } from "@mariozechner/companion-agent-core";
-import type { ImageContent, TextContent } from "@mariozechner/companion-ai";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
+import type { ImageContent, TextContent } from "@mariozechner/clanker-ai";
import { type Static, Type } from "@sinclair/typebox";
import { constants } from "fs";
import { access as fsAccess, readFile as fsReadFile } from "fs/promises";
diff --git a/packages/coding-agent/src/core/tools/write.ts b/packages/coding-agent/src/core/tools/write.ts
index 3cabd52..2ada71e 100644
--- a/packages/coding-agent/src/core/tools/write.ts
+++ b/packages/coding-agent/src/core/tools/write.ts
@@ -1,4 +1,4 @@
-import type { AgentTool } from "@mariozechner/companion-agent-core";
+import type { AgentTool } from "@mariozechner/clanker-agent-core";
import { type Static, Type } from "@sinclair/typebox";
import { mkdir as fsMkdir, writeFile as fsWriteFile } from "fs/promises";
import { dirname } from "path";
diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts
index 80e67cc..202ca24 100644
--- a/packages/coding-agent/src/main.ts
+++ b/packages/coding-agent/src/main.ts
@@ -10,7 +10,7 @@ import {
type ImageContent,
modelsAreEqual,
supportsXhigh,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import chalk from "chalk";
import { createInterface } from "readline";
import { type Args, parseArgs, printHelp } from "./cli/args.js";
@@ -123,7 +123,7 @@ function printDaemonHelp(): void {
${APP_NAME} gateway [options] [messages...]
${APP_NAME} daemon [options] [messages...]
-Run companion as a long-lived gateway (non-interactive) with extensions enabled.
+Run clanker as a long-lived gateway (non-interactive) with extensions enabled.
Messages passed as positional args are sent once at startup.
Options:
@@ -154,7 +154,7 @@ function printPackageCommandHelp(command: PackageCommand): void {
Install a package and add it to settings.
Options:
- -l, --local Install project-locally (.companion/settings.json)
+ -l, --local Install project-locally (.clanker/settings.json)
Examples:
${APP_NAME} install npm:@foo/bar
@@ -173,7 +173,7 @@ Examples:
Remove a package and its source from settings.
Options:
- -l, --local Remove from project settings (.companion/settings.json)
+ -l, --local Remove from project settings (.clanker/settings.json)
Example:
${APP_NAME} remove npm:@foo/bar
@@ -661,10 +661,10 @@ export async function main(args: string[]) {
const isGatewayCommand = args[0] === "daemon" || args[0] === "gateway";
const parsedArgs = isGatewayCommand ? args.slice(1) : args;
const offlineMode =
- parsedArgs.includes("--offline") || isTruthyEnvFlag(process.env.COMPANION_OFFLINE);
+ parsedArgs.includes("--offline") || isTruthyEnvFlag(process.env.CLANKER_OFFLINE);
if (offlineMode) {
- process.env.COMPANION_OFFLINE = "1";
- process.env.COMPANION_SKIP_VERSION_CHECK = "1";
+ process.env.CLANKER_OFFLINE = "1";
+ process.env.CLANKER_SKIP_VERSION_CHECK = "1";
}
if (await handlePackageCommand(args)) {
@@ -993,7 +993,7 @@ export async function main(args: string[]) {
} catch (error) {
const message =
error instanceof Error ? error.stack || error.message : String(error);
- console.error(`[companion-gateway] daemon crashed: ${message}`);
+ console.error(`[clanker-gateway] daemon crashed: ${message}`);
try {
session.dispose();
} catch {
@@ -1005,20 +1005,20 @@ export async function main(args: string[]) {
if (runtimeMs < GATEWAY_MIN_RUNTIME_MS) {
consecutiveFailures += 1;
console.error(
- `[companion-gateway] exited quickly (${runtimeMs}ms), failure ${consecutiveFailures}/${GATEWAY_MAX_CONSECUTIVE_FAILURES}`,
+ `[clanker-gateway] exited quickly (${runtimeMs}ms), failure ${consecutiveFailures}/${GATEWAY_MAX_CONSECUTIVE_FAILURES}`,
);
if (consecutiveFailures >= GATEWAY_MAX_CONSECUTIVE_FAILURES) {
- console.error("[companion-gateway] crash loop detected, exiting");
+ console.error("[clanker-gateway] crash loop detected, exiting");
process.exit(1);
}
} else {
consecutiveFailures = 0;
- console.error(`[companion-gateway] exited after ${runtimeMs}ms, restarting`);
+ console.error(`[clanker-gateway] exited after ${runtimeMs}ms, restarting`);
}
if (GATEWAY_RESTART_DELAY_MS > 0) {
console.error(
- `[companion-gateway] restarting in ${GATEWAY_RESTART_DELAY_MS}ms`,
+ `[clanker-gateway] restarting in ${GATEWAY_RESTART_DELAY_MS}ms`,
);
await sleep(GATEWAY_RESTART_DELAY_MS);
}
diff --git a/packages/coding-agent/src/migrations.ts b/packages/coding-agent/src/migrations.ts
index adbfe4c..1c6c0f7 100644
--- a/packages/coding-agent/src/migrations.ts
+++ b/packages/coding-agent/src/migrations.ts
@@ -16,9 +16,9 @@ import { dirname, join } from "path";
import { CONFIG_DIR_NAME, getAgentDir, getBinDir } from "./config.js";
const MIGRATION_GUIDE_URL =
- "https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration";
+ "https://github.com/badlogic/clanker-mono/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration";
const EXTENSIONS_DOC_URL =
- "https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/docs/extensions.md";
+ "https://github.com/badlogic/clanker-mono/blob/main/packages/coding-agent/docs/extensions.md";
/**
* Migrate legacy oauth.json and settings.json apiKeys to auth.json.
@@ -80,13 +80,13 @@ export function migrateAuthToAuthJson(): string[] {
}
/**
- * Migrate sessions from ~/.companion/agent/*.jsonl to proper session directories.
+ * Migrate sessions from ~/.clanker/agent/*.jsonl to proper session directories.
*
- * Bug in v0.30.0: Sessions were saved to ~/.companion/agent/ instead of
- * ~/.companion/agent/sessions//. This migration moves them
+ * Bug in v0.30.0: Sessions were saved to ~/.clanker/agent/ instead of
+ * ~/.clanker/agent/sessions//. This migration moves them
* to the correct location based on the cwd in their session header.
*
- * See: https://github.com/badlogic/companion-mono/issues/320
+ * See: https://github.com/badlogic/clanker-mono/issues/320
*/
export function migrateSessionsFromAgentRoot(): void {
const agentDir = getAgentDir();
@@ -207,7 +207,7 @@ function migrateToolsToBin(): void {
/**
* Check for deprecated hooks/ and tools/ directories.
- * Note: tools/ may contain fd/rg binaries extracted by companion, so only warn if it has other files.
+ * Note: tools/ may contain fd/rg binaries extracted by clanker, so only warn if it has other files.
*/
function checkDeprecatedExtensionDirs(
baseDir: string,
diff --git a/packages/coding-agent/src/modes/daemon-mode.ts b/packages/coding-agent/src/modes/daemon-mode.ts
index 8eb4633..6f2927a 100644
--- a/packages/coding-agent/src/modes/daemon-mode.ts
+++ b/packages/coding-agent/src/modes/daemon-mode.ts
@@ -6,7 +6,7 @@
* until explicitly stopped.
*/
-import type { ImageContent } from "@mariozechner/companion-ai";
+import type { ImageContent } from "@mariozechner/clanker-ai";
import type { AgentSession } from "../core/agent-session.js";
import {
GatewayRuntime,
@@ -98,13 +98,13 @@ export async function runDaemonMode(
resolveReady = resolve;
});
const gatewayBind =
- process.env.COMPANION_GATEWAY_BIND ?? options.gateway.bind ?? "127.0.0.1";
+ process.env.CLANKER_GATEWAY_BIND ?? options.gateway.bind ?? "127.0.0.1";
const gatewayPort =
- Number.parseInt(process.env.COMPANION_GATEWAY_PORT ?? "", 10) ||
+ Number.parseInt(process.env.CLANKER_GATEWAY_PORT ?? "", 10) ||
options.gateway.port ||
8787;
const gatewayToken =
- process.env.COMPANION_GATEWAY_TOKEN ?? options.gateway.bearerToken;
+ process.env.CLANKER_GATEWAY_TOKEN ?? options.gateway.bearerToken;
const gateway = new GatewayRuntime({
config: {
bind: gatewayBind,
@@ -118,7 +118,7 @@ export async function runDaemonMode(
enabled: options.gateway.webhook?.enabled ?? true,
basePath: options.gateway.webhook?.basePath ?? "/webhooks",
secret:
- process.env.COMPANION_GATEWAY_WEBHOOK_SECRET ??
+ process.env.CLANKER_GATEWAY_WEBHOOK_SECRET ??
options.gateway.webhook?.secret,
},
},
@@ -126,7 +126,7 @@ export async function runDaemonMode(
primarySession: session,
createSession: options.createSession,
log: (message) => {
- console.error(`[companion-gateway] ${message}`);
+ console.error(`[clanker-gateway] ${message}`);
},
});
setActiveGatewayRuntime(gateway);
@@ -135,7 +135,7 @@ export async function runDaemonMode(
if (isShuttingDown) return;
isShuttingDown = true;
- console.error(`[companion-gateway] shutdown requested: ${reason}`);
+ console.error(`[clanker-gateway] shutdown requested: ${reason}`);
setActiveGatewayRuntime(null);
await gateway.stop();
@@ -151,7 +151,7 @@ export async function runDaemonMode(
const handleShutdownSignal = (signal: NodeJS.Signals) => {
void shutdown("signal").catch((error) => {
console.error(
- `[companion-gateway] shutdown failed for ${signal}: ${error instanceof Error ? error.message : String(error)}`,
+ `[clanker-gateway] shutdown failed for ${signal}: ${error instanceof Error ? error.message : String(error)}`,
);
resolveReady({ reason: "shutdown" });
});
@@ -162,7 +162,7 @@ export async function runDaemonMode(
const sighupHandler = () => handleShutdownSignal("SIGHUP");
const unhandledRejectionHandler = (error: unknown) => {
console.error(
- `[companion-gateway] unhandled rejection: ${error instanceof Error ? error.message : String(error)}`,
+ `[clanker-gateway] unhandled rejection: ${error instanceof Error ? error.message : String(error)}`,
);
};
@@ -177,7 +177,7 @@ export async function runDaemonMode(
shutdownHandler: () => {
void shutdown("extension").catch((error) => {
console.error(
- `[companion-gateway] extension shutdown failed: ${error instanceof Error ? error.message : String(error)}`,
+ `[clanker-gateway] extension shutdown failed: ${error instanceof Error ? error.message : String(error)}`,
);
resolveReady({ reason: "shutdown" });
});
@@ -208,7 +208,7 @@ export async function runDaemonMode(
await gateway.start();
console.error(
- `[companion-gateway] startup complete (session=${session.sessionId ?? "unknown"}, bind=${gatewayBind}, port=${gatewayPort})`,
+ `[clanker-gateway] startup complete (session=${session.sessionId ?? "unknown"}, bind=${gatewayBind}, port=${gatewayPort})`,
);
// Keep process alive forever.
diff --git a/packages/coding-agent/src/modes/interactive/components/armin.ts b/packages/coding-agent/src/modes/interactive/components/armin.ts
index 9e06d76..8607dbc 100644
--- a/packages/coding-agent/src/modes/interactive/components/armin.ts
+++ b/packages/coding-agent/src/modes/interactive/components/armin.ts
@@ -2,7 +2,7 @@
* Armin says hi! A fun easter egg with animated XBM art.
*/
-import type { Component, TUI } from "@mariozechner/companion-tui";
+import type { Component, TUI } from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
// XBM image: 31x36 pixels, LSB first, 1=background, 0=foreground
diff --git a/packages/coding-agent/src/modes/interactive/components/assistant-message.ts b/packages/coding-agent/src/modes/interactive/components/assistant-message.ts
index 82e4023..519e5e0 100644
--- a/packages/coding-agent/src/modes/interactive/components/assistant-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/assistant-message.ts
@@ -1,11 +1,11 @@
-import type { AssistantMessage } from "@mariozechner/companion-ai";
+import type { AssistantMessage } from "@mariozechner/clanker-ai";
import {
Container,
Markdown,
type MarkdownTheme,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { getMarkdownTheme, theme } from "../theme/theme.js";
/**
diff --git a/packages/coding-agent/src/modes/interactive/components/bash-execution.ts b/packages/coding-agent/src/modes/interactive/components/bash-execution.ts
index 00c4b09..1652d1e 100644
--- a/packages/coding-agent/src/modes/interactive/components/bash-execution.ts
+++ b/packages/coding-agent/src/modes/interactive/components/bash-execution.ts
@@ -8,7 +8,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import stripAnsi from "strip-ansi";
import {
DEFAULT_MAX_BYTES,
diff --git a/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts b/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts
index 3c07740..d05e63a 100644
--- a/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts
+++ b/packages/coding-agent/src/modes/interactive/components/bordered-loader.ts
@@ -5,7 +5,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { Theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
import { keyHint } from "./keybinding-hints.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts b/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts
index 1d3a125..370c2d3 100644
--- a/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/branch-summary-message.ts
@@ -4,7 +4,7 @@ import {
type MarkdownTheme,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { BranchSummaryMessage } from "../../../core/messages.js";
import { getMarkdownTheme, theme } from "../theme/theme.js";
import { editorKey } from "./keybinding-hints.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts b/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts
index d7e0175..790c4e6 100644
--- a/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/compaction-summary-message.ts
@@ -4,7 +4,7 @@ import {
type MarkdownTheme,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { CompactionSummaryMessage } from "../../../core/messages.js";
import { getMarkdownTheme, theme } from "../theme/theme.js";
import { editorKey } from "./keybinding-hints.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/config-selector.ts b/packages/coding-agent/src/modes/interactive/components/config-selector.ts
index f567837..2186381 100644
--- a/packages/coding-agent/src/modes/interactive/components/config-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/config-selector.ts
@@ -13,7 +13,7 @@ import {
Spacer,
truncateToWidth,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { CONFIG_DIR_NAME } from "../../../config.js";
import type {
PathMetadata,
@@ -68,7 +68,7 @@ function getGroupLabel(metadata: PathMetadata): string {
}
// Top-level resources
if (metadata.source === "auto") {
- return metadata.scope === "user" ? "User (~/.companion/agent/)" : "Project (.companion/)";
+ return metadata.scope === "user" ? "User (~/.clanker/agent/)" : "Project (.clanker/)";
}
return metadata.scope === "user" ? "User settings" : "Project settings";
}
diff --git a/packages/coding-agent/src/modes/interactive/components/countdown-timer.ts b/packages/coding-agent/src/modes/interactive/components/countdown-timer.ts
index 6155917..9f0b31a 100644
--- a/packages/coding-agent/src/modes/interactive/components/countdown-timer.ts
+++ b/packages/coding-agent/src/modes/interactive/components/countdown-timer.ts
@@ -2,7 +2,7 @@
* Reusable countdown timer for dialog components.
*/
-import type { TUI } from "@mariozechner/companion-tui";
+import type { TUI } from "@mariozechner/clanker-tui";
export class CountdownTimer {
private intervalId: ReturnType | undefined;
diff --git a/packages/coding-agent/src/modes/interactive/components/custom-editor.ts b/packages/coding-agent/src/modes/interactive/components/custom-editor.ts
index ca811b8..42e4adf 100644
--- a/packages/coding-agent/src/modes/interactive/components/custom-editor.ts
+++ b/packages/coding-agent/src/modes/interactive/components/custom-editor.ts
@@ -3,7 +3,7 @@ import {
type EditorOptions,
type EditorTheme,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type {
AppAction,
KeybindingsManager,
diff --git a/packages/coding-agent/src/modes/interactive/components/custom-message.ts b/packages/coding-agent/src/modes/interactive/components/custom-message.ts
index 99fd800..765cce8 100644
--- a/packages/coding-agent/src/modes/interactive/components/custom-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/custom-message.ts
@@ -1,5 +1,5 @@
-import type { TextContent } from "@mariozechner/companion-ai";
-import type { Component } from "@mariozechner/companion-tui";
+import type { TextContent } from "@mariozechner/clanker-ai";
+import type { Component } from "@mariozechner/clanker-tui";
import {
Box,
Container,
@@ -7,7 +7,7 @@ import {
type MarkdownTheme,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { MessageRenderer } from "../../../core/extensions/types.js";
import type { CustomMessage } from "../../../core/messages.js";
import { getMarkdownTheme, theme } from "../theme/theme.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/daxnuts.ts b/packages/coding-agent/src/modes/interactive/components/daxnuts.ts
index bf512ee..a6a3224 100644
--- a/packages/coding-agent/src/modes/interactive/components/daxnuts.ts
+++ b/packages/coding-agent/src/modes/interactive/components/daxnuts.ts
@@ -4,7 +4,7 @@
* A heartfelt tribute to dax (@thdxr) for providing free Kimi K2.5 access via OpenCode.
*/
-import type { Component, TUI } from "@mariozechner/companion-tui";
+import type { Component, TUI } from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
// 32x32 RGB image of dax, hex encoded (3 bytes per pixel)
diff --git a/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts b/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts
index 9ef1b21..113aa5e 100644
--- a/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts
+++ b/packages/coding-agent/src/modes/interactive/components/dynamic-border.ts
@@ -1,4 +1,4 @@
-import type { Component } from "@mariozechner/companion-tui";
+import type { Component } from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
/**
diff --git a/packages/coding-agent/src/modes/interactive/components/extension-editor.ts b/packages/coding-agent/src/modes/interactive/components/extension-editor.ts
index 20db317..4b9e4a5 100644
--- a/packages/coding-agent/src/modes/interactive/components/extension-editor.ts
+++ b/packages/coding-agent/src/modes/interactive/components/extension-editor.ts
@@ -16,7 +16,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { KeybindingsManager } from "../../../core/keybindings.js";
import { getEditorTheme, theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
@@ -121,7 +121,7 @@ export class ExtensionEditorComponent extends Container implements Focusable {
const currentText = this.editor.getText();
const tmpFile = path.join(
os.tmpdir(),
- `companion-extension-editor-${Date.now()}.md`,
+ `clanker-extension-editor-${Date.now()}.md`,
);
try {
diff --git a/packages/coding-agent/src/modes/interactive/components/extension-input.ts b/packages/coding-agent/src/modes/interactive/components/extension-input.ts
index 9372165..2a552e4 100644
--- a/packages/coding-agent/src/modes/interactive/components/extension-input.ts
+++ b/packages/coding-agent/src/modes/interactive/components/extension-input.ts
@@ -10,7 +10,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
import { CountdownTimer } from "./countdown-timer.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/extension-selector.ts b/packages/coding-agent/src/modes/interactive/components/extension-selector.ts
index 396d90a..0356b44 100644
--- a/packages/coding-agent/src/modes/interactive/components/extension-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/extension-selector.ts
@@ -9,7 +9,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
import { CountdownTimer } from "./countdown-timer.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/footer.ts b/packages/coding-agent/src/modes/interactive/components/footer.ts
index cecdc7c..e12dfe6 100644
--- a/packages/coding-agent/src/modes/interactive/components/footer.ts
+++ b/packages/coding-agent/src/modes/interactive/components/footer.ts
@@ -2,7 +2,7 @@ import {
type Component,
truncateToWidth,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { AgentSession } from "../../../core/agent-session.js";
import type { ReadonlyFooterDataProvider } from "../../../core/footer-data-provider.js";
import { theme } from "../theme/theme.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts b/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts
index 6ca7465..be09259 100644
--- a/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts
+++ b/packages/coding-agent/src/modes/interactive/components/keybinding-hints.ts
@@ -6,7 +6,7 @@ import {
type EditorAction,
getEditorKeybindings,
type KeyId,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type {
AppAction,
KeybindingsManager,
diff --git a/packages/coding-agent/src/modes/interactive/components/login-dialog.ts b/packages/coding-agent/src/modes/interactive/components/login-dialog.ts
index 30ade22..0b08c5a 100644
--- a/packages/coding-agent/src/modes/interactive/components/login-dialog.ts
+++ b/packages/coding-agent/src/modes/interactive/components/login-dialog.ts
@@ -1,4 +1,4 @@
-import { getOAuthProviders } from "@mariozechner/companion-ai/oauth";
+import { getOAuthProviders } from "@mariozechner/clanker-ai/oauth";
import {
Container,
type Focusable,
@@ -7,7 +7,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { exec } from "child_process";
import { theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/model-selector.ts b/packages/coding-agent/src/modes/interactive/components/model-selector.ts
index 7e40a5a..9683626 100644
--- a/packages/coding-agent/src/modes/interactive/components/model-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/model-selector.ts
@@ -1,4 +1,4 @@
-import { type Model, modelsAreEqual } from "@mariozechner/companion-ai";
+import { type Model, modelsAreEqual } from "@mariozechner/clanker-ai";
import {
Container,
type Focusable,
@@ -8,7 +8,7 @@ import {
Spacer,
Text,
type TUI,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { ModelRegistry } from "../../../core/model-registry.js";
import type { SettingsManager } from "../../../core/settings-manager.js";
import { theme } from "../theme/theme.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts b/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts
index 7792afe..e873f57 100644
--- a/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/oauth-selector.ts
@@ -1,11 +1,11 @@
-import type { OAuthProviderInterface } from "@mariozechner/companion-ai";
-import { getOAuthProviders } from "@mariozechner/companion-ai/oauth";
+import type { OAuthProviderInterface } from "@mariozechner/clanker-ai";
+import { getOAuthProviders } from "@mariozechner/clanker-ai/oauth";
import {
Container,
getEditorKeybindings,
Spacer,
TruncatedText,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { AuthStorage } from "../../../core/auth-storage.js";
import { theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts b/packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts
index d439542..df828ed 100644
--- a/packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts
@@ -1,4 +1,4 @@
-import type { Model } from "@mariozechner/companion-ai";
+import type { Model } from "@mariozechner/clanker-ai";
import {
Container,
type Focusable,
@@ -9,7 +9,7 @@ import {
matchesKey,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/session-selector-search.ts b/packages/coding-agent/src/modes/interactive/components/session-selector-search.ts
index c857f6c..885a05a 100644
--- a/packages/coding-agent/src/modes/interactive/components/session-selector-search.ts
+++ b/packages/coding-agent/src/modes/interactive/components/session-selector-search.ts
@@ -1,4 +1,4 @@
-import { fuzzyMatch } from "@mariozechner/companion-tui";
+import { fuzzyMatch } from "@mariozechner/clanker-tui";
import type { SessionInfo } from "../../../core/session-manager.js";
export type SortMode = "threaded" | "recent" | "relevance";
diff --git a/packages/coding-agent/src/modes/interactive/components/session-selector.ts b/packages/coding-agent/src/modes/interactive/components/session-selector.ts
index 25334fe..fdf5331 100644
--- a/packages/coding-agent/src/modes/interactive/components/session-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/session-selector.ts
@@ -13,7 +13,7 @@ import {
Text,
truncateToWidth,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { KeybindingsManager } from "../../../core/keybindings.js";
import type {
SessionInfo,
@@ -607,7 +607,7 @@ class SessionList implements Component, Focusable {
void this.onDeleteSession?.(pathToDelete);
return;
}
- // Allow both Escape and Ctrl+C to cancel (consistent with companion UX)
+ // Allow both Escape and Ctrl+C to cancel (consistent with clanker UX)
if (
kb.matches(keyData, "selectCancel") ||
matchesKey(keyData, "ctrl+c")
diff --git a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
index dc8653d..0a61776 100644
--- a/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/settings-selector.ts
@@ -1,5 +1,5 @@
-import type { ThinkingLevel } from "@mariozechner/companion-agent-core";
-import type { Transport } from "@mariozechner/companion-ai";
+import type { ThinkingLevel } from "@mariozechner/clanker-agent-core";
+import type { Transport } from "@mariozechner/clanker-ai";
import {
Container,
getCapabilities,
@@ -9,7 +9,7 @@ import {
SettingsList,
Spacer,
Text,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import {
getSelectListTheme,
getSettingsListTheme,
diff --git a/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts b/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts
index dbcb280..46b9146 100644
--- a/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/show-images-selector.ts
@@ -1,4 +1,4 @@
-import { Container, type SelectItem, SelectList } from "@mariozechner/companion-tui";
+import { Container, type SelectItem, SelectList } from "@mariozechner/clanker-tui";
import { getSelectListTheme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts b/packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts
index e5843de..c513777 100644
--- a/packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts
@@ -1,4 +1,4 @@
-import { Box, Markdown, type MarkdownTheme, Text } from "@mariozechner/companion-tui";
+import { Box, Markdown, type MarkdownTheme, Text } from "@mariozechner/clanker-tui";
import type { ParsedSkillBlock } from "../../../core/agent-session.js";
import { getMarkdownTheme, theme } from "../theme/theme.js";
import { editorKey } from "./keybinding-hints.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/theme-selector.ts b/packages/coding-agent/src/modes/interactive/components/theme-selector.ts
index 2618add..877de18 100644
--- a/packages/coding-agent/src/modes/interactive/components/theme-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/theme-selector.ts
@@ -1,4 +1,4 @@
-import { Container, type SelectItem, SelectList } from "@mariozechner/companion-tui";
+import { Container, type SelectItem, SelectList } from "@mariozechner/clanker-tui";
import { getAvailableThemes, getSelectListTheme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts b/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts
index a35ed81..2e7c7de 100644
--- a/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/thinking-selector.ts
@@ -1,5 +1,5 @@
-import type { ThinkingLevel } from "@mariozechner/companion-agent-core";
-import { Container, type SelectItem, SelectList } from "@mariozechner/companion-tui";
+import type { ThinkingLevel } from "@mariozechner/clanker-agent-core";
+import { Container, type SelectItem, SelectList } from "@mariozechner/clanker-tui";
import { getSelectListTheme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/tool-execution.ts b/packages/coding-agent/src/modes/interactive/components/tool-execution.ts
index 3b24520..b283f17 100644
--- a/packages/coding-agent/src/modes/interactive/components/tool-execution.ts
+++ b/packages/coding-agent/src/modes/interactive/components/tool-execution.ts
@@ -10,7 +10,7 @@ import {
Text,
type TUI,
truncateToWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import stripAnsi from "strip-ansi";
import type { ToolDefinition } from "../../../core/extensions/types.js";
import {
diff --git a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts
index f39910e..f8e35b2 100644
--- a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts
@@ -9,7 +9,7 @@ import {
Text,
TruncatedText,
truncateToWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import type { SessionTreeNode } from "../../../core/session-manager.js";
import { theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts b/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts
index 6b0f5c7..be8c1e9 100644
--- a/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts
+++ b/packages/coding-agent/src/modes/interactive/components/user-message-selector.ts
@@ -5,7 +5,7 @@ import {
Spacer,
Text,
truncateToWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { theme } from "../theme/theme.js";
import { DynamicBorder } from "./dynamic-border.js";
diff --git a/packages/coding-agent/src/modes/interactive/components/user-message.ts b/packages/coding-agent/src/modes/interactive/components/user-message.ts
index c76c7cb..31438f8 100644
--- a/packages/coding-agent/src/modes/interactive/components/user-message.ts
+++ b/packages/coding-agent/src/modes/interactive/components/user-message.ts
@@ -3,7 +3,7 @@ import {
Markdown,
type MarkdownTheme,
Spacer,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { getMarkdownTheme, theme } from "../theme/theme.js";
const OSC133_ZONE_START = "\x1b]133;A\x07";
diff --git a/packages/coding-agent/src/modes/interactive/components/visual-truncate.ts b/packages/coding-agent/src/modes/interactive/components/visual-truncate.ts
index d7ef371..c9ee537 100644
--- a/packages/coding-agent/src/modes/interactive/components/visual-truncate.ts
+++ b/packages/coding-agent/src/modes/interactive/components/visual-truncate.ts
@@ -3,7 +3,7 @@
* Used by both tool-execution.ts and bash-execution.ts for consistent behavior.
*/
-import { Text } from "@mariozechner/companion-tui";
+import { Text } from "@mariozechner/clanker-tui";
export interface VisualTruncateResult {
/** The visual lines to display */
diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
index 8625846..b3d2d69 100644
--- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts
+++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts
@@ -7,14 +7,14 @@ import * as crypto from "node:crypto";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
import type {
AssistantMessage,
ImageContent,
Message,
Model,
OAuthProviderId,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import type {
AutocompleteItem,
EditorAction,
@@ -25,7 +25,7 @@ import type {
OverlayHandle,
OverlayOptions,
SlashCommand,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import {
CombinedAutocompleteProvider,
type Component,
@@ -40,7 +40,7 @@ import {
TruncatedText,
TUI,
visibleWidth,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { spawn, spawnSync } from "child_process";
import {
APP_NAME,
@@ -666,12 +666,12 @@ export class InteractiveMode {
* Check npm registry for a newer version.
*/
private async checkForNewVersion(): Promise {
- if (process.env.COMPANION_SKIP_VERSION_CHECK || process.env.COMPANION_OFFLINE)
+ if (process.env.CLANKER_SKIP_VERSION_CHECK || process.env.CLANKER_OFFLINE)
return undefined;
try {
const response = await fetch(
- "https://registry.npmjs.org/@mariozechner/companion-coding-agent/latest",
+ "https://registry.npmjs.org/@mariozechner/clanker-coding-agent/latest",
{
signal: AbortSignal.timeout(10000),
},
@@ -2141,7 +2141,7 @@ export class InteractiveMode {
// Write to temp file
const tmpDir = os.tmpdir();
const ext = extensionForImageMimeType(image.mimeType) ?? "png";
- const fileName = `companion-clipboard-${crypto.randomUUID()}.${ext}`;
+ const fileName = `clanker-clipboard-${crypto.randomUUID()}.${ext}`;
const filePath = path.join(tmpDir, fileName);
fs.writeFileSync(filePath, Buffer.from(image.bytes));
@@ -3110,7 +3110,7 @@ export class InteractiveMode {
const currentText =
this.editor.getExpandedText?.() ?? this.editor.getText();
- const tmpFile = path.join(os.tmpdir(), `companion-editor-${Date.now()}.companion.md`);
+ const tmpFile = path.join(os.tmpdir(), `clanker-editor-${Date.now()}.clanker.md`);
try {
// Write current content to temp file
@@ -3176,13 +3176,13 @@ export class InteractiveMode {
showNewVersionNotification(newVersion: string): void {
const action = theme.fg(
"accent",
- getUpdateInstruction("@mariozechner/companion-coding-agent"),
+ getUpdateInstruction("@mariozechner/clanker-coding-agent"),
);
const updateInstruction =
theme.fg("muted", `New version ${newVersion} is available. `) + action;
const changelogUrl = theme.fg(
"accent",
- "https://github.com/badlogic/companion-mono/blob/main/packages/coding-agent/CHANGELOG.md",
+ "https://github.com/badlogic/clanker-mono/blob/main/packages/coding-agent/CHANGELOG.md",
);
const changelogLine = theme.fg("muted", "Changelog: ") + changelogUrl;
diff --git a/packages/coding-agent/src/modes/interactive/theme/dark.json b/packages/coding-agent/src/modes/interactive/theme/dark.json
index 83170e3..76d4ff0 100644
--- a/packages/coding-agent/src/modes/interactive/theme/dark.json
+++ b/packages/coding-agent/src/modes/interactive/theme/dark.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/harivansh-afk/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "dark",
"vars": {
"cyan": "#00d7ff",
diff --git a/packages/coding-agent/src/modes/interactive/theme/light.json b/packages/coding-agent/src/modes/interactive/theme/light.json
index e3767f2..bab6107 100644
--- a/packages/coding-agent/src/modes/interactive/theme/light.json
+++ b/packages/coding-agent/src/modes/interactive/theme/light.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://raw.githubusercontent.com/badlogic/companion-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
+ "$schema": "https://raw.githubusercontent.com/harivansh-afk/clanker-agent/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
"name": "light",
"vars": {
"teal": "#5a8080",
diff --git a/packages/coding-agent/src/modes/interactive/theme/theme-schema.json b/packages/coding-agent/src/modes/interactive/theme/theme-schema.json
index 86af8ee..6118523 100644
--- a/packages/coding-agent/src/modes/interactive/theme/theme-schema.json
+++ b/packages/coding-agent/src/modes/interactive/theme/theme-schema.json
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Companion Coding Agent Theme",
- "description": "Theme schema for companion coding agent",
+ "title": "Clanker Coding Agent Theme",
+ "description": "Theme schema for clanker coding agent",
"type": "object",
"required": ["name", "colors"],
"properties": {
diff --git a/packages/coding-agent/src/modes/interactive/theme/theme.ts b/packages/coding-agent/src/modes/interactive/theme/theme.ts
index be80f2f..b4830f2 100644
--- a/packages/coding-agent/src/modes/interactive/theme/theme.ts
+++ b/packages/coding-agent/src/modes/interactive/theme/theme.ts
@@ -4,7 +4,7 @@ import type {
EditorTheme,
MarkdownTheme,
SelectListTheme,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { type Static, Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import chalk from "chalk";
@@ -682,7 +682,7 @@ function getDefaultTheme(): string {
// ============================================================================
// Use globalThis to share theme across module loaders (tsx + jiti in dev mode)
-const THEME_KEY = Symbol.for("@mariozechner/companion-coding-agent:theme");
+const THEME_KEY = Symbol.for("@mariozechner/clanker-coding-agent:theme");
// Export theme as a getter that reads from globalThis
// This ensures all module instances (tsx, jiti) see the same theme
@@ -1144,7 +1144,7 @@ export function getEditorTheme(): EditorTheme {
};
}
-export function getSettingsListTheme(): import("@mariozechner/companion-tui").SettingsListTheme {
+export function getSettingsListTheme(): import("@mariozechner/clanker-tui").SettingsListTheme {
return {
label: (text: string, selected: boolean) =>
selected ? theme.fg("accent", text) : text,
diff --git a/packages/coding-agent/src/modes/print-mode.ts b/packages/coding-agent/src/modes/print-mode.ts
index d4fd508..38a2b3c 100644
--- a/packages/coding-agent/src/modes/print-mode.ts
+++ b/packages/coding-agent/src/modes/print-mode.ts
@@ -2,11 +2,11 @@
* Print mode (single-shot): Send prompts, output result, exit.
*
* Used for:
- * - `companion -p "prompt"` - text output
- * - `companion --mode json "prompt"` - JSON event stream
+ * - `clanker -p "prompt"` - text output
+ * - `clanker --mode json "prompt"` - JSON event stream
*/
-import type { AssistantMessage, ImageContent } from "@mariozechner/companion-ai";
+import type { AssistantMessage, ImageContent } from "@mariozechner/clanker-ai";
import type { AgentSession } from "../core/agent-session.js";
/**
diff --git a/packages/coding-agent/src/modes/rpc/rpc-client.ts b/packages/coding-agent/src/modes/rpc/rpc-client.ts
index 65535f4..21add58 100644
--- a/packages/coding-agent/src/modes/rpc/rpc-client.ts
+++ b/packages/coding-agent/src/modes/rpc/rpc-client.ts
@@ -10,8 +10,8 @@ import type {
AgentEvent,
AgentMessage,
ThinkingLevel,
-} from "@mariozechner/companion-agent-core";
-import type { ImageContent } from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-agent-core";
+import type { ImageContent } from "@mariozechner/clanker-ai";
import type { SessionStats } from "../../core/agent-session.js";
import type { BashResult } from "../../core/bash-executor.js";
import type { CompactionResult } from "../../core/compaction/index.js";
diff --git a/packages/coding-agent/src/modes/rpc/rpc-types.ts b/packages/coding-agent/src/modes/rpc/rpc-types.ts
index b6cf1fa..d824ced 100644
--- a/packages/coding-agent/src/modes/rpc/rpc-types.ts
+++ b/packages/coding-agent/src/modes/rpc/rpc-types.ts
@@ -5,8 +5,8 @@
* Responses and events are emitted as JSON lines on stdout.
*/
-import type { AgentMessage, ThinkingLevel } from "@mariozechner/companion-agent-core";
-import type { ImageContent, Model } from "@mariozechner/companion-ai";
+import type { AgentMessage, ThinkingLevel } from "@mariozechner/clanker-agent-core";
+import type { ImageContent, Model } from "@mariozechner/clanker-ai";
import type { SessionStats } from "../../core/agent-session.js";
import type { BashResult } from "../../core/bash-executor.js";
import type { CompactionResult } from "../../core/compaction/index.js";
diff --git a/packages/coding-agent/src/utils/image-resize.ts b/packages/coding-agent/src/utils/image-resize.ts
index 7ca730a..4805d54 100644
--- a/packages/coding-agent/src/utils/image-resize.ts
+++ b/packages/coding-agent/src/utils/image-resize.ts
@@ -1,4 +1,4 @@
-import type { ImageContent } from "@mariozechner/companion-ai";
+import type { ImageContent } from "@mariozechner/clanker-ai";
import { loadPhoton } from "./photon.js";
export interface ImageResizeOptions {
diff --git a/packages/coding-agent/src/utils/tools-manager.ts b/packages/coding-agent/src/utils/tools-manager.ts
index a80acbd..3a0641a 100644
--- a/packages/coding-agent/src/utils/tools-manager.ts
+++ b/packages/coding-agent/src/utils/tools-manager.ts
@@ -20,7 +20,7 @@ const TOOLS_DIR = getBinDir();
const NETWORK_TIMEOUT_MS = 10000;
function isOfflineModeEnabled(): boolean {
- const value = process.env.COMPANION_OFFLINE;
+ const value = process.env.CLANKER_OFFLINE;
if (!value) return false;
return (
value === "1" ||
diff --git a/packages/coding-agent/test/agent-session-auto-compaction-queue.test.ts b/packages/coding-agent/test/agent-session-auto-compaction-queue.test.ts
index 53a8cf5..d8eafe9 100644
--- a/packages/coding-agent/test/agent-session-auto-compaction-queue.test.ts
+++ b/packages/coding-agent/test/agent-session-auto-compaction-queue.test.ts
@@ -1,8 +1,8 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
-import { type AssistantMessage, getModel } from "@mariozechner/companion-ai";
+import { Agent } from "@mariozechner/clanker-agent-core";
+import { type AssistantMessage, getModel } from "@mariozechner/clanker-ai";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
@@ -44,7 +44,7 @@ describe("AgentSession auto-compaction queue resume", () => {
let tempDir: string;
beforeEach(() => {
- tempDir = join(tmpdir(), `companion-auto-compaction-queue-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-auto-compaction-queue-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
vi.useFakeTimers();
diff --git a/packages/coding-agent/test/agent-session-branching.test.ts b/packages/coding-agent/test/agent-session-branching.test.ts
index da58be8..8ff0c73 100644
--- a/packages/coding-agent/test/agent-session-branching.test.ts
+++ b/packages/coding-agent/test/agent-session-branching.test.ts
@@ -10,8 +10,8 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
-import { getModel } from "@mariozechner/companion-ai";
+import { Agent } from "@mariozechner/clanker-agent-core";
+import { getModel } from "@mariozechner/clanker-ai";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
@@ -28,7 +28,7 @@ describe.skipIf(!API_KEY)("AgentSession forking", () => {
beforeEach(() => {
// Create temp directory for session files
- tempDir = join(tmpdir(), `companion-branching-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-branching-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
});
diff --git a/packages/coding-agent/test/agent-session-compaction.test.ts b/packages/coding-agent/test/agent-session-compaction.test.ts
index ca3f48b..41bd1a8 100644
--- a/packages/coding-agent/test/agent-session-compaction.test.ts
+++ b/packages/coding-agent/test/agent-session-compaction.test.ts
@@ -10,8 +10,8 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
-import { getModel } from "@mariozechner/companion-ai";
+import { Agent } from "@mariozechner/clanker-agent-core";
+import { getModel } from "@mariozechner/clanker-ai";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import {
AgentSession,
@@ -32,7 +32,7 @@ describe.skipIf(!API_KEY)("AgentSession compaction e2e", () => {
beforeEach(() => {
// Create temp directory for session files
- tempDir = join(tmpdir(), `companion-compaction-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-compaction-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
// Track events
diff --git a/packages/coding-agent/test/agent-session-concurrent.test.ts b/packages/coding-agent/test/agent-session-concurrent.test.ts
index c945fa8..b2a6024 100644
--- a/packages/coding-agent/test/agent-session-concurrent.test.ts
+++ b/packages/coding-agent/test/agent-session-concurrent.test.ts
@@ -5,13 +5,13 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
+import { Agent } from "@mariozechner/clanker-agent-core";
import {
type AssistantMessage,
type AssistantMessageEvent,
EventStream,
getModel,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import { Type } from "@sinclair/typebox";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
@@ -63,7 +63,7 @@ describe("AgentSession concurrent prompt guard", () => {
let tempDir: string;
beforeEach(() => {
- tempDir = join(tmpdir(), `companion-concurrent-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-concurrent-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
});
diff --git a/packages/coding-agent/test/agent-session-dynamic-tools.test.ts b/packages/coding-agent/test/agent-session-dynamic-tools.test.ts
index 2f90d2d..889e65f 100644
--- a/packages/coding-agent/test/agent-session-dynamic-tools.test.ts
+++ b/packages/coding-agent/test/agent-session-dynamic-tools.test.ts
@@ -1,7 +1,7 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { getModel } from "@mariozechner/companion-ai";
+import { getModel } from "@mariozechner/clanker-ai";
import { Type } from "@sinclair/typebox";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { DefaultResourceLoader } from "../src/core/resource-loader.js";
@@ -16,7 +16,7 @@ describe("AgentSession dynamic tool registration", () => {
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-dynamic-tool-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-dynamic-tool-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
agentDir = join(tempDir, "agent");
mkdirSync(agentDir, { recursive: true });
@@ -37,9 +37,9 @@ describe("AgentSession dynamic tool registration", () => {
agentDir,
settingsManager,
extensionFactories: [
- (companion) => {
- companion.on("session_start", () => {
- companion.registerTool({
+ (clanker) => {
+ clanker.on("session_start", () => {
+ clanker.registerTool({
name: "dynamic_tool",
label: "Dynamic Tool",
description: "Tool registered from session_start",
diff --git a/packages/coding-agent/test/agent-session-retry.test.ts b/packages/coding-agent/test/agent-session-retry.test.ts
index 62c6077..b331b33 100644
--- a/packages/coding-agent/test/agent-session-retry.test.ts
+++ b/packages/coding-agent/test/agent-session-retry.test.ts
@@ -1,13 +1,13 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent, type AgentEvent } from "@mariozechner/companion-agent-core";
+import { Agent, type AgentEvent } from "@mariozechner/clanker-agent-core";
import {
type AssistantMessage,
type AssistantMessageEvent,
EventStream,
getModel,
-} from "@mariozechner/companion-ai";
+} from "@mariozechner/clanker-ai";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
@@ -65,7 +65,7 @@ describe("AgentSession retry", () => {
let tempDir: string;
beforeEach(() => {
- tempDir = join(tmpdir(), `companion-retry-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-retry-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
});
diff --git a/packages/coding-agent/test/auth-storage.test.ts b/packages/coding-agent/test/auth-storage.test.ts
index 078b3e0..b20ffb6 100644
--- a/packages/coding-agent/test/auth-storage.test.ts
+++ b/packages/coding-agent/test/auth-storage.test.ts
@@ -7,7 +7,7 @@ import {
} from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { registerOAuthProvider } from "@mariozechner/companion-ai/oauth";
+import { registerOAuthProvider } from "@mariozechner/clanker-ai/oauth";
import lockfile from "proper-lockfile";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { AuthStorage } from "../src/core/auth-storage.js";
@@ -21,7 +21,7 @@ describe("AuthStorage", () => {
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-test-auth-storage-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-test-auth-storage-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
mkdirSync(tempDir, { recursive: true });
authJsonPath = join(tempDir, "auth.json");
diff --git a/packages/coding-agent/test/browser-tool.test.ts b/packages/coding-agent/test/browser-tool.test.ts
index 16df03b..c1ab761 100644
--- a/packages/coding-agent/test/browser-tool.test.ts
+++ b/packages/coding-agent/test/browser-tool.test.ts
@@ -155,7 +155,7 @@ describe("browser tool", () => {
profileDir,
stateDir,
headed: true,
- windowClass: "CompanionBrowser",
+ windowClass: "ClankerBrowser",
});
await browserTool.execute("browser-open-window-class", {
@@ -168,7 +168,7 @@ describe("browser tool", () => {
profileDir,
"--headed",
"--args",
- "--class=CompanionBrowser",
+ "--class=ClankerBrowser",
"open",
"https://example.com",
]);
diff --git a/packages/coding-agent/test/compaction-extensions-example.test.ts b/packages/coding-agent/test/compaction-extensions-example.test.ts
index 27f85d1..2af2351 100644
--- a/packages/coding-agent/test/compaction-extensions-example.test.ts
+++ b/packages/coding-agent/test/compaction-extensions-example.test.ts
@@ -12,8 +12,8 @@ import type {
describe("Documentation example", () => {
it("custom compaction example should type-check correctly", () => {
// This is the example from extensions.md - verify it compiles
- const exampleExtension = (companion: ExtensionAPI) => {
- companion.on(
+ const exampleExtension = (clanker: ExtensionAPI) => {
+ clanker.on(
"session_before_compact",
async (event: SessionBeforeCompactEvent, ctx) => {
// All these should be accessible on the event
@@ -63,8 +63,8 @@ describe("Documentation example", () => {
});
it("compact event should have correct fields", () => {
- const checkCompactEvent = (companion: ExtensionAPI) => {
- companion.on("session_compact", async (event: SessionCompactEvent) => {
+ const checkCompactEvent = (clanker: ExtensionAPI) => {
+ clanker.on("session_compact", async (event: SessionCompactEvent) => {
// These should all be accessible
const entry = event.compactionEntry;
const fromExtension = event.fromExtension;
diff --git a/packages/coding-agent/test/compaction-extensions.test.ts b/packages/coding-agent/test/compaction-extensions.test.ts
index ad419f8..822c322 100644
--- a/packages/coding-agent/test/compaction-extensions.test.ts
+++ b/packages/coding-agent/test/compaction-extensions.test.ts
@@ -5,8 +5,8 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
-import { getModel } from "@mariozechner/companion-ai";
+import { Agent } from "@mariozechner/clanker-agent-core";
+import { getModel } from "@mariozechner/clanker-ai";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
@@ -32,7 +32,7 @@ describe.skipIf(!API_KEY)("Compaction extensions", () => {
let capturedEvents: SessionEvent[];
beforeEach(() => {
- tempDir = join(tmpdir(), `companion-compaction-extensions-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-compaction-extensions-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
capturedEvents = [];
});
diff --git a/packages/coding-agent/test/compaction-summary-reasoning.test.ts b/packages/coding-agent/test/compaction-summary-reasoning.test.ts
index d811700..19aef04 100644
--- a/packages/coding-agent/test/compaction-summary-reasoning.test.ts
+++ b/packages/coding-agent/test/compaction-summary-reasoning.test.ts
@@ -1,5 +1,5 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { AssistantMessage, Model } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { AssistantMessage, Model } from "@mariozechner/clanker-ai";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { generateSummary } from "../src/core/compaction/index.js";
@@ -7,8 +7,8 @@ const { completeSimpleMock } = vi.hoisted(() => ({
completeSimpleMock: vi.fn(),
}));
-vi.mock("@mariozechner/companion-ai", async (importOriginal) => {
- const actual = await importOriginal();
+vi.mock("@mariozechner/clanker-ai", async (importOriginal) => {
+ const actual = await importOriginal();
return {
...actual,
completeSimple: completeSimpleMock,
diff --git a/packages/coding-agent/test/compaction-thinking-model.test.ts b/packages/coding-agent/test/compaction-thinking-model.test.ts
index f6a6ea6..a93671c 100644
--- a/packages/coding-agent/test/compaction-thinking-model.test.ts
+++ b/packages/coding-agent/test/compaction-thinking-model.test.ts
@@ -11,8 +11,8 @@
import { existsSync, mkdirSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
-import { Agent, type ThinkingLevel } from "@mariozechner/companion-agent-core";
-import { getModel, type Model } from "@mariozechner/companion-ai";
+import { Agent, type ThinkingLevel } from "@mariozechner/clanker-agent-core";
+import { getModel, type Model } from "@mariozechner/clanker-ai";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { ModelRegistry } from "../src/core/model-registry.js";
@@ -45,7 +45,7 @@ describe.skipIf(!HAS_ANTIGRAVITY_AUTH)(
});
beforeEach(() => {
- tempDir = join(tmpdir(), `companion-thinking-compaction-test-${Date.now()}`);
+ tempDir = join(tmpdir(), `clanker-thinking-compaction-test-${Date.now()}`);
mkdirSync(tempDir, { recursive: true });
});
@@ -156,7 +156,7 @@ describe.skipIf(!HAS_ANTHROPIC_AUTH)(
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-thinking-compaction-anthropic-test-${Date.now()}`,
+ `clanker-thinking-compaction-anthropic-test-${Date.now()}`,
);
mkdirSync(tempDir, { recursive: true });
});
diff --git a/packages/coding-agent/test/compaction.test.ts b/packages/coding-agent/test/compaction.test.ts
index 13343d1..2d2ee8e 100644
--- a/packages/coding-agent/test/compaction.test.ts
+++ b/packages/coding-agent/test/compaction.test.ts
@@ -1,6 +1,6 @@
-import type { AgentMessage } from "@mariozechner/companion-agent-core";
-import type { AssistantMessage, Usage } from "@mariozechner/companion-ai";
-import { getModel } from "@mariozechner/companion-ai";
+import type { AgentMessage } from "@mariozechner/clanker-agent-core";
+import type { AssistantMessage, Usage } from "@mariozechner/clanker-ai";
+import { getModel } from "@mariozechner/clanker-ai";
import { readFileSync } from "fs";
import { join } from "path";
import { beforeEach, describe, expect, it } from "vitest";
diff --git a/packages/coding-agent/test/computer-tool.test.ts b/packages/coding-agent/test/computer-tool.test.ts
index 446c064..1588e68 100644
--- a/packages/coding-agent/test/computer-tool.test.ts
+++ b/packages/coding-agent/test/computer-tool.test.ts
@@ -79,7 +79,7 @@ function createMockComputerOperations(
function getAgentComputerScriptPath(): string {
return resolve(
process.cwd(),
- "../../../../docker/companion/agent-computer.js",
+ "../../../../docker/clanker/agent-computer.js",
);
}
diff --git a/packages/coding-agent/test/extensions-discovery.test.ts b/packages/coding-agent/test/extensions-discovery.test.ts
index 71598c5..f30261c 100644
--- a/packages/coding-agent/test/extensions-discovery.test.ts
+++ b/packages/coding-agent/test/extensions-discovery.test.ts
@@ -12,7 +12,7 @@ describe("extensions discovery", () => {
let extensionsDir: string;
beforeEach(() => {
- tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "companion-ext-test-"));
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "clanker-ext-test-"));
extensionsDir = path.join(tempDir, "extensions");
fs.mkdirSync(extensionsDir);
});
@@ -22,15 +22,15 @@ describe("extensions discovery", () => {
});
const extensionCode = `
- export default function(companion) {
- companion.registerCommand("test", { handler: async () => {} });
+ export default function(clanker) {
+ clanker.registerCommand("test", { handler: async () => {} });
}
`;
const extensionCodeWithTool = (toolName: string) => `
import { Type } from "@sinclair/typebox";
- export default function(companion) {
- companion.registerTool({
+ export default function(clanker) {
+ clanker.registerTool({
name: "${toolName}",
label: "${toolName}",
description: "Test tool",
@@ -102,7 +102,7 @@ describe("extensions discovery", () => {
expect(result.extensions[0].path).toContain("index.ts");
});
- it("discovers subdirectory with package.json companion field", async () => {
+ it("discovers subdirectory with package.json clanker field", async () => {
const subdir = path.join(extensionsDir, "my-package");
const srcDir = path.join(subdir, "src");
fs.mkdirSync(subdir);
@@ -112,7 +112,7 @@ describe("extensions discovery", () => {
path.join(subdir, "package.json"),
JSON.stringify({
name: "my-package",
- companion: {
+ clanker: {
extensions: ["./src/main.ts"],
},
}),
@@ -135,7 +135,7 @@ describe("extensions discovery", () => {
path.join(subdir, "package.json"),
JSON.stringify({
name: "my-package",
- companion: {
+ clanker: {
extensions: ["./ext1.ts", "./ext2.ts"],
},
}),
@@ -147,7 +147,7 @@ describe("extensions discovery", () => {
expect(result.extensions).toHaveLength(2);
});
- it("package.json with companion field takes precedence over index.ts", async () => {
+ it("package.json with clanker field takes precedence over index.ts", async () => {
const subdir = path.join(extensionsDir, "my-package");
fs.mkdirSync(subdir);
fs.writeFileSync(
@@ -162,7 +162,7 @@ describe("extensions discovery", () => {
path.join(subdir, "package.json"),
JSON.stringify({
name: "my-package",
- companion: {
+ clanker: {
extensions: ["./custom.ts"],
},
}),
@@ -178,7 +178,7 @@ describe("extensions discovery", () => {
expect(result.extensions[0].tools.has("from-index")).toBe(false);
});
- it("ignores package.json without companion field, falls back to index.ts", async () => {
+ it("ignores package.json without clanker field, falls back to index.ts", async () => {
const subdir = path.join(extensionsDir, "my-package");
fs.mkdirSync(subdir);
fs.writeFileSync(path.join(subdir, "index.ts"), extensionCode);
@@ -238,7 +238,7 @@ describe("extensions discovery", () => {
fs.writeFileSync(path.join(subdir2, "entry.ts"), extensionCode);
fs.writeFileSync(
path.join(subdir2, "package.json"),
- JSON.stringify({ companion: { extensions: ["./entry.ts"] } }),
+ JSON.stringify({ clanker: { extensions: ["./entry.ts"] } }),
);
const result = await discoverAndLoadExtensions([], tempDir, tempDir);
@@ -254,7 +254,7 @@ describe("extensions discovery", () => {
fs.writeFileSync(
path.join(subdir, "package.json"),
JSON.stringify({
- companion: {
+ clanker: {
extensions: ["./exists.ts", "./missing.ts"],
},
}),
@@ -331,8 +331,8 @@ describe("extensions discovery", () => {
`
import { Type } from "@sinclair/typebox";
import ms from "ms";
- export default function(companion) {
- companion.registerTool({
+ export default function(clanker) {
+ clanker.registerTool({
name: "parse_duration",
label: "parse_duration",
description: "Parse a duration string",
@@ -375,8 +375,8 @@ describe("extensions discovery", () => {
it("registers message renderers", async () => {
const extCode = `
- export default function(companion) {
- companion.registerMessageRenderer("my-custom-type", (message, options, theme) => {
+ export default function(clanker) {
+ clanker.registerMessageRenderer("my-custom-type", (message, options, theme) => {
return null; // Use default rendering
});
}
@@ -394,7 +394,7 @@ describe("extensions discovery", () => {
it("reports error when extension throws during initialization", async () => {
const extCode = `
- export default function(companion) {
+ export default function(clanker) {
throw new Error("Initialization failed!");
}
`;
@@ -409,8 +409,8 @@ describe("extensions discovery", () => {
it("reports error when extension has no default export", async () => {
const extCode = `
- export function notDefault(companion) {
- companion.registerCommand("test", { handler: async () => {} });
+ export function notDefault(clanker) {
+ clanker.registerCommand("test", { handler: async () => {} });
}
`;
fs.writeFileSync(path.join(extensionsDir, "no-default.ts"), extCode);
@@ -451,10 +451,10 @@ describe("extensions discovery", () => {
it("loads extension with event handlers", async () => {
const extCode = `
- export default function(companion) {
- companion.on("agent_start", async () => {});
- companion.on("tool_call", async (event) => undefined);
- companion.on("agent_end", async () => {});
+ export default function(clanker) {
+ clanker.on("agent_start", async () => {});
+ clanker.on("tool_call", async (event) => undefined);
+ clanker.on("agent_end", async () => {});
}
`;
fs.writeFileSync(path.join(extensionsDir, "with-handlers.ts"), extCode);
@@ -470,8 +470,8 @@ describe("extensions discovery", () => {
it("loads extension with shortcuts", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+t", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+t", {
description: "Test shortcut",
handler: async (ctx) => {},
});
@@ -488,8 +488,8 @@ describe("extensions discovery", () => {
it("loads extension with flags", async () => {
const extCode = `
- export default function(companion) {
- companion.registerFlag("my-flag", {
+ export default function(clanker) {
+ clanker.registerFlag("my-flag", {
description: "My custom flag",
handler: async (value) => {},
});
diff --git a/packages/coding-agent/test/extensions-input-event.test.ts b/packages/coding-agent/test/extensions-input-event.test.ts
index c664401..9f8927f 100644
--- a/packages/coding-agent/test/extensions-input-event.test.ts
+++ b/packages/coding-agent/test/extensions-input-event.test.ts
@@ -13,7 +13,7 @@ describe("Input Event", () => {
let extensionsDir: string;
beforeEach(() => {
- tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "companion-input-test-"));
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "clanker-input-test-"));
extensionsDir = path.join(tempDir, "extensions");
fs.mkdirSync(extensionsDir);
// Clean globalThis test vars
diff --git a/packages/coding-agent/test/extensions-runner.test.ts b/packages/coding-agent/test/extensions-runner.test.ts
index 24ccf3d..bedea32 100644
--- a/packages/coding-agent/test/extensions-runner.test.ts
+++ b/packages/coding-agent/test/extensions-runner.test.ts
@@ -28,7 +28,7 @@ describe("ExtensionRunner", () => {
let modelRegistry: ModelRegistry;
beforeEach(() => {
- tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "companion-runner-test-"));
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "clanker-runner-test-"));
extensionsDir = path.join(tempDir, "extensions");
fs.mkdirSync(extensionsDir);
sessionManager = SessionManager.inMemory();
@@ -88,8 +88,8 @@ describe("ExtensionRunner", () => {
describe("shortcut conflicts", () => {
it("warns when extension shortcut conflicts with built-in", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+c", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+c", {
description: "Conflicts with built-in",
handler: async () => {},
});
@@ -119,8 +119,8 @@ describe("ExtensionRunner", () => {
it("allows a shortcut when the reserved set no longer contains the default key", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+p", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+p", {
description: "Uses freed default",
handler: async () => {},
});
@@ -154,8 +154,8 @@ describe("ExtensionRunner", () => {
it("warns but allows when extension uses non-reserved built-in shortcut", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+v", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+v", {
description: "Overrides non-reserved",
handler: async () => {},
});
@@ -185,8 +185,8 @@ describe("ExtensionRunner", () => {
it("blocks shortcuts for reserved actions even when rebound", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+x", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+x", {
description: "Conflicts with rebound reserved",
handler: async () => {},
});
@@ -223,8 +223,8 @@ describe("ExtensionRunner", () => {
it("blocks shortcuts when reserved action has multiple keys", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+y", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+y", {
description: "Conflicts with multi-key reserved",
handler: async () => {},
});
@@ -258,8 +258,8 @@ describe("ExtensionRunner", () => {
it("warns but allows when non-reserved action has multiple keys", async () => {
const extCode = `
- export default function(companion) {
- companion.registerShortcut("ctrl+y", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+y", {
description: "Overrides multi-key non-reserved",
handler: async () => {},
});
@@ -297,16 +297,16 @@ describe("ExtensionRunner", () => {
it("warns when two extensions register same shortcut", async () => {
// Use a non-reserved shortcut
const extCode1 = `
- export default function(companion) {
- companion.registerShortcut("ctrl+shift+x", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+shift+x", {
description: "First extension",
handler: async () => {},
});
}
`;
const extCode2 = `
- export default function(companion) {
- companion.registerShortcut("ctrl+shift+x", {
+ export default function(clanker) {
+ clanker.registerShortcut("ctrl+shift+x", {
description: "Second extension",
handler: async () => {},
});
@@ -341,8 +341,8 @@ describe("ExtensionRunner", () => {
it("collects tools from multiple extensions", async () => {
const toolCode = (name: string) => `
import { Type } from "@sinclair/typebox";
- export default function(companion) {
- companion.registerTool({
+ export default function(clanker) {
+ clanker.registerTool({
name: "${name}",
label: "${name}",
description: "Test tool",
@@ -380,8 +380,8 @@ describe("ExtensionRunner", () => {
it("keeps first tool when two extensions register the same name", async () => {
const first = `
import { Type } from "@sinclair/typebox";
- export default function(companion) {
- companion.registerTool({
+ export default function(clanker) {
+ clanker.registerTool({
name: "shared",
label: "shared",
description: "first",
@@ -392,8 +392,8 @@ describe("ExtensionRunner", () => {
`;
const second = `
import { Type } from "@sinclair/typebox";
- export default function(companion) {
- companion.registerTool({
+ export default function(clanker) {
+ clanker.registerTool({
name: "shared",
label: "shared",
description: "second",
@@ -423,8 +423,8 @@ describe("ExtensionRunner", () => {
describe("command collection", () => {
it("collects commands from multiple extensions", async () => {
const cmdCode = (name: string) => `
- export default function(companion) {
- companion.registerCommand("${name}", {
+ export default function(clanker) {
+ clanker.registerCommand("${name}", {
description: "Test command",
handler: async () => {},
});
@@ -449,8 +449,8 @@ describe("ExtensionRunner", () => {
it("gets command by name", async () => {
const cmdCode = `
- export default function(companion) {
- companion.registerCommand("my-cmd", {
+ export default function(clanker) {
+ clanker.registerCommand("my-cmd", {
description: "My command",
handler: async () => {},
});
@@ -478,8 +478,8 @@ describe("ExtensionRunner", () => {
it("filters out commands conflict with reseved", async () => {
const cmdCode = (name: string) => `
- export default function(companion) {
- companion.registerCommand("${name}", {
+ export default function(clanker) {
+ clanker.registerCommand("${name}", {
description: "Test command",
handler: async () => {},
});
@@ -517,8 +517,8 @@ describe("ExtensionRunner", () => {
describe("error handling", () => {
it("calls error listeners when handler throws", async () => {
const extCode = `
- export default function(companion) {
- companion.on("context", async () => {
+ export default function(clanker) {
+ clanker.on("context", async () => {
throw new Error("Handler error!");
});
}
@@ -555,8 +555,8 @@ describe("ExtensionRunner", () => {
describe("message renderers", () => {
it("gets message renderer by type", async () => {
const extCode = `
- export default function(companion) {
- companion.registerMessageRenderer("my-type", (message, options, theme) => null);
+ export default function(clanker) {
+ clanker.registerMessageRenderer("my-type", (message, options, theme) => null);
}
`;
fs.writeFileSync(path.join(extensionsDir, "renderer.ts"), extCode);
@@ -581,8 +581,8 @@ describe("ExtensionRunner", () => {
describe("flags", () => {
it("collects flags from extensions", async () => {
const extCode = `
- export default function(companion) {
- companion.registerFlag("my-flag", {
+ export default function(clanker) {
+ clanker.registerFlag("my-flag", {
description: "My flag",
handler: async () => {},
});
@@ -605,8 +605,8 @@ describe("ExtensionRunner", () => {
it("keeps first flag when two extensions register the same name", async () => {
const first = `
- export default function(companion) {
- companion.registerFlag("shared-flag", {
+ export default function(clanker) {
+ clanker.registerFlag("shared-flag", {
description: "first",
type: "boolean",
default: true,
@@ -614,8 +614,8 @@ describe("ExtensionRunner", () => {
}
`;
const second = `
- export default function(companion) {
- companion.registerFlag("shared-flag", {
+ export default function(clanker) {
+ clanker.registerFlag("shared-flag", {
description: "second",
type: "boolean",
default: false,
@@ -641,8 +641,8 @@ describe("ExtensionRunner", () => {
it("can set flag values", async () => {
const extCode = `
- export default function(companion) {
- companion.registerFlag("test-flag", {
+ export default function(clanker) {
+ clanker.registerFlag("test-flag", {
description: "Test flag",
handler: async () => {},
});
@@ -670,8 +670,8 @@ describe("ExtensionRunner", () => {
describe("tool_result chaining", () => {
it("chains content modifications across handlers", async () => {
const extCode1 = `
- export default function(companion) {
- companion.on("tool_result", async (event) => {
+ export default function(clanker) {
+ clanker.on("tool_result", async (event) => {
return {
content: [...event.content, { type: "text", text: "ext1" }],
};
@@ -679,8 +679,8 @@ describe("ExtensionRunner", () => {
}
`;
const extCode2 = `
- export default function(companion) {
- companion.on("tool_result", async (event) => {
+ export default function(clanker) {
+ clanker.on("tool_result", async (event) => {
return {
content: [...event.content, { type: "text", text: "ext2" }],
};
@@ -726,8 +726,8 @@ describe("ExtensionRunner", () => {
it("preserves previous modifications when later handlers return partial patches", async () => {
const extCode1 = `
- export default function(companion) {
- companion.on("tool_result", async () => {
+ export default function(clanker) {
+ clanker.on("tool_result", async () => {
return {
content: [{ type: "text", text: "first" }],
details: { source: "ext1" },
@@ -736,8 +736,8 @@ describe("ExtensionRunner", () => {
}
`;
const extCode2 = `
- export default function(companion) {
- companion.on("tool_result", async () => {
+ export default function(clanker) {
+ clanker.on("tool_result", async () => {
return {
isError: true,
};
@@ -834,8 +834,8 @@ describe("ExtensionRunner", () => {
describe("hasHandlers", () => {
it("returns true when handlers exist for event type", async () => {
const extCode = `
- export default function(companion) {
- companion.on("tool_call", async () => undefined);
+ export default function(clanker) {
+ clanker.on("tool_call", async () => undefined);
}
`;
fs.writeFileSync(path.join(extensionsDir, "handler.ts"), extCode);
diff --git a/packages/coding-agent/test/footer-width.test.ts b/packages/coding-agent/test/footer-width.test.ts
index 0886c18..3a70ced 100644
--- a/packages/coding-agent/test/footer-width.test.ts
+++ b/packages/coding-agent/test/footer-width.test.ts
@@ -1,4 +1,4 @@
-import { visibleWidth } from "@mariozechner/companion-tui";
+import { visibleWidth } from "@mariozechner/clanker-tui";
import { beforeAll, describe, expect, it } from "vitest";
import type { AgentSession } from "../src/core/agent-session.js";
import type { ReadonlyFooterDataProvider } from "../src/core/footer-data-provider.js";
diff --git a/packages/coding-agent/test/gateway-session-titles.test.ts b/packages/coding-agent/test/gateway-session-titles.test.ts
index 2573e2f..b8deb54 100644
--- a/packages/coding-agent/test/gateway-session-titles.test.ts
+++ b/packages/coding-agent/test/gateway-session-titles.test.ts
@@ -12,7 +12,7 @@ function createMockSession(options?: { sessionName?: string }) {
dispose: vi.fn(),
subscribe: vi.fn(() => () => {}),
sessionManager: {
- getSessionDir: () => "/tmp/companion-gateway-test",
+ getSessionDir: () => "/tmp/clanker-gateway-test",
appendSessionInfo: vi.fn(),
appendLabelChange: vi.fn(),
},
diff --git a/packages/coding-agent/test/gateway-steer.test.ts b/packages/coding-agent/test/gateway-steer.test.ts
index 0a63ca4..696050a 100644
--- a/packages/coding-agent/test/gateway-steer.test.ts
+++ b/packages/coding-agent/test/gateway-steer.test.ts
@@ -13,7 +13,7 @@ function createMockSession() {
dispose: vi.fn(),
subscribe: vi.fn(() => () => {}),
sessionManager: {
- getSessionDir: () => "/tmp/companion-gateway-test",
+ getSessionDir: () => "/tmp/clanker-gateway-test",
},
};
}
diff --git a/packages/coding-agent/test/git-update.test.ts b/packages/coding-agent/test/git-update.test.ts
index cd472ce..4562ba1 100644
--- a/packages/coding-agent/test/git-update.test.ts
+++ b/packages/coding-agent/test/git-update.test.ts
@@ -313,22 +313,22 @@ describe("DefaultPackageManager git update", () => {
.slice(0, 8);
const cachedDir = join(
tmpdir(),
- "companion-extensions",
+ "clanker-extensions",
`git-${gitHost}`,
hash,
gitPath,
);
const extensionFile = join(
cachedDir,
- "companion-extensions",
+ "clanker-extensions",
"session-breakdown.ts",
);
rmSync(cachedDir, { recursive: true, force: true });
- mkdirSync(join(cachedDir, "companion-extensions"), { recursive: true });
+ mkdirSync(join(cachedDir, "clanker-extensions"), { recursive: true });
writeFileSync(
join(cachedDir, "package.json"),
- JSON.stringify({ companion: { extensions: ["./companion-extensions"] } }, null, 2),
+ JSON.stringify({ clanker: { extensions: ["./clanker-extensions"] } }, null, 2),
);
writeFileSync(extensionFile, "// stale");
@@ -353,7 +353,7 @@ describe("DefaultPackageManager git update", () => {
expect(executedCommands).toContain("git fetch --prune origin");
expect(
- getFileContent(cachedDir, "companion-extensions/session-breakdown.ts"),
+ getFileContent(cachedDir, "clanker-extensions/session-breakdown.ts"),
).toBe("// fresh");
});
@@ -366,22 +366,22 @@ describe("DefaultPackageManager git update", () => {
.slice(0, 8);
const cachedDir = join(
tmpdir(),
- "companion-extensions",
+ "clanker-extensions",
`git-${gitHost}`,
hash,
gitPath,
);
const extensionFile = join(
cachedDir,
- "companion-extensions",
+ "clanker-extensions",
"session-breakdown.ts",
);
rmSync(cachedDir, { recursive: true, force: true });
- mkdirSync(join(cachedDir, "companion-extensions"), { recursive: true });
+ mkdirSync(join(cachedDir, "clanker-extensions"), { recursive: true });
writeFileSync(
join(cachedDir, "package.json"),
- JSON.stringify({ companion: { extensions: ["./companion-extensions"] } }, null, 2),
+ JSON.stringify({ clanker: { extensions: ["./clanker-extensions"] } }, null, 2),
);
writeFileSync(extensionFile, "// pinned");
@@ -403,7 +403,7 @@ describe("DefaultPackageManager git update", () => {
expect(executedCommands).toEqual([]);
expect(
- getFileContent(cachedDir, "companion-extensions/session-breakdown.ts"),
+ getFileContent(cachedDir, "clanker-extensions/session-breakdown.ts"),
).toBe("// pinned");
});
});
@@ -418,7 +418,7 @@ describe("DefaultPackageManager git update", () => {
// The project-scope install path should not exist before or after update
const projectGitDir = join(
tempDir,
- ".companion",
+ ".clanker",
"git",
"github.com",
"test",
diff --git a/packages/coding-agent/test/interactive-mode-status.test.ts b/packages/coding-agent/test/interactive-mode-status.test.ts
index dc0650f..cd56487 100644
--- a/packages/coding-agent/test/interactive-mode-status.test.ts
+++ b/packages/coding-agent/test/interactive-mode-status.test.ts
@@ -1,4 +1,4 @@
-import { Container } from "@mariozechner/companion-tui";
+import { Container } from "@mariozechner/clanker-tui";
import { beforeAll, describe, expect, test, vi } from "vitest";
import { InteractiveMode } from "../src/modes/interactive/interactive-mode.js";
import { initTheme } from "../src/modes/interactive/theme/theme.js";
diff --git a/packages/coding-agent/test/model-registry.test.ts b/packages/coding-agent/test/model-registry.test.ts
index 7c2118f..87456a6 100644
--- a/packages/coding-agent/test/model-registry.test.ts
+++ b/packages/coding-agent/test/model-registry.test.ts
@@ -12,9 +12,9 @@ import type {
Context,
Model,
OpenAICompletionsCompat,
-} from "@mariozechner/companion-ai";
-import { getApiProvider } from "@mariozechner/companion-ai";
-import { getOAuthProvider } from "@mariozechner/companion-ai/oauth";
+} from "@mariozechner/clanker-ai";
+import { getApiProvider } from "@mariozechner/clanker-ai";
+import { getOAuthProvider } from "@mariozechner/clanker-ai/oauth";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { AuthStorage } from "../src/core/auth-storage.js";
import { clearApiKeyCache, ModelRegistry } from "../src/core/model-registry.js";
@@ -27,7 +27,7 @@ describe("ModelRegistry", () => {
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-test-model-registry-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-test-model-registry-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
mkdirSync(tempDir, { recursive: true });
modelsJsonPath = join(tempDir, "models.json");
diff --git a/packages/coding-agent/test/model-resolver.test.ts b/packages/coding-agent/test/model-resolver.test.ts
index 2991e49..0ad3793 100644
--- a/packages/coding-agent/test/model-resolver.test.ts
+++ b/packages/coding-agent/test/model-resolver.test.ts
@@ -1,4 +1,4 @@
-import type { Model } from "@mariozechner/companion-ai";
+import type { Model } from "@mariozechner/clanker-ai";
import { describe, expect, test } from "vitest";
import {
defaultModelPerProvider,
diff --git a/packages/coding-agent/test/package-command-paths.test.ts b/packages/coding-agent/test/package-command-paths.test.ts
index 8c85c59..84bb025 100644
--- a/packages/coding-agent/test/package-command-paths.test.ts
+++ b/packages/coding-agent/test/package-command-paths.test.ts
@@ -17,7 +17,7 @@ describe("package commands", () => {
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-package-commands-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-package-commands-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
agentDir = join(tempDir, "agent");
projectDir = join(tempDir, "project");
@@ -89,7 +89,7 @@ describe("package commands", () => {
.map(([message]) => String(message))
.join("\n");
expect(stdout).toContain("Usage:");
- expect(stdout).toContain("companion install [-l]");
+ expect(stdout).toContain("clanker install [-l]");
expect(errorSpy).not.toHaveBeenCalled();
expect(process.exitCode).toBeUndefined();
} finally {
@@ -109,7 +109,7 @@ describe("package commands", () => {
.join("\n");
expect(stderr).toContain('Unknown option --unknown for "install".');
expect(stderr).toContain(
- 'Use "companion --help" or "companion install [-l]".',
+ 'Use "clanker --help" or "clanker install [-l]".',
);
expect(process.exitCode).toBe(1);
} finally {
@@ -127,7 +127,7 @@ describe("package commands", () => {
.map(([message]) => String(message))
.join("\n");
expect(stderr).toContain("Missing install source.");
- expect(stderr).toContain("Usage: companion install [-l]");
+ expect(stderr).toContain("Usage: clanker install [-l]");
expect(stderr).not.toContain("at ");
expect(process.exitCode).toBe(1);
} finally {
diff --git a/packages/coding-agent/test/package-manager.test.ts b/packages/coding-agent/test/package-manager.test.ts
index d399801..5b0668a 100644
--- a/packages/coding-agent/test/package-manager.test.ts
+++ b/packages/coding-agent/test/package-manager.test.ts
@@ -36,8 +36,8 @@ describe("DefaultPackageManager", () => {
let previousOfflineEnv: string | undefined;
beforeEach(() => {
- previousOfflineEnv = process.env.COMPANION_OFFLINE;
- delete process.env.COMPANION_OFFLINE;
+ previousOfflineEnv = process.env.CLANKER_OFFLINE;
+ delete process.env.CLANKER_OFFLINE;
tempDir = join(
tmpdir(),
`pm-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
@@ -56,9 +56,9 @@ describe("DefaultPackageManager", () => {
afterEach(() => {
if (previousOfflineEnv === undefined) {
- delete process.env.COMPANION_OFFLINE;
+ delete process.env.CLANKER_OFFLINE;
} else {
- process.env.COMPANION_OFFLINE = previousOfflineEnv;
+ process.env.CLANKER_OFFLINE = previousOfflineEnv;
}
vi.restoreAllMocks();
vi.unstubAllGlobals();
@@ -114,8 +114,8 @@ Content`,
);
});
- it("should resolve project paths relative to .companion", async () => {
- const extDir = join(tempDir, ".companion", "extensions");
+ it("should resolve project paths relative to .clanker", async () => {
+ const extDir = join(tempDir, ".clanker", "extensions");
mkdirSync(extDir, { recursive: true });
const extPath = join(extDir, "project-ext.ts");
writeFileSync(extPath, "export default function() {}");
@@ -143,7 +143,7 @@ Content`,
});
it("should auto-discover project prompts with overrides", async () => {
- const promptsDir = join(tempDir, ".companion", "prompts");
+ const promptsDir = join(tempDir, ".clanker", "prompts");
mkdirSync(promptsDir, { recursive: true });
const promptPath = join(promptsDir, "is.md");
writeFileSync(promptPath, "Is prompt");
@@ -156,15 +156,15 @@ Content`,
).toBe(true);
});
- it("should resolve directory with package.json companion.extensions in extensions setting", async () => {
- // Create a package with companion.extensions in package.json
+ it("should resolve directory with package.json clanker.extensions in extensions setting", async () => {
+ // Create a package with clanker.extensions in package.json
const pkgDir = join(tempDir, "my-extensions-pkg");
mkdirSync(join(pkgDir, "extensions"), { recursive: true });
writeFileSync(
join(pkgDir, "package.json"),
JSON.stringify({
name: "my-extensions-pkg",
- companion: {
+ clanker: {
extensions: ["./extensions/clip.ts", "./extensions/cost.ts"],
},
}),
@@ -187,7 +187,7 @@ Content`,
const result = await packageManager.resolve();
- // Should find the extensions declared in package.json companion.extensions
+ // Should find the extensions declared in package.json clanker.extensions
expect(
result.extensions.some(
(r) => r.path === join(pkgDir, "extensions", "clip.ts") && r.enabled,
@@ -355,10 +355,10 @@ Content`,
).toBe(false);
});
- it("should not apply parent .gitignore to .companion auto-discovery", async () => {
- writeFileSync(join(tempDir, ".gitignore"), ".companion\n");
+ it("should not apply parent .gitignore to .clanker auto-discovery", async () => {
+ writeFileSync(join(tempDir, ".gitignore"), ".clanker\n");
- const skillDir = join(tempDir, ".companion", "skills", "auto-skill");
+ const skillDir = join(tempDir, ".clanker", "skills", "auto-skill");
mkdirSync(skillDir, { recursive: true });
const skillPath = join(skillDir, "SKILL.md");
writeFileSync(
@@ -384,14 +384,14 @@ Content`,
).toBe(true);
});
- it("should handle directories with companion manifest", async () => {
+ it("should handle directories with clanker manifest", async () => {
const pkgDir = join(tempDir, "my-package");
mkdirSync(pkgDir, { recursive: true });
writeFileSync(
join(pkgDir, "package.json"),
JSON.stringify({
name: "my-package",
- companion: {
+ clanker: {
extensions: ["./src/index.ts"],
skills: ["./skills"],
},
@@ -565,7 +565,7 @@ Content`,
expect(settings.packages?.[0]).toBe(expected);
});
- it("should store project local packages relative to .companion settings base", () => {
+ it("should store project local packages relative to .clanker settings base", () => {
const projectPkgDir = join(tempDir, "project-local-pkg");
mkdirSync(join(projectPkgDir, "extensions"), { recursive: true });
writeFileSync(
@@ -579,7 +579,7 @@ Content`,
expect(added).toBe(true);
const settings = settingsManager.getProjectSettings();
- const rel = relative(join(tempDir, ".companion"), projectPkgDir);
+ const rel = relative(join(tempDir, ".clanker"), projectPkgDir);
const expected = rel.startsWith(".") ? rel : `./${rel}`;
expect(settings.packages?.[0]).toBe(expected);
});
@@ -837,7 +837,7 @@ Content`,
});
});
- describe("pattern filtering in companion manifest", () => {
+ describe("pattern filtering in clanker manifest", () => {
it("should support glob patterns in manifest extensions", async () => {
const pkgDir = join(tempDir, "manifest-pkg");
mkdirSync(join(pkgDir, "extensions"), { recursive: true });
@@ -860,7 +860,7 @@ Content`,
join(pkgDir, "package.json"),
JSON.stringify({
name: "manifest-pkg",
- companion: {
+ clanker: {
extensions: [
"extensions",
"node_modules/dep/extensions",
@@ -898,7 +898,7 @@ Content`,
join(pkgDir, "package.json"),
JSON.stringify({
name: "skill-manifest-pkg",
- companion: {
+ clanker: {
skills: ["skills", "!**/bad-skill"],
},
}),
@@ -936,7 +936,7 @@ Content`,
join(pkgDir, "package.json"),
JSON.stringify({
name: "layered-pkg",
- companion: {
+ clanker: {
extensions: ["extensions", "!**/baz.ts"],
},
}),
@@ -1229,7 +1229,7 @@ Content`,
join(pkgDir, "package.json"),
JSON.stringify({
name: "manifest-force-pkg",
- companion: {
+ clanker: {
extensions: ["extensions", "!**/two.ts", "+extensions/two.ts"],
},
}),
@@ -1515,7 +1515,7 @@ export default function(api) { api.registerTool({ name: "test", description: "te
);
});
- it("should respect package.json companion.extensions manifest in subdirectories", async () => {
+ it("should respect package.json clanker.extensions manifest in subdirectories", async () => {
const pkgDir = join(tempDir, "manifest-subdir-pkg");
mkdirSync(join(pkgDir, "extensions", "custom"), { recursive: true });
@@ -1523,7 +1523,7 @@ export default function(api) { api.registerTool({ name: "test", description: "te
writeFileSync(
join(pkgDir, "extensions", "custom", "package.json"),
JSON.stringify({
- companion: {
+ clanker: {
extensions: ["./main.ts"],
},
}),
@@ -1634,7 +1634,7 @@ export default function(api) { api.registerTool({ name: "test", description: "te
describe("offline mode and network timeouts", () => {
it("should skip installing missing package sources when offline", async () => {
- process.env.COMPANION_OFFLINE = "1";
+ process.env.CLANKER_OFFLINE = "1";
settingsManager.setProjectPackages([
"npm:missing-package",
"git:github.com/example/missing-repo",
@@ -1659,7 +1659,7 @@ export default function(api) { api.registerTool({ name: "test", description: "te
});
it("should skip refreshing temporary git sources when offline", async () => {
- process.env.COMPANION_OFFLINE = "1";
+ process.env.CLANKER_OFFLINE = "1";
const gitSource = "git:github.com/example/repo";
const parsedGitSource = (packageManager as any).parseSource(gitSource);
const installedPath = (packageManager as any).getGitInstallPath(
@@ -1690,7 +1690,7 @@ export default function(api) { api.registerTool({ name: "test", description: "te
});
it("should not call fetch in npmNeedsUpdate when offline", async () => {
- process.env.COMPANION_OFFLINE = "1";
+ process.env.CLANKER_OFFLINE = "1";
const installedPath = join(tempDir, "installed-package");
mkdirSync(installedPath, { recursive: true });
writeFileSync(
diff --git a/packages/coding-agent/test/resource-loader.test.ts b/packages/coding-agent/test/resource-loader.test.ts
index ab7074c..4951b8a 100644
--- a/packages/coding-agent/test/resource-loader.test.ts
+++ b/packages/coding-agent/test/resource-loader.test.ts
@@ -60,7 +60,7 @@ Skill content here.`,
});
it("should ignore extra markdown files in auto-discovered skill dirs", async () => {
- const skillDir = join(agentDir, "skills", "companion-skills", "browser-tools");
+ const skillDir = join(agentDir, "skills", "clanker-skills", "browser-tools");
mkdirSync(skillDir, { recursive: true });
writeFileSync(
join(skillDir, "SKILL.md"),
@@ -102,7 +102,7 @@ Prompt content.`,
it("should prefer project resources over user on name collisions", async () => {
const userPromptsDir = join(agentDir, "prompts");
- const projectPromptsDir = join(cwd, ".companion", "prompts");
+ const projectPromptsDir = join(cwd, ".clanker", "prompts");
mkdirSync(userPromptsDir, { recursive: true });
mkdirSync(projectPromptsDir, { recursive: true });
const userPromptPath = join(userPromptsDir, "commit.md");
@@ -111,7 +111,7 @@ Prompt content.`,
writeFileSync(projectPromptPath, "Project prompt");
const userSkillDir = join(agentDir, "skills", "collision-skill");
- const projectSkillDir = join(cwd, ".companion", "skills", "collision-skill");
+ const projectSkillDir = join(cwd, ".clanker", "skills", "collision-skill");
mkdirSync(userSkillDir, { recursive: true });
mkdirSync(projectSkillDir, { recursive: true });
const userSkillPath = join(userSkillDir, "SKILL.md");
@@ -148,9 +148,9 @@ Project skill`,
) as { name: string; vars?: Record };
baseTheme.name = "collision-theme";
const userThemePath = join(agentDir, "themes", "collision.json");
- const projectThemePath = join(cwd, ".companion", "themes", "collision.json");
+ const projectThemePath = join(cwd, ".clanker", "themes", "collision.json");
mkdirSync(join(agentDir, "themes"), { recursive: true });
- mkdirSync(join(cwd, ".companion", "themes"), { recursive: true });
+ mkdirSync(join(cwd, ".clanker", "themes"), { recursive: true });
writeFileSync(userThemePath, JSON.stringify(baseTheme, null, 2));
if (baseTheme.vars) {
baseTheme.vars.accent = "#ff00ff";
@@ -178,18 +178,18 @@ Project skill`,
it("should keep both extensions loaded when command names collide", async () => {
const userExtDir = join(agentDir, "extensions");
- const projectExtDir = join(cwd, ".companion", "extensions");
+ const projectExtDir = join(cwd, ".clanker", "extensions");
mkdirSync(userExtDir, { recursive: true });
mkdirSync(projectExtDir, { recursive: true });
writeFileSync(
join(projectExtDir, "project.ts"),
- `export default function(companion) {
- companion.registerCommand("deploy", {
+ `export default function(clanker) {
+ clanker.registerCommand("deploy", {
description: "project deploy",
handler: async () => {},
});
- companion.registerCommand("project-only", {
+ clanker.registerCommand("project-only", {
description: "project only",
handler: async () => {},
});
@@ -198,12 +198,12 @@ Project skill`,
writeFileSync(
join(userExtDir, "user.ts"),
- `export default function(companion) {
- companion.registerCommand("deploy", {
+ `export default function(clanker) {
+ clanker.registerCommand("deploy", {
description: "user deploy",
handler: async () => {},
});
- companion.registerCommand("user-only", {
+ clanker.registerCommand("user-only", {
description: "user only",
handler: async () => {},
});
@@ -320,13 +320,13 @@ Content`,
expect(agentsFiles.some((f) => f.path.endsWith("SOUL.md"))).toBe(true);
});
- it("should discover companion context files from the default workspace", async () => {
+ it("should discover clanker context files from the default workspace", async () => {
const workspaceDir = join(tempDir, "workspace");
const appDir = join(tempDir, "apps", "todo-app");
mkdirSync(workspaceDir, { recursive: true });
mkdirSync(appDir, { recursive: true });
writeFileSync(join(workspaceDir, "IDENTITY.md"), "# Identity\n\nPi");
- writeFileSync(join(workspaceDir, "TOOLS.md"), "# Tools\n\nUse ~/.companion");
+ writeFileSync(join(workspaceDir, "TOOLS.md"), "# Tools\n\nUse ~/.clanker");
const loader = new DefaultResourceLoader({ cwd: appDir, agentDir });
await loader.reload();
@@ -338,8 +338,8 @@ Content`,
expect(agentsFiles.some((f) => f.path.endsWith("TOOLS.md"))).toBe(true);
});
- it("should discover SYSTEM.md from cwd/.companion", async () => {
- const piDir = join(cwd, ".companion");
+ it("should discover SYSTEM.md from cwd/.clanker", async () => {
+ const piDir = join(cwd, ".clanker");
mkdirSync(piDir, { recursive: true });
writeFileSync(join(piDir, "SYSTEM.md"), "You are a helpful assistant.");
@@ -350,7 +350,7 @@ Content`,
});
it("should discover APPEND_SYSTEM.md", async () => {
- const piDir = join(cwd, ".companion");
+ const piDir = join(cwd, ".clanker");
mkdirSync(piDir, { recursive: true });
writeFileSync(
join(piDir, "APPEND_SYSTEM.md"),
@@ -528,10 +528,10 @@ Content`,
writeFileSync(
join(ext1Dir, "index.ts"),
`
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function(companion: ExtensionAPI) {
- companion.registerTool({
+export default function(clanker: ExtensionAPI) {
+ clanker.registerTool({
name: "duplicate-tool",
description: "First",
parameters: Type.Object({}),
@@ -543,10 +543,10 @@ export default function(companion: ExtensionAPI) {
writeFileSync(
join(ext2Dir, "index.ts"),
`
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
+import type { ExtensionAPI } from "@mariozechner/clanker-coding-agent";
import { Type } from "@sinclair/typebox";
-export default function(companion: ExtensionAPI) {
- companion.registerTool({
+export default function(clanker: ExtensionAPI) {
+ clanker.registerTool({
name: "duplicate-tool",
description: "Second",
parameters: Type.Object({}),
diff --git a/packages/coding-agent/test/rpc.test.ts b/packages/coding-agent/test/rpc.test.ts
index 39f7eb2..6b6433e 100644
--- a/packages/coding-agent/test/rpc.test.ts
+++ b/packages/coding-agent/test/rpc.test.ts
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
-import type { AgentEvent } from "@mariozechner/companion-agent-core";
+import type { AgentEvent } from "@mariozechner/clanker-agent-core";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { RpcClient } from "../src/modes/rpc/rpc-client.js";
@@ -18,11 +18,11 @@ describe.skipIf(
let sessionDir: string;
beforeEach(() => {
- sessionDir = join(tmpdir(), `companion-rpc-test-${Date.now()}`);
+ sessionDir = join(tmpdir(), `clanker-rpc-test-${Date.now()}`);
client = new RpcClient({
cliPath: join(__dirname, "..", "dist", "cli.js"),
cwd: join(__dirname, ".."),
- env: { COMPANION_CODING_AGENT_DIR: sessionDir },
+ env: { CLANKER_CODING_AGENT_DIR: sessionDir },
provider: "anthropic",
model: "claude-sonnet-4-5",
});
diff --git a/packages/coding-agent/test/sdk-skills.test.ts b/packages/coding-agent/test/sdk-skills.test.ts
index 4dbf333..ce373a2 100644
--- a/packages/coding-agent/test/sdk-skills.test.ts
+++ b/packages/coding-agent/test/sdk-skills.test.ts
@@ -14,12 +14,12 @@ describe("createAgentSession skills option", () => {
beforeEach(() => {
tempDir = join(
tmpdir(),
- `companion-sdk-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-sdk-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
skillsDir = join(tempDir, "skills", "test-skill");
mkdirSync(skillsDir, { recursive: true });
- // Create a test skill in the companion skills directory
+ // Create a test skill in the clanker skills directory
writeFileSync(
join(skillsDir, "SKILL.md"),
`---
diff --git a/packages/coding-agent/test/session-info-modified-timestamp.test.ts b/packages/coding-agent/test/session-info-modified-timestamp.test.ts
index dd54c4d..00e0e0d 100644
--- a/packages/coding-agent/test/session-info-modified-timestamp.test.ts
+++ b/packages/coding-agent/test/session-info-modified-timestamp.test.ts
@@ -47,7 +47,7 @@ describe("SessionInfo.modified", () => {
});
it("uses last user/assistant message timestamp instead of file mtime", async () => {
- const filePath = join(tmpdir(), `companion-session-${Date.now()}-modified.jsonl`);
+ const filePath = join(tmpdir(), `clanker-session-${Date.now()}-modified.jsonl`);
createSessionFile(filePath);
const before = await stat(filePath);
diff --git a/packages/coding-agent/test/session-selector-path-delete.test.ts b/packages/coding-agent/test/session-selector-path-delete.test.ts
index 358882e..e688896 100644
--- a/packages/coding-agent/test/session-selector-path-delete.test.ts
+++ b/packages/coding-agent/test/session-selector-path-delete.test.ts
@@ -2,7 +2,7 @@ import {
DEFAULT_EDITOR_KEYBINDINGS,
EditorKeybindingsManager,
setEditorKeybindings,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
import { beforeAll, beforeEach, describe, expect, it } from "vitest";
import { KeybindingsManager } from "../src/core/keybindings.js";
import type { SessionInfo } from "../src/core/session-manager.js";
diff --git a/packages/coding-agent/test/settings-manager-bug.test.ts b/packages/coding-agent/test/settings-manager-bug.test.ts
index 88c3ebd..33c0e62 100644
--- a/packages/coding-agent/test/settings-manager-bug.test.ts
+++ b/packages/coding-agent/test/settings-manager-bug.test.ts
@@ -7,7 +7,7 @@ import { SettingsManager } from "../src/core/settings-manager.js";
* Tests for the fix to a bug where external file changes to arrays were overwritten.
*
* The bug scenario was:
- * 1. Companion starts with settings.json containing packages: ["npm:some-pkg"]
+ * 1. Clanker starts with settings.json containing packages: ["npm:some-pkg"]
* 2. User externally edits file to packages: []
* 3. User changes an unrelated setting (e.g., theme) via UI
* 4. save() would overwrite packages back to ["npm:some-pkg"] from stale in-memory state
@@ -25,7 +25,7 @@ describe("SettingsManager - External Edit Preservation", () => {
rmSync(testDir, { recursive: true });
}
mkdirSync(agentDir, { recursive: true });
- mkdirSync(join(projectDir, ".companion"), { recursive: true });
+ mkdirSync(join(projectDir, ".clanker"), { recursive: true });
});
afterEach(() => {
@@ -42,15 +42,15 @@ describe("SettingsManager - External Edit Preservation", () => {
settingsPath,
JSON.stringify({
theme: "dark",
- packages: ["npm:companion-mcp-adapter"],
+ packages: ["npm:clanker-mcp-adapter"],
}),
);
- // Companion starts up and loads settings into memory
+ // Clanker starts up and loads settings into memory
const manager = SettingsManager.create(projectDir, agentDir);
- // At this point, globalSettings.packages = ["npm:companion-mcp-adapter"]
- expect(manager.getPackages()).toEqual(["npm:companion-mcp-adapter"]);
+ // At this point, globalSettings.packages = ["npm:clanker-mcp-adapter"]
+ expect(manager.getPackages()).toEqual(["npm:clanker-mcp-adapter"]);
// User externally edits settings.json to remove the package
const currentSettings = JSON.parse(readFileSync(settingsPath, "utf-8"));
@@ -102,7 +102,7 @@ describe("SettingsManager - External Edit Preservation", () => {
});
it("should preserve external project settings changes when updating unrelated project field", async () => {
- const projectSettingsPath = join(projectDir, ".companion", "settings.json");
+ const projectSettingsPath = join(projectDir, ".clanker", "settings.json");
writeFileSync(
projectSettingsPath,
JSON.stringify({
@@ -133,7 +133,7 @@ describe("SettingsManager - External Edit Preservation", () => {
});
it("should let in-memory project changes override external changes for the same project field", async () => {
- const projectSettingsPath = join(projectDir, ".companion", "settings.json");
+ const projectSettingsPath = join(projectDir, ".clanker", "settings.json");
writeFileSync(
projectSettingsPath,
JSON.stringify({
diff --git a/packages/coding-agent/test/settings-manager.test.ts b/packages/coding-agent/test/settings-manager.test.ts
index f78ec06..ac3c1d3 100644
--- a/packages/coding-agent/test/settings-manager.test.ts
+++ b/packages/coding-agent/test/settings-manager.test.ts
@@ -14,7 +14,7 @@ describe("SettingsManager", () => {
rmSync(testDir, { recursive: true });
}
mkdirSync(agentDir, { recursive: true });
- mkdirSync(join(projectDir, ".companion"), { recursive: true });
+ mkdirSync(join(projectDir, ".clanker"), { recursive: true });
});
afterEach(() => {
@@ -35,7 +35,7 @@ describe("SettingsManager", () => {
}),
);
- // Create SettingsManager (simulates companion starting up)
+ // Create SettingsManager (simulates clanker starting up)
const manager = SettingsManager.create(projectDir, agentDir);
// Simulate user editing settings.json externally to add enabledModels
@@ -205,7 +205,7 @@ describe("SettingsManager", () => {
describe("error tracking", () => {
it("should collect and clear load errors via drainErrors", () => {
const globalSettingsPath = join(agentDir, "settings.json");
- const projectSettingsPath = join(projectDir, ".companion", "settings.json");
+ const projectSettingsPath = join(projectDir, ".clanker", "settings.json");
writeFileSync(globalSettingsPath, "{ invalid global json");
writeFileSync(projectSettingsPath, "{ invalid project json");
@@ -219,46 +219,46 @@ describe("SettingsManager", () => {
});
describe("project settings directory creation", () => {
- it("should not create .companion folder when only reading project settings", () => {
- // Create agent dir with global settings, but NO .companion folder in project
+ it("should not create .clanker folder when only reading project settings", () => {
+ // Create agent dir with global settings, but NO .clanker folder in project
const settingsPath = join(agentDir, "settings.json");
writeFileSync(settingsPath, JSON.stringify({ theme: "dark" }));
- // Delete the .companion folder that beforeEach created
- rmSync(join(projectDir, ".companion"), { recursive: true });
+ // Delete the .clanker folder that beforeEach created
+ rmSync(join(projectDir, ".clanker"), { recursive: true });
// Create SettingsManager (reads both global and project settings)
const manager = SettingsManager.create(projectDir, agentDir);
- // .companion folder should NOT have been created just from reading
- expect(existsSync(join(projectDir, ".companion"))).toBe(false);
+ // .clanker folder should NOT have been created just from reading
+ expect(existsSync(join(projectDir, ".clanker"))).toBe(false);
// Settings should still be loaded from global
expect(manager.getTheme()).toBe("dark");
});
- it("should create .companion folder when writing project settings", async () => {
- // Create agent dir with global settings, but NO .companion folder in project
+ it("should create .clanker folder when writing project settings", async () => {
+ // Create agent dir with global settings, but NO .clanker folder in project
const settingsPath = join(agentDir, "settings.json");
writeFileSync(settingsPath, JSON.stringify({ theme: "dark" }));
- // Delete the .companion folder that beforeEach created
- rmSync(join(projectDir, ".companion"), { recursive: true });
+ // Delete the .clanker folder that beforeEach created
+ rmSync(join(projectDir, ".clanker"), { recursive: true });
const manager = SettingsManager.create(projectDir, agentDir);
- // .companion folder should NOT exist yet
- expect(existsSync(join(projectDir, ".companion"))).toBe(false);
+ // .clanker folder should NOT exist yet
+ expect(existsSync(join(projectDir, ".clanker"))).toBe(false);
// Write a project-specific setting
manager.setProjectPackages([{ source: "npm:test-pkg" }]);
await manager.flush();
- // Now .companion folder should exist
- expect(existsSync(join(projectDir, ".companion"))).toBe(true);
+ // Now .clanker folder should exist
+ expect(existsSync(join(projectDir, ".clanker"))).toBe(true);
// And settings file should be created
- expect(existsSync(join(projectDir, ".companion", "settings.json"))).toBe(true);
+ expect(existsSync(join(projectDir, ".clanker", "settings.json"))).toBe(true);
});
});
diff --git a/packages/coding-agent/test/skills.test.ts b/packages/coding-agent/test/skills.test.ts
index 1b2c8ef..f5cb7fa 100644
--- a/packages/coding-agent/test/skills.test.ts
+++ b/packages/coding-agent/test/skills.test.ts
@@ -395,11 +395,11 @@ describe("skills", () => {
});
it("should expand ~ in skillPaths", () => {
- const homeSkillsDir = join(homedir(), ".companion/agent/skills");
+ const homeSkillsDir = join(homedir(), ".clanker/agent/skills");
const { skills: withTilde } = loadSkills({
agentDir: emptyAgentDir,
cwd: emptyCwd,
- skillPaths: ["~/.companion/agent/skills"],
+ skillPaths: ["~/.clanker/agent/skills"],
});
const { skills: withoutTilde } = loadSkills({
agentDir: emptyAgentDir,
diff --git a/packages/coding-agent/test/streaming-render-debug.ts b/packages/coding-agent/test/streaming-render-debug.ts
index a3ba7fa..30e0ea0 100644
--- a/packages/coding-agent/test/streaming-render-debug.ts
+++ b/packages/coding-agent/test/streaming-render-debug.ts
@@ -4,8 +4,8 @@
* Run with: npx tsx test/streaming-render-debug.ts
*/
-import type { AssistantMessage } from "@mariozechner/companion-ai";
-import { ProcessTerminal, TUI } from "@mariozechner/companion-tui";
+import type { AssistantMessage } from "@mariozechner/clanker-ai";
+import { ProcessTerminal, TUI } from "@mariozechner/clanker-tui";
import { readFileSync } from "fs";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
diff --git a/packages/coding-agent/test/system-prompt.test.ts b/packages/coding-agent/test/system-prompt.test.ts
index ff5ae9e..401ad86 100644
--- a/packages/coding-agent/test/system-prompt.test.ts
+++ b/packages/coding-agent/test/system-prompt.test.ts
@@ -103,7 +103,7 @@ describe("buildSystemPrompt", () => {
const prompt = buildSystemPrompt({
contextFiles: [
{
- path: "/home/node/.companion/workspace/USER.md",
+ path: "/home/node/.clanker/workspace/USER.md",
content: "# User\n\nLikes coffee.",
},
],
diff --git a/packages/coding-agent/test/tool-execution-component.test.ts b/packages/coding-agent/test/tool-execution-component.test.ts
index b5f05f0..04e50cf 100644
--- a/packages/coding-agent/test/tool-execution-component.test.ts
+++ b/packages/coding-agent/test/tool-execution-component.test.ts
@@ -1,4 +1,4 @@
-import { Text, type TUI } from "@mariozechner/companion-tui";
+import { Text, type TUI } from "@mariozechner/clanker-tui";
import { Type } from "@sinclair/typebox";
import stripAnsi from "strip-ansi";
import { beforeAll, describe, expect, test } from "vitest";
diff --git a/packages/coding-agent/test/truncate-to-width.test.ts b/packages/coding-agent/test/truncate-to-width.test.ts
index de9632f..dc2765c 100644
--- a/packages/coding-agent/test/truncate-to-width.test.ts
+++ b/packages/coding-agent/test/truncate-to-width.test.ts
@@ -1,4 +1,4 @@
-import { truncateToWidth, visibleWidth } from "@mariozechner/companion-tui";
+import { truncateToWidth, visibleWidth } from "@mariozechner/clanker-tui";
import { describe, expect, it } from "vitest";
/**
diff --git a/packages/coding-agent/test/utilities.ts b/packages/coding-agent/test/utilities.ts
index 79931f7..5f37fd9 100644
--- a/packages/coding-agent/test/utilities.ts
+++ b/packages/coding-agent/test/utilities.ts
@@ -12,13 +12,13 @@ import {
} from "node:fs";
import { homedir, tmpdir } from "node:os";
import { dirname, join } from "node:path";
-import { Agent } from "@mariozechner/companion-agent-core";
+import { Agent } from "@mariozechner/clanker-agent-core";
import {
getModel,
type OAuthCredentials,
type OAuthProvider,
-} from "@mariozechner/companion-ai";
-import { getOAuthApiKey } from "@mariozechner/companion-ai/oauth";
+} from "@mariozechner/clanker-ai";
+import { getOAuthApiKey } from "@mariozechner/clanker-ai/oauth";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
import { createExtensionRuntime } from "../src/core/extensions/loader.js";
@@ -36,10 +36,10 @@ export const API_KEY =
process.env.ANTHROPIC_OAUTH_TOKEN || process.env.ANTHROPIC_API_KEY;
// ============================================================================
-// OAuth API key resolution from ~/.companion/agent/auth.json
+// OAuth API key resolution from ~/.clanker/agent/auth.json
// ============================================================================
-const AUTH_PATH = join(homedir(), ".companion", "agent", "auth.json");
+const AUTH_PATH = join(homedir(), ".clanker", "agent", "auth.json");
type ApiKeyCredential = {
type: "api_key";
@@ -76,7 +76,7 @@ function saveAuthStorage(storage: AuthStorageData): void {
}
/**
- * Resolve API key for a provider from ~/.companion/agent/auth.json
+ * Resolve API key for a provider from ~/.clanker/agent/auth.json
*
* For API key credentials, returns the key directly.
* For OAuth credentials, returns the access token (refreshing if expired and saving back).
@@ -122,18 +122,18 @@ export async function resolveApiKey(
}
/**
- * Check if a provider has credentials in ~/.companion/agent/auth.json
+ * Check if a provider has credentials in ~/.clanker/agent/auth.json
*/
export function hasAuthForProvider(provider: string): boolean {
const storage = loadAuthStorage();
return provider in storage;
}
-/** Path to the real companion agent config directory */
-export const COMPANION_AGENT_DIR = join(homedir(), ".companion", "agent");
+/** Path to the real clanker agent config directory */
+export const CLANKER_AGENT_DIR = join(homedir(), ".clanker", "agent");
/**
- * Get an AuthStorage instance backed by ~/.companion/agent/auth.json
+ * Get an AuthStorage instance backed by ~/.clanker/agent/auth.json
* Use this for tests that need real OAuth credentials.
*/
export function getRealAuthStorage(): AuthStorage {
@@ -220,7 +220,7 @@ export function createTestSession(
): TestSessionContext {
const tempDir = join(
tmpdir(),
- `companion-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
+ `clanker-test-${Date.now()}-${Math.random().toString(36).slice(2)}`,
);
mkdirSync(tempDir, { recursive: true });
diff --git a/packages/coding-agent/test/vercel-ai-stream.test.ts b/packages/coding-agent/test/vercel-ai-stream.test.ts
index 51be722..f1bbd3a 100644
--- a/packages/coding-agent/test/vercel-ai-stream.test.ts
+++ b/packages/coding-agent/test/vercel-ai-stream.test.ts
@@ -1,5 +1,5 @@
import type { IncomingMessage, ServerResponse } from "node:http";
-import type { AssistantMessage } from "@mariozechner/companion-ai";
+import type { AssistantMessage } from "@mariozechner/clanker-ai";
import { describe, expect, it } from "vitest";
import type { AgentSessionEvent } from "../src/core/agent-session.js";
import {
diff --git a/packages/coding-agent/tsconfig.examples.json b/packages/coding-agent/tsconfig.examples.json
index defd6d1..4fa2fa4 100644
--- a/packages/coding-agent/tsconfig.examples.json
+++ b/packages/coding-agent/tsconfig.examples.json
@@ -3,10 +3,10 @@
"compilerOptions": {
"noEmit": true,
"paths": {
- "@mariozechner/companion-coding-agent": ["./src/index.ts"],
- "@mariozechner/companion-coding-agent/hooks": ["./src/core/hooks/index.ts"],
- "@mariozechner/companion-tui": ["../tui/src/index.ts"],
- "@mariozechner/companion-ai": ["../ai/src/index.ts"],
+ "@mariozechner/clanker-coding-agent": ["./src/index.ts"],
+ "@mariozechner/clanker-coding-agent/hooks": ["./src/core/hooks/index.ts"],
+ "@mariozechner/clanker-tui": ["../tui/src/index.ts"],
+ "@mariozechner/clanker-ai": ["../ai/src/index.ts"],
"@sinclair/typebox": ["../../node_modules/@sinclair/typebox"]
},
"skipLibCheck": true
diff --git a/packages/companion-channels/src/logger.ts b/packages/companion-channels/src/logger.ts
deleted file mode 100644
index 52ee4d4..0000000
--- a/packages/companion-channels/src/logger.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import type { ExtensionAPI } from "@mariozechner/companion-coding-agent";
-
-const CHANNEL = "channels";
-
-export function createLogger(companion: ExtensionAPI) {
- return (event: string, data: unknown, level = "INFO") =>
- companion.events.emit("log", { channel: CHANNEL, event, level, data });
-}
diff --git a/packages/tui/README.md b/packages/tui/README.md
index d28be54..bbfd766 100644
--- a/packages/tui/README.md
+++ b/packages/tui/README.md
@@ -1,4 +1,4 @@
-# @mariozechner/companion-tui
+# @mariozechner/clanker-tui
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications.
@@ -16,7 +16,7 @@ Minimal terminal UI framework with differential rendering and synchronized outpu
## Quick Start
```typescript
-import { TUI, Text, Editor, ProcessTerminal } from "@mariozechner/companion-tui";
+import { TUI, Text, Editor, ProcessTerminal } from "@mariozechner/clanker-tui";
// Create terminal
const terminal = new ProcessTerminal();
@@ -146,7 +146,7 @@ import {
CURSOR_MARKER,
type Component,
type Focusable,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
class MyInput implements Component, Focusable {
focused: boolean = false; // Set by TUI when focus changes
@@ -173,7 +173,7 @@ This enables IME candidate windows to appear at the correct position for CJK inp
**Container components with embedded inputs:** When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child:
```typescript
-import { Container, type Focusable, Input } from "@mariozechner/companion-tui";
+import { Container, type Focusable, Input } from "@mariozechner/clanker-tui";
class SearchDialog extends Container implements Focusable {
private searchInput: Input;
@@ -542,7 +542,7 @@ Supported formats: PNG, JPEG, GIF, WebP. Dimensions are parsed from the image he
Supports both slash commands and file paths.
```typescript
-import { CombinedAutocompleteProvider } from "@mariozechner/companion-tui";
+import { CombinedAutocompleteProvider } from "@mariozechner/clanker-tui";
const provider = new CombinedAutocompleteProvider(
[
@@ -568,7 +568,7 @@ editor.setAutocompleteProvider(provider);
Use `matchesKey()` with the `Key` helper for detecting keyboard input (supports Kitty keyboard protocol):
```typescript
-import { matchesKey, Key } from "@mariozechner/companion-tui";
+import { matchesKey, Key } from "@mariozechner/clanker-tui";
if (matchesKey(data, Key.ctrl("c"))) {
process.exit(0);
@@ -632,7 +632,7 @@ import {
visibleWidth,
truncateToWidth,
wrapTextWithAnsi,
-} from "@mariozechner/companion-tui";
+} from "@mariozechner/clanker-tui";
// Get visible width of string (ignoring ANSI codes)
const width = visibleWidth("\x1b[31mHello\x1b[0m"); // 5
@@ -657,8 +657,8 @@ When creating custom components, **each line returned by `render()` must not exc
Use `matchesKey()` with the `Key` helper for keyboard input:
```typescript
-import { matchesKey, Key, truncateToWidth } from "@mariozechner/companion-tui";
-import type { Component } from "@mariozechner/companion-tui";
+import { matchesKey, Key, truncateToWidth } from "@mariozechner/clanker-tui";
+import type { Component } from "@mariozechner/clanker-tui";
class MyInteractiveComponent implements Component {
private selectedIndex = 0;
@@ -699,8 +699,8 @@ class MyInteractiveComponent implements Component {
Use the provided utilities to ensure lines fit:
```typescript
-import { visibleWidth, truncateToWidth } from "@mariozechner/companion-tui";
-import type { Component } from "@mariozechner/companion-tui";
+import { visibleWidth, truncateToWidth } from "@mariozechner/clanker-tui";
+import type { Component } from "@mariozechner/clanker-tui";
class MyComponent implements Component {
private text: string;
@@ -799,8 +799,8 @@ npx tsx test/chat-simple.ts
### Debug logging
-Set `COMPANION_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
+Set `CLANKER_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
```bash
-COMPANION_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx test/chat-simple.ts
+CLANKER_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx test/chat-simple.ts
```
diff --git a/packages/tui/package.json b/packages/tui/package.json
index 4614460..3b08ba6 100644
--- a/packages/tui/package.json
+++ b/packages/tui/package.json
@@ -1,5 +1,5 @@
{
- "name": "@mariozechner/companion-tui",
+ "name": "@harivansh-afk/clanker-tui",
"version": "0.56.2",
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
"type": "module",
@@ -28,7 +28,7 @@
"license": "MIT",
"repository": {
"type": "git",
- "url": "git+https://github.com/getcompanion-ai/co-mono.git",
+ "url": "git+https://github.com/harivansh-afk/clanker-agent.git",
"directory": "packages/tui"
},
"engines": {
diff --git a/packages/tui/src/terminal.ts b/packages/tui/src/terminal.ts
index 92158a2..e3c2096 100644
--- a/packages/tui/src/terminal.ts
+++ b/packages/tui/src/terminal.ts
@@ -59,7 +59,7 @@ export class ProcessTerminal implements Terminal {
private _kittyProtocolActive = false;
private stdinBuffer?: StdinBuffer;
private stdinDataHandler?: (data: string) => void;
- private writeLogPath = process.env.COMPANION_TUI_WRITE_LOG || "";
+ private writeLogPath = process.env.CLANKER_TUI_WRITE_LOG || "";
get kittyProtocolActive(): boolean {
return this._kittyProtocolActive;
diff --git a/packages/tui/src/tui.ts b/packages/tui/src/tui.ts
index 9ea0aac..ba88f0c 100644
--- a/packages/tui/src/tui.ts
+++ b/packages/tui/src/tui.ts
@@ -227,8 +227,8 @@ export class TUI extends Container {
private hardwareCursorRow = 0; // Actual terminal cursor row (may differ due to IME positioning)
private inputBuffer = ""; // Buffer for parsing terminal responses
private cellSizeQueryPending = false;
- private showHardwareCursor = process.env.COMPANION_HARDWARE_CURSOR === "1";
- private clearOnShrink = process.env.COMPANION_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
+ private showHardwareCursor = process.env.CLANKER_HARDWARE_CURSOR === "1";
+ private clearOnShrink = process.env.CLANKER_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
private maxLinesRendered = 0; // Track terminal's working area (max lines ever rendered)
private previousViewportTop = 0; // Track previous viewport top for resize-aware cursor moves
private fullRedrawCount = 0;
@@ -1009,10 +1009,10 @@ export class TUI extends Container {
this.previousHeight = height;
};
- const debugRedraw = process.env.COMPANION_DEBUG_REDRAW === "1";
+ const debugRedraw = process.env.CLANKER_DEBUG_REDRAW === "1";
const logRedraw = (reason: string): void => {
if (!debugRedraw) return;
- const logPath = path.join(os.homedir(), ".companion", "agent", "companion-debug.log");
+ const logPath = path.join(os.homedir(), ".clanker", "agent", "clanker-debug.log");
const msg = `[${new Date().toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
fs.appendFileSync(logPath, msg);
};
@@ -1035,7 +1035,7 @@ export class TUI extends Container {
// Content shrunk below the working area and no overlays - re-render to clear empty rows
// (overlays need the padding, so only do this when no overlays are active)
- // Configurable via setClearOnShrink() or COMPANION_CLEAR_ON_SHRINK=0 env var
+ // Configurable via setClearOnShrink() or CLANKER_CLEAR_ON_SHRINK=0 env var
if (
this.clearOnShrink &&
newLines.length < this.maxLinesRendered &&
@@ -1180,9 +1180,9 @@ export class TUI extends Container {
// Log all lines to crash file for debugging
const crashLogPath = path.join(
os.homedir(),
- ".companion",
+ ".clanker",
"agent",
- "companion-crash.log",
+ "clanker-crash.log",
);
const crashData = [
`Crash at ${new Date().toISOString()}`,
@@ -1233,7 +1233,7 @@ export class TUI extends Container {
buffer += "\x1b[?2026l"; // End synchronized output
- if (process.env.COMPANION_TUI_DEBUG === "1") {
+ if (process.env.CLANKER_TUI_DEBUG === "1") {
const debugDir = "/tmp/tui";
fs.mkdirSync(debugDir, { recursive: true });
const debugPath = path.join(
diff --git a/packages/tui/test/autocomplete.test.ts b/packages/tui/test/autocomplete.test.ts
index c38b7b4..5a55637 100644
--- a/packages/tui/test/autocomplete.test.ts
+++ b/packages/tui/test/autocomplete.test.ts
@@ -139,7 +139,7 @@ describe("CombinedAutocompleteProvider", () => {
let outsideDir = "";
beforeEach(() => {
- rootDir = mkdtempSync(join(tmpdir(), "companion-autocomplete-root-"));
+ rootDir = mkdtempSync(join(tmpdir(), "clanker-autocomplete-root-"));
baseDir = join(rootDir, "cwd");
outsideDir = join(rootDir, "outside");
mkdirSync(baseDir, { recursive: true });
@@ -339,9 +339,9 @@ describe("CombinedAutocompleteProvider", () => {
test("includes hidden paths but excludes .git", () => {
setupFolder(baseDir, {
- dirs: [".companion", ".github", ".git"],
+ dirs: [".clanker", ".github", ".git"],
files: {
- ".companion/config.json": "{}",
+ ".clanker/config.json": "{}",
".github/workflows/ci.yml": "name: ci",
".git/config": "[core]",
},
@@ -356,7 +356,7 @@ describe("CombinedAutocompleteProvider", () => {
const result = provider.getSuggestions([line], 0, line.length);
const values = result?.items.map((item) => item.value) ?? [];
- assert.ok(values.includes("@.companion/"));
+ assert.ok(values.includes("@.clanker/"));
assert.ok(values.includes("@.github/"));
assert.ok(
!values.some(
@@ -432,7 +432,7 @@ describe("CombinedAutocompleteProvider", () => {
let baseDir = "";
beforeEach(() => {
- baseDir = mkdtempSync(join(tmpdir(), "companion-autocomplete-"));
+ baseDir = mkdtempSync(join(tmpdir(), "clanker-autocomplete-"));
});
afterEach(() => {
diff --git a/public-install.sh b/public-install.sh
index 695bc0d..e551000 100755
--- a/public-install.sh
+++ b/public-install.sh
@@ -3,18 +3,18 @@
set -euo pipefail
# Defaults
-REPO="${COMPANION_REPO:-${CO_MONO_REPO:-getcompanion-ai/co-mono}}"
-VERSION="${COMPANION_VERSION:-${CO_MONO_VERSION:-latest}}"
-INSTALL_DIR="${COMPANION_INSTALL_DIR:-${CO_MONO_INSTALL_DIR:-$HOME/.companion}}"
-BIN_DIR="${COMPANION_BIN_DIR:-${CO_MONO_BIN_DIR:-$HOME/.local/bin}}"
-AGENT_DIR="${COMPANION_AGENT_DIR:-${CO_MONO_AGENT_DIR:-$INSTALL_DIR/agent}}"
-SERVICE_NAME="${COMPANION_SERVICE_NAME:-${CO_MONO_SERVICE_NAME:-companion}}"
-FALLBACK_TO_SOURCE="${COMPANION_FALLBACK_TO_SOURCE:-${CO_MONO_FALLBACK_TO_SOURCE:-1}}"
-SKIP_REINSTALL="${COMPANION_SKIP_REINSTALL:-${CO_MONO_SKIP_REINSTALL:-0}}"
-RUN_INSTALL_PACKAGES="${COMPANION_INSTALL_PACKAGES:-${CO_MONO_INSTALL_PACKAGES:-1}}"
-SETUP_DAEMON="${COMPANION_SETUP_DAEMON:-${CO_MONO_SETUP_DAEMON:-0}}"
-START_DAEMON="${COMPANION_START_DAEMON:-${CO_MONO_START_DAEMON:-0}}"
-SKIP_SERVICE="${COMPANION_SKIP_SERVICE:-${CO_MONO_SKIP_SERVICE:-0}}"
+REPO="${CLANKER_REPO:-${CLANKER_MONO_REPO:-harivansh-afk/clanker-agent}}"
+VERSION="${CLANKER_VERSION:-${CLANKER_MONO_VERSION:-latest}}"
+INSTALL_DIR="${CLANKER_INSTALL_DIR:-${CLANKER_MONO_INSTALL_DIR:-$HOME/.clanker}}"
+BIN_DIR="${CLANKER_BIN_DIR:-${CLANKER_MONO_BIN_DIR:-$HOME/.local/bin}}"
+AGENT_DIR="${CLANKER_AGENT_DIR:-${CLANKER_MONO_AGENT_DIR:-$INSTALL_DIR/agent}}"
+SERVICE_NAME="${CLANKER_SERVICE_NAME:-${CLANKER_MONO_SERVICE_NAME:-clanker}}"
+FALLBACK_TO_SOURCE="${CLANKER_FALLBACK_TO_SOURCE:-${CLANKER_MONO_FALLBACK_TO_SOURCE:-1}}"
+SKIP_REINSTALL="${CLANKER_SKIP_REINSTALL:-${CLANKER_MONO_SKIP_REINSTALL:-0}}"
+RUN_INSTALL_PACKAGES="${CLANKER_INSTALL_PACKAGES:-${CLANKER_MONO_INSTALL_PACKAGES:-1}}"
+SETUP_DAEMON="${CLANKER_SETUP_DAEMON:-${CLANKER_MONO_SETUP_DAEMON:-0}}"
+START_DAEMON="${CLANKER_START_DAEMON:-${CLANKER_MONO_START_DAEMON:-0}}"
+SKIP_SERVICE="${CLANKER_SKIP_SERVICE:-${CLANKER_MONO_SKIP_SERVICE:-0}}"
SERVICE_MANAGER=""
SERVICE_UNIT_PATH=""
SERVICE_LABEL=""
@@ -22,8 +22,8 @@ SERVICE_STDOUT_LOG=""
SERVICE_STDERR_LOG=""
DEFAULT_PACKAGES=(
- "npm:@e9n/companion-channels"
- "npm:companion-teams"
+ "npm:@e9n/clanker-channels"
+ "npm:clanker-teams"
)
declare -a EXTRA_PACKAGES=()
@@ -45,14 +45,14 @@ has() {
usage() {
cat <<'EOF'
Usage:
- curl -fsSL https://raw.githubusercontent.com/getcompanion-ai/co-mono/main/public-install.sh | bash
+ curl -fsSL https://raw.githubusercontent.com/harivansh-afk/clanker-agent/main/public-install.sh | bash
bash public-install.sh [options]
Options:
- --repo Override GitHub repo for install (default: getcompanion-ai/co-mono)
+ --repo Override GitHub repo for install (default: harivansh-afk/clanker-agent)
--version |latest Release tag to install (default: latest)
- --install-dir Target directory for release contents (default: ~/.companion)
- --bin-dir Directory for companion launcher (default: ~/.local/bin)
+ --install-dir Target directory for release contents (default: ~/.clanker)
+ --bin-dir Directory for clanker launcher (default: ~/.local/bin)
--agent-dir Agent config directory (default: /agent)
--package Add package to installation list (repeatable)
--no-default-packages Skip default packages list
@@ -65,12 +65,12 @@ Options:
--help
Env vars:
- COMPANION_INSTALL_PACKAGES=0/1
- COMPANION_SETUP_DAEMON=0/1
- COMPANION_START_DAEMON=0/1
- COMPANION_FALLBACK_TO_SOURCE=0/1
- COMPANION_SKIP_REINSTALL=1
- COMPANION_SERVICE_NAME=
+ CLANKER_INSTALL_PACKAGES=0/1
+ CLANKER_SETUP_DAEMON=0/1
+ CLANKER_START_DAEMON=0/1
+ CLANKER_FALLBACK_TO_SOURCE=0/1
+ CLANKER_SKIP_REINSTALL=1
+ CLANKER_SERVICE_NAME=
EOF
}
@@ -154,7 +154,7 @@ while [[ $# -gt 0 ]]; do
done
if [[ "$FALLBACK_TO_SOURCE" != "0" && "$FALLBACK_TO_SOURCE" != "1" ]]; then
- fail "COMPANION_FALLBACK_TO_SOURCE must be 0 or 1"
+ fail "CLANKER_FALLBACK_TO_SOURCE must be 0 or 1"
fi
if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
@@ -162,7 +162,7 @@ if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
fi
if [[ -z "${SERVICE_NAME:-}" ]]; then
- SERVICE_NAME="companion"
+ SERVICE_NAME="clanker"
fi
download_file() {
@@ -235,9 +235,9 @@ resolve_release_tag() {
platform_assets() {
if [[ "$PLATFORM" == "windows"* ]]; then
- echo "companion-${PLATFORM}.zip"
+ echo "clanker-${PLATFORM}.zip"
else
- echo "companion-${PLATFORM}.tar.gz"
+ echo "clanker-${PLATFORM}.tar.gz"
fi
}
@@ -275,8 +275,8 @@ write_launcher() {
#!/usr/bin/env bash
set -euo pipefail
-export COMPANION_CODING_AGENT_DIR="${AGENT_DIR}"
-export CO_MONO_AGENT_DIR="${AGENT_DIR}"
+export CLANKER_CODING_AGENT_DIR="${AGENT_DIR}"
+export CLANKER_MONO_AGENT_DIR="${AGENT_DIR}"
exec "${runtime_dir}" "\$@"
EOF
@@ -333,7 +333,7 @@ install_packages() {
while IFS= read -r package; do
[[ -z "$package" ]] && continue
- if "$BIN_DIR/companion" install "$package" >/dev/null 2>&1; then
+ if "$BIN_DIR/clanker" install "$package" >/dev/null 2>&1; then
log "Installed package: $package"
else
log "Could not install ${package} now. It will install on first run when available."
@@ -366,14 +366,14 @@ write_service_file() {
${label}ProgramArguments
- ${BIN_DIR}/companion
+ ${BIN_DIR}/clankerdaemonEnvironmentVariables
- CO_MONO_AGENT_DIR
+ CLANKER_MONO_AGENT_DIR${AGENT_DIR}
- COMPANION_CODING_AGENT_DIR
+ CLANKER_CODING_AGENT_DIR${AGENT_DIR}KeepAlive
@@ -408,14 +408,14 @@ EOF
local service_path="$HOME/.config/systemd/user/${SERVICE_NAME}.service"
cat > "$service_path" < Extracting archives for testing..."
for platform in "${PLATFORMS[@]}"; do
rm -rf $platform
if [[ "$platform" == "windows-x64" ]]; then
- mkdir -p $platform && (cd $platform && unzip -q ../companion-$platform.zip)
+ mkdir -p $platform && (cd $platform && unzip -q ../clanker-$platform.zip)
else
- tar -xzf companion-$platform.tar.gz && mv companion $platform
+ tar -xzf clanker-$platform.tar.gz && mv clanker $platform
fi
done
@@ -168,5 +168,5 @@ ls -lh *.tar.gz *.zip 2>/dev/null || true
echo ""
echo "Extracted directories for testing:"
for platform in "${PLATFORMS[@]}"; do
- echo " binaries/$platform/companion"
+ echo " binaries/$platform/clanker"
done
diff --git a/scripts/bundle-sandbox-builtins.mjs b/scripts/bundle-sandbox-builtins.mjs
index 7167f11..ab793c1 100644
--- a/scripts/bundle-sandbox-builtins.mjs
+++ b/scripts/bundle-sandbox-builtins.mjs
@@ -2,34 +2,34 @@ import { mkdir } from "node:fs/promises";
import path from "node:path";
import { build } from "esbuild";
-const sourceRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_SRC
- ? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_SRC)
+const sourceRoot = process.env.CLANKER_BUILTIN_EXTENSIONS_SRC
+ ? path.resolve(process.env.CLANKER_BUILTIN_EXTENSIONS_SRC)
: path.resolve(process.cwd(), "packages");
-const outputRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_OUT
- ? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_OUT)
+const outputRoot = process.env.CLANKER_BUILTIN_EXTENSIONS_OUT
+ ? path.resolve(process.env.CLANKER_BUILTIN_EXTENSIONS_OUT)
: path.resolve(process.cwd(), ".tmp/builtins");
const entries = [
{
- name: "companion-channels",
- entry: path.join(sourceRoot, "companion-channels", "src", "index.ts"),
+ name: "clanker-channels",
+ entry: path.join(sourceRoot, "clanker-channels", "src", "index.ts"),
},
{
- name: "companion-teams",
- entry: path.join(sourceRoot, "companion-teams", "extensions", "index.ts"),
+ name: "clanker-teams",
+ entry: path.join(sourceRoot, "clanker-teams", "extensions", "index.ts"),
},
{
- name: "companion-grind",
- entry: path.join(sourceRoot, "companion-grind", "src", "index.ts"),
+ name: "clanker-grind",
+ entry: path.join(sourceRoot, "clanker-grind", "src", "index.ts"),
},
];
const external = [
- "@mariozechner/companion-agent-core",
- "@mariozechner/companion-ai",
- "@mariozechner/companion-ai/oauth",
- "@mariozechner/companion-coding-agent",
- "@mariozechner/companion-tui",
+ "@harivansh-afk/clanker-agent-core",
+ "@harivansh-afk/clanker-ai",
+ "@harivansh-afk/clanker-ai/oauth",
+ "@harivansh-afk/clanker-coding-agent",
+ "@harivansh-afk/clanker-tui",
"@sinclair/typebox",
];
diff --git a/scripts/cost.ts b/scripts/cost.ts
index fe73800..0578fb0 100755
--- a/scripts/cost.ts
+++ b/scripts/cost.ts
@@ -35,7 +35,7 @@ function encodeSessionDir(dir: string): string {
return "--" + normalized.replace(/\//g, "-") + "--";
}
-const sessionsBase = path.join(process.env.HOME!, ".companion/agent/sessions");
+const sessionsBase = path.join(process.env.HOME!, ".clanker/agent/sessions");
const encodedDir = encodeSessionDir(directory);
const sessionsDir = path.join(sessionsBase, encodedDir);
diff --git a/scripts/release.mjs b/scripts/release.mjs
index a42f9e5..ffe24d5 100755
--- a/scripts/release.mjs
+++ b/scripts/release.mjs
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
- * Release script for companion
+ * Release script for clanker
*
* Usage: node scripts/release.mjs
*
diff --git a/scripts/session-transcripts.ts b/scripts/session-transcripts.ts
index 7810001..5149c80 100644
--- a/scripts/session-transcripts.ts
+++ b/scripts/session-transcripts.ts
@@ -4,7 +4,7 @@
* optionally spawns subagents to analyze patterns.
*
* Usage: npx tsx scripts/session-transcripts.ts [--analyze] [--output ] [cwd]
- * --analyze Spawn companion subagents to analyze each transcript file
+ * --analyze Spawn clanker subagents to analyze each transcript file
* --output Output directory for transcript files (defaults to ./session-transcripts)
* cwd Working directory to extract sessions for (defaults to current)
*/
@@ -94,7 +94,7 @@ function runSubagent(
): Promise<{ success: boolean }> {
return new Promise((resolve) => {
const child = spawn(
- "companion",
+ "clanker",
["--mode", "json", "--tools", "read,write", "-p", prompt],
{
cwd,
@@ -158,7 +158,7 @@ function runSubagent(
});
child.on("error", (err) => {
- console.error(chalk.red(` Failed to spawn companion: ${err.message}`));
+ console.error(chalk.red(` Failed to spawn clanker: ${err.message}`));
resolve({ success: false });
});
});
@@ -188,7 +188,7 @@ async function main() {
const cwd = resolve(cwdArg || process.cwd());
mkdirSync(outputDir, { recursive: true });
- const sessionsBase = join(homedir(), ".companion/agent/sessions");
+ const sessionsBase = join(homedir(), ".clanker/agent/sessions");
const sessionDirName = cwdToSessionDir(cwd);
const sessionDir = join(sessionsBase, sessionDirName);
@@ -281,13 +281,13 @@ async function main() {
if (!analyzeFlag) {
console.log(
- "\nRun with --analyze to spawn companion subagents for pattern analysis.",
+ "\nRun with --analyze to spawn clanker subagents for pattern analysis.",
);
return;
}
// Find AGENTS.md files to compare against
- const globalAgentsMd = join(homedir(), ".companion/agent/AGENTS.md");
+ const globalAgentsMd = join(homedir(), ".clanker/agent/AGENTS.md");
const localAgentsMd = join(cwd, "AGENTS.md");
const agentsMdFiles = [globalAgentsMd, localAgentsMd].filter(existsSync);
const agentsMdSection =
diff --git a/tsconfig.json b/tsconfig.json
index 2ed78fa..b5714a4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -4,25 +4,25 @@
"noEmit": true,
"paths": {
"*": ["./*"],
- "@mariozechner/companion-ai": ["./packages/ai/src/index.ts"],
- "@mariozechner/companion-ai/bedrock-provider": [
+ "@mariozechner/clanker-ai": ["./packages/ai/src/index.ts"],
+ "@mariozechner/clanker-ai/bedrock-provider": [
"./packages/ai/src/bedrock-provider.ts"
],
- "@mariozechner/companion-ai/oauth": ["./packages/ai/src/oauth.ts"],
- "@mariozechner/companion-ai/*": ["./packages/ai/src/*"],
- "@mariozechner/companion-ai/dist/*": ["./packages/ai/src/*"],
- "@mariozechner/companion-agent-core": ["./packages/agent/src/index.ts"],
- "@mariozechner/companion-agent-core/*": ["./packages/agent/src/*"],
- "@mariozechner/companion-coding-agent": ["./packages/coding-agent/src/index.ts"],
- "@mariozechner/companion-coding-agent/hooks": [
+ "@mariozechner/clanker-ai/oauth": ["./packages/ai/src/oauth.ts"],
+ "@mariozechner/clanker-ai/*": ["./packages/ai/src/*"],
+ "@mariozechner/clanker-ai/dist/*": ["./packages/ai/src/*"],
+ "@mariozechner/clanker-agent-core": ["./packages/agent/src/index.ts"],
+ "@mariozechner/clanker-agent-core/*": ["./packages/agent/src/*"],
+ "@mariozechner/clanker-coding-agent": ["./packages/coding-agent/src/index.ts"],
+ "@mariozechner/clanker-coding-agent/hooks": [
"./packages/coding-agent/src/core/hooks/index.ts"
],
- "@mariozechner/companion-coding-agent/*": ["./packages/coding-agent/src/*"],
+ "@mariozechner/clanker-coding-agent/*": ["./packages/coding-agent/src/*"],
"@sinclair/typebox": ["./node_modules/@sinclair/typebox"],
- "@mariozechner/companion-tui": ["./packages/tui/src/index.ts"],
- "@mariozechner/companion-tui/*": ["./packages/tui/src/*"],
- "@mariozechner/companion-agent-old": ["./packages/agent-old/src/index.ts"],
- "@mariozechner/companion-agent-old/*": ["./packages/agent-old/src/*"]
+ "@mariozechner/clanker-tui": ["./packages/tui/src/index.ts"],
+ "@mariozechner/clanker-tui/*": ["./packages/tui/src/*"],
+ "@mariozechner/clanker-agent-old": ["./packages/agent-old/src/index.ts"],
+ "@mariozechner/clanker-agent-old/*": ["./packages/agent-old/src/*"]
}
},
"include": ["packages/*/src/**/*", "packages/*/test/**/*"],