# WispTerm v1.1.0

> **AI Chat gets a lot more powerful:** user-defined slash commands, conversation
> lifecycle commands, and first-class support for the Anthropic (Claude) Messages
> API — so you can point the Agent at Claude, GLM/Zhipu, DeepSeek's `/anthropic`
> endpoint, or any Anthropic-compatible provider.

## Added

- **Custom slash commands.** Drop Markdown files in a `commands/` directory (under the
  config dir, the working directory, or next to the executable) to define your own
  AI-chat slash commands — no rebuild. Each file maps to a built-in action
  (`clear_context` / `restore_session` / `set_permission` / `export_markdown`) or, with
  no `action:`, uses its body as a prompt template. `/reload-commands` rescans them; names
  that collide with a built-in command are ignored.
- **Conversation lifecycle commands.** `/clear` (reset the context, keep the tab),
  `/resume` (open the saved-conversation history picker), `/permission [confirm|full]`
  (view or toggle the agent's tool permission at runtime), and `/export [full|clean]`
  (write the conversation to Markdown, clean by default).
- **Anthropic (Claude) Messages API.** A new `anthropic` protocol talks to
  `<base>/v1/messages` with `x-api-key` + `anthropic-version` auth, content-block tool
  calling (`tool_use` / `tool_result`, `input_schema` tools), and a per-session
  **Max Tokens** setting (default 8192). A base URL containing `api.anthropic.com`
  auto-selects it; other Anthropic-compatible hosts (DeepSeek `…/anthropic`, GLM/Zhipu)
  set it explicitly. Validated end-to-end (request → tool call → tool result → final
  answer) against a live endpoint. Non-streaming in this release.
- **SSH ProxyJump (jump host) support** for saved SSH servers and the `ssh_profile_save`
  Agent tool (#89).
- **MIT LICENSE** added (retaining the original Phantty author's copyright).

## Changed

- **The AI profile Protocol field is now a ←/→ toggle** over `chat_completions` /
  `responses` / `anthropic` — pick a valid value with the arrow keys instead of typing it.

## Fixed

- **Windows:** prevent a shell-spawn crash and fall back gracefully when PowerShell is
  missing (#65).
- **Font:** guard the glyph atlas against degenerate sizes, fixing a crash-on-launch
  caused by a bad DPI / oversized glyph (#90).

## Notes

- Streaming is not yet supported for the `anthropic` protocol (non-streaming only).
- Anthropic base URLs should NOT include a version segment — use `…/anthropic` (the app
  appends `/v1/messages`). A versioned base such as `…/paas/v4` is an OpenAI-compatible
  endpoint and will 404 under the anthropic protocol.
- OpenAI `chat_completions` / `responses` behavior is unchanged.
- macOS remains early — prefer Linux or Windows for daily use.

---

# WispTerm v1.1.0（中文）

> **AI Chat 能力大幅增强：** 用户自定义斜杠命令、对话生命周期命令,以及对
> Anthropic（Claude）Messages API 的一等支持——可将 Agent 指向 Claude、智谱 GLM、
> DeepSeek 的 `/anthropic` 端点或任意 Anthropic 兼容服务。

## 新增

- **自定义斜杠命令。** 在 `commands/` 目录（配置目录、工作目录或可执行文件同级）放入
  Markdown 文件即可定义自己的 AI 斜杠命令,无需重新编译。每个文件可映射到内置动作
  (`clear_context` / `restore_session` / `set_permission` / `export_markdown`),或在不写
  `action:` 时把正文作为 prompt 模板。`/reload-commands` 重新扫描;与内置命令重名的会被忽略。
- **对话生命周期命令。** `/clear`(清空上下文、保留标签页)、`/resume`(打开历史会话
  选择器)、`/permission [confirm|full]`(运行时查看/切换 Agent 工具权限)、
  `/export [full|clean]`(导出对话为 Markdown,默认 clean)。
- **Anthropic（Claude）Messages API。** 新增 `anthropic` 协议,请求 `<base>/v1/messages`,
  使用 `x-api-key` + `anthropic-version` 鉴权,支持 content-block 工具调用
  (`tool_use` / `tool_result`、`input_schema` 工具),以及每会话 **Max Tokens** 设置(默认 8192)。
  base URL 含 `api.anthropic.com` 时自动选用;其他 Anthropic 兼容服务（DeepSeek `…/anthropic`、
  智谱 GLM）需手动选 `anthropic`。已对真实端点端到端验证（请求→工具调用→工具结果→最终回答）。
  本版本为非流式。
- **SSH ProxyJump（跳板机）支持**,适用于已保存的 SSH 服务器与 `ssh_profile_save`
  Agent 工具(#89)。
- 新增 **MIT LICENSE**（保留原 Phantty 作者版权）。

## 变更

- **AI 配置中的 Protocol 字段改为 ←/→ 切换**,在 `chat_completions` / `responses` /
  `anthropic` 之间用方向键选择,不再手动输入。

## 修复

- **Windows:** 修复启动 shell 时崩溃,PowerShell 缺失时优雅回退(#65)。
- **字体:** 对 glyph atlas 的异常尺寸做防护,修复因 DPI 异常 / 超大字形导致的启动崩溃(#90)。

## 说明

- `anthropic` 协议暂不支持流式输出（仅非流式）。
- Anthropic 的 base URL 不要带版本段——用 `…/anthropic`(程序会追加 `/v1/messages`);
  带版本的 base（如 `…/paas/v4`）是 OpenAI 兼容端点,用 anthropic 协议会 404。
- OpenAI `chat_completions` / `responses` 行为不变。
- macOS 仍处于早期阶段,日常使用建议优先 Linux 或 Windows。
