/** * bermudis-pi-goodies — a bundle of small, frequently-used Pi extensions. * * Composes independent modules, each registering its own commands/hooks * against the shared ExtensionAPI: * - copy-with-model /copy-with-model copy last reply tagged with the model * - copy-trajectory /copy-trajectory copy the whole conversation (text only) to the clipboard * - name-with-ai /name-with-ai generate a session name via the model * - zed /z open Zed on cwd * - prefer-tools hook block legacy tools (trash/uv; blocks rg on glm-5.*) * - keep-model hook preserve the active model across /new * - model-thinking /model-thinking per-model default thinking levels, applied on switch * - clean-tui tool overrides collapse built-in tool output; keep a one-line call header, hide results/diffs until expanded * - review /review, /end-review code review workflow (uncommitted, branch, commit, PR, folder) * - kilo provider access Kilo Gateway models * - provider-balance footer show Kilo credits or Codex quota in the footer * - tps hook notify tokens/sec and usage at each agent turn end * - vision tool ask a vision model targeted questions about an image (self-hides for image-capable models) * - side /side, /side-exit consult a second model on an attributed quote of the session; deliver trajectory/summary/nothing at exit * * Per-model thinking levels were previously provided by a `model-thinking` * module with a `/levels` command and an extension-owned sidecar, retired in * 0.7.0 for pi 0.84.3's native per-model overrides. The native map is only * editable through /settings and the new /thinking persists a global default * only, so a slimmer `model-thinking` module is back: explicit saves to the * same sidecar path (old entries revive), applied on every model switch. */ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import copyTrajectory from "./copy-trajectory.ts"; import copyWithModel from "./copy-with-model.ts"; import kilo from "./kilo.ts"; import keepModelOnNew from "./keep-model-on-new.ts"; import modelThinking from "./model-thinking.ts"; import cleanTui from "./clean-tui.ts"; import review from "./review.ts"; import providerBalance from "./provider-balance.ts"; import tps from "./tps.ts"; import vision from "./vision.ts"; import side from "./side.ts"; import nameWithAi from "./name-with-ai.ts"; import zed from "./zed.ts"; import preferTools from "./prefer-tools.ts"; import goodies, { isEnabled } from "./goodies.ts"; import { setCleanTuiActive } from "./clean-tui.ts"; export default function bermudisPiGoodies(pi: ExtensionAPI): void { // Always register the toggle command first so you can recover even if // another feature is broken. goodies(pi); if (isEnabled("copy-with-model")) copyWithModel(pi); if (isEnabled("copy-trajectory")) copyTrajectory(pi); if (isEnabled("name-with-ai")) nameWithAi(pi); if (isEnabled("zed")) zed(pi); if (isEnabled("prefer-tools")) preferTools(pi); if (isEnabled("keep-model")) keepModelOnNew(pi); if (isEnabled("model-thinking")) modelThinking(pi); // clean-tui reads its config here, at load: when disabled, nothing is // registered and pi's own tools stay fully native; the flag is cleared so // pi-codex's integration renders natively too (a toggle needs /reload). if (isEnabled("clean-tui")) cleanTui(pi); else setCleanTuiActive(false); if (isEnabled("review")) review(pi); if (isEnabled("provider-balance")) providerBalance(pi); if (isEnabled("kilo")) kilo(pi); if (isEnabled("tps")) tps(pi); if (isEnabled("vision")) vision(pi); if (isEnabled("side")) side(pi); }