# Changelog

All notable changes to pi-dpi will be documented in this file.

## 0.8.52

- Fix DPI custom picker redraws after every key input, so /dpi and /dpi-extensions no longer appear frozen or retain the editor focus.
- Preserve declared package/built-in extensions that are absent from the content repository registry; exiting the extension manager unchanged no longer removes gateway-manager or triggers a reload.

## 0.8.51

- Uniform thinking levels for gateway models: low/medium/high/max on every model (no per-model fine-tuning); official per-model thinkingLevelMap/compat passthrough removed (relay-station models don't expose them).

## 0.8.50

- Models carry per-model thinkingLevelMap and compat from pi's official model catalog (deepseek-v4: high/max only, kimi-k3: no xhigh, thinkingFormat etc.); reasoning falls back to family rules when the catalog misses.

## 0.8.49

- Minimal add forms: gateway/provider add asks only baseUrl + key (+ API picker); ids derived from URLs, /v1 auto-appended; models imported wholesale.
- Model metadata from pi's official model catalog (~/.pi/agent/models-store.json): contextWindow/maxTokens/reasoning/api win over family rules; family rules as fallback (deepseek-v4 → 1M, gpt-5* → openai-responses).
- Gateway commit scope limited to the target profile; push timeout 30s with fast failure.

## 0.8.48

- Provider add form: base URL + key asked before API type; API type is a picker (no free-text URL mistakes).

## 0.8.47

- Scope gateway commits to the target profile only (never sweep pre-staged session blobs).

## 0.8.46

- Gateway add flow accepts pasted URLs (auto id from host, auto `/v1` baseUrl); provider add gives guidance for URL-like ids.

## 0.8.45

- Gateway profile schema 2: API keys stored directly in the (private) repo; console adds providers with address+key; schema 1 stays compatible.

## 0.8.44

- Gateway commits survive non-fast-forward pushes (pull --rebase --autostash retry) on shared repos.

## 0.8.43

- Content-model `/dpi` console: Agents/Skills/Extensions/Gateways/Sessions/Machines; gateway provider/model management with commit+push.

## 0.8.42

- Fall back to a dpi identity when git user.name/user.email are unset (gateway commits work on fresh machines).

## 0.8.41

- Ensure `profiles/` is in sparse-checkout before gateway add/delete (fixes writes on sparse repos).

## 0.8.40

- Restructure `/dpi` console into three-level navigation: repo list → Skills/Extensions/Gateways → items.
- Fix Esc navigation (category returns to top; per-level hints).

## 0.8.39

- Wire add-repo flow to the repo binder; multi-line SSH key round-trip in credential store.
- Enter on a gateway now performs use; fix commit/push reporting, delete-repo ref, empty-list add.

## 0.8.38

- Add unified `/dpi` console (gateways, repo, skills, extensions list with add/delete/status keys).
- Add local credential store (0600) and gateway profile writer with immediate commit+push.
- Add repo binder for GitHub SSH keys.

## 0.8.37

- Make dpi config writes atomic, backup-recoverable, and concurrency-safe.
- Add `/dpi-repo status|doctor|repair` for idempotent Agent repo recovery.
- Add `/dpi-gateway status|doctor` with credential and `/models` health diagnostics.

## [0.8.35] - 2026-08-05

### Fixed
- Restore the selected gateway provider during initial extension loading, not only after a session event.

## [0.8.34] - 2026-08-05

### Added
- Agent repository gateway profiles with `/dpi-gateway list|use|status|clear`.
- Platform-neutral credential references and dynamic pi provider registration for remote gateways.
- `ser7-cpa` gateway profile support without changing pi-dpi core provider semantics.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.8.33] - 2026-08-03

### Fixed
- GitHub API 探测失败时报告明确错误（403 限速/被拒、超时等），不再误报「No skills/ directory found」

## [0.8.32] - 2026-08-03

### Added
- `/dpi-skills add` 支持完整 `npx skills add <repo> [--skill name]` 命令输入（剥前缀解析，安装仍走纯 GitHub API，不引入 npx CLI）
- 支持 `owner/repo@skill` 简写

### Fixed
- GitHub API 403：fetchUrl 带自定义 User-Agent
- 代理：`--noproxy *` 会禁用 `-x` 显式代理（仅直连模式使用）

## [0.8.31] - 2026-08-03

### Added
- `/dpi-skills add <repo> --skill <name>`：支持分类组织仓库（skills/<cat>/<name>/）精确安装指定 skill
- 递归探测含 SKILL.md 的目录（多候选选择器显示相对路径，区分同名 skill）

## [0.8.30] - 2026-08-03

### Added
- `/dpi-skills` 与 `/dpi-extensions` 一键安装：GitHub 链接自动探测 skill/扩展并入库推送（安装与声明解耦）
- `/dpi-extensions` 支持 npm 包名（pi install npm + 仓库 package.json 依赖记录，跨机器同步）
- CLI 化：`/dpi-skills add <url>`、`/dpi-extensions add <url|pkg>`

## [0.8.29] - 2026-08-03

### Fixed
- First-save upgrades now compare the local session blob with the remote base and fork safely when the old state file has no blob.
- Persist per-session archive paths so forked sessions do not multiply on each timer tick.

## [0.8.28] - 2026-08-03

### Fixed
- Prevent forked sessions from creating a new timestamped archive every 15-minute save; persist each session's actual archive path and use a stable machine/session fork path.
- Session list now shows page totals while filtering and accepts `j/k` navigation during filtering.

## [0.8.27] - 2026-08-03

### Fixed
- `/dpi-sessions`: arrow keys and page navigation now work while `/` filtering is active.
- Session rows show the latest archive update as relative time again; new archives persist the last message timestamp in `session-index.json`, with filename-time fallback for older entries.

## [0.8.22] - 2026-08-01

### Added
- Restore sanitization (`sanitizeSessionForRestore`): generic fix for archived sessions that
  would fail to load or be rejected by the API — consecutive/orphan tool results (compaction
  structure), trailing non-message metadata, bad lines. Verified against all 93 archives +
  9 pi-load tests (including compaction sessions that previously 400'd)
- `/dpi-save [name]` manual savepoint with full feedback (staged status, commit/blob hashes,
  push verification, timing); suckless-style footer status during save/restore
- Session name index (`session-index.json`, synced via git) — names visible across machines
  without fetching blobs; `/dpi-save` open is zero-network (list is local, 3s watcher keeps
  origin/main fresh)
- Per-request fork detection: archive to a new path instead of overwriting another machine's
  version; restore conflict asks overwrite/keep/save-as-new

### Fixed
- Restore produced empty context when the archive ended with `session_info` (pi tree leaf)
- Restore/delete pushes lacked credentials (private repos); gitShow lazy fetch did too
- Large `git show` exceeded execFile's 1MB maxBuffer (256MB now)
- Restore used stale ctx after switchSession (moved notify to withSession)
- Space key in toggle lists was swallowed by page-down
- OAuth scope now includes `workflow` (pushing CI files)

## [0.8.0] - 2026-08-01

### Changed
- **Session storage model**: content repo clones are now sparse (`--filter=blob:none --sparse`),
  `sessions/` never enters the worktree — browsing uses git metadata (ls-tree), restore/rename/
  delete/archive operate on the git object store on demand. Onboarding: ~5s / few MB instead of
  357MB / minutes. Online-only (confirmed).

## [0.7.1] - 2026-08-01

### Added
- First-run onboarding: `/dpi-agent-login` (no args) asks whether you have a content repo —
  offers local initialization (zero-config, single machine) or the forkable starter template;
  startup prompts when unbound
- Bootstrap now runs `git init` so local binds are real git repos

### Fixed
- Space key in toggle mode was intercepted by the page-down branch (could only toggle with Enter)
- Large archives (>2MB) lost their name (session_info lives at the file tail)
- Renaming the current session's archive now also renames the live session
- `features.tablet` references tolerate missing module (ser7 eval crash)

## [Unreleased]

### Added
- Forkable content-repo template (`templates/content-repo/`) and local-bind bootstrap
- GitHub Actions CI (typecheck + vitest)
- peerDependencies declaration (pi >= 0.80.6)

## [0.7.0] - 2026-08-01

### Added
- `/dpi-` prefixed commands (replaces legacy aliases); sessions rename; vim-style list picker with laptop-friendly keys (^D/^U, ^F/^B)
- Remote watch (3s fetch loop) with auto-pull and live Sync status in agent card
- Save-state visibility (archive/push status, pending commits, rebase conflict alerts)
- Strict skills mode (settings.skills = ["!*"]) and extension-bundled skills auto-discovery
- Generic package integration: vendor npm packages via package.json dependencies + auto npm install
- Companion delete: extensions ↔ same-name skills cascade cleanup

### Changed
- UI copy fully English (comments stay Chinese); session cards refresh every 3s without reload
- session-vcs archives commit immediately (no longer dependent on extension order)
- Card shows current Session (name + file), live-updated on rename

### Removed
- Long-term memory mechanism (sessions only); legacy command aliases

[0.7.0]: https://github.com/oc101363-creator/pi-dpi/compare/...TBD
