@oh-my-pi/pi-coding-agent 16.0.1 → 16.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +0 -1
  3. package/dist/cli.js +316 -371
  4. package/dist/types/advisor/advise-tool.d.ts +30 -1
  5. package/dist/types/commands/install.d.ts +1 -1
  6. package/dist/types/config/model-resolver.d.ts +22 -0
  7. package/dist/types/config/settings-schema.d.ts +0 -10
  8. package/dist/types/eval/js/shared/runtime.d.ts +1 -0
  9. package/dist/types/eval/js/worker-core.d.ts +1 -0
  10. package/dist/types/exec/non-interactive-env.d.ts +2 -0
  11. package/dist/types/extensibility/extensions/loader.d.ts +2 -2
  12. package/dist/types/goals/runtime.d.ts +0 -1
  13. package/dist/types/mcp/tool-bridge.d.ts +3 -0
  14. package/dist/types/modes/components/custom-editor.d.ts +14 -4
  15. package/dist/types/modes/controllers/command-controller.d.ts +1 -1
  16. package/dist/types/modes/interactive-mode.d.ts +1 -1
  17. package/dist/types/modes/setup-wizard/wizard-overlay.d.ts +3 -2
  18. package/dist/types/modes/theme/mermaid-cache.d.ts +18 -1
  19. package/dist/types/modes/types.d.ts +1 -1
  20. package/dist/types/registry/agent-lifecycle.d.ts +16 -1
  21. package/dist/types/sdk.d.ts +8 -0
  22. package/dist/types/session/agent-session.d.ts +20 -8
  23. package/dist/types/session/messages.d.ts +3 -0
  24. package/dist/types/session/session-dump-format.d.ts +8 -2
  25. package/dist/types/session/session-entries.d.ts +4 -0
  26. package/dist/types/session/session-history-format.d.ts +2 -0
  27. package/dist/types/session/session-manager.d.ts +22 -0
  28. package/dist/types/stt/downloader.d.ts +5 -5
  29. package/dist/types/task/executor.d.ts +6 -0
  30. package/dist/types/task/persisted-revive.d.ts +36 -0
  31. package/dist/types/tiny/models.d.ts +8 -0
  32. package/dist/types/tools/builtin-names.d.ts +1 -1
  33. package/dist/types/tools/index.d.ts +0 -1
  34. package/dist/types/utils/markit.d.ts +8 -0
  35. package/package.json +12 -12
  36. package/src/advisor/__tests__/advisor.test.ts +156 -12
  37. package/src/advisor/advise-tool.ts +48 -6
  38. package/src/advisor/runtime.ts +10 -3
  39. package/src/auto-thinking/classifier.ts +12 -3
  40. package/src/cli/args.ts +1 -0
  41. package/src/cli.ts +2 -2
  42. package/src/commands/install.ts +3 -3
  43. package/src/config/model-resolver.ts +63 -12
  44. package/src/config/settings-schema.ts +0 -11
  45. package/src/discovery/github.ts +89 -1
  46. package/src/eval/agent-bridge.ts +2 -0
  47. package/src/eval/js/context-manager.ts +2 -1
  48. package/src/eval/js/shared/runtime.ts +189 -15
  49. package/src/eval/js/worker-core.ts +19 -0
  50. package/src/exec/bash-executor.ts +2 -2
  51. package/src/exec/non-interactive-env.ts +71 -0
  52. package/src/export/html/index.ts +1 -1
  53. package/src/export/html/tool-views.generated.js +34 -35
  54. package/src/extensibility/extensions/loader.ts +21 -9
  55. package/src/extensibility/extensions/runner.ts +17 -1
  56. package/src/extensibility/plugins/loader.ts +154 -21
  57. package/src/extensibility/plugins/manager.ts +40 -33
  58. package/src/goals/runtime.ts +1 -23
  59. package/src/internal-urls/docs-index.generated.ts +9 -11
  60. package/src/main.ts +20 -0
  61. package/src/mcp/render.ts +11 -1
  62. package/src/mcp/tool-bridge.ts +3 -0
  63. package/src/modes/components/custom-editor.test.ts +63 -18
  64. package/src/modes/components/custom-editor.ts +63 -15
  65. package/src/modes/controllers/command-controller.ts +2 -2
  66. package/src/modes/controllers/input-controller.ts +15 -9
  67. package/src/modes/controllers/selector-controller.ts +13 -8
  68. package/src/modes/controllers/tan-command-controller.ts +1 -0
  69. package/src/modes/interactive-mode.ts +4 -2
  70. package/src/modes/setup-wizard/wizard-overlay.ts +26 -4
  71. package/src/modes/theme/mermaid-cache.ts +74 -11
  72. package/src/modes/theme/theme.ts +14 -1
  73. package/src/modes/types.ts +1 -1
  74. package/src/prompts/system/system-prompt.md +2 -1
  75. package/src/registry/agent-lifecycle.ts +60 -8
  76. package/src/sdk.ts +20 -26
  77. package/src/session/agent-session.ts +381 -110
  78. package/src/session/artifacts.ts +19 -1
  79. package/src/session/messages.ts +1 -1
  80. package/src/session/session-dump-format.ts +167 -23
  81. package/src/session/session-entries.ts +4 -0
  82. package/src/session/session-history-format.ts +37 -3
  83. package/src/session/session-manager.ts +94 -4
  84. package/src/slash-commands/builtin-registry.ts +4 -7
  85. package/src/stt/asr-client.ts +6 -0
  86. package/src/stt/downloader.ts +13 -6
  87. package/src/stt/stt-controller.ts +52 -11
  88. package/src/system-prompt.ts +7 -1
  89. package/src/task/executor.ts +118 -6
  90. package/src/task/index.ts +2 -2
  91. package/src/task/persisted-revive.ts +128 -0
  92. package/src/tiny/models.ts +10 -0
  93. package/src/tiny/worker.ts +4 -3
  94. package/src/tools/builtin-names.ts +0 -1
  95. package/src/tools/index.ts +0 -4
  96. package/src/tools/output-meta.ts +17 -3
  97. package/src/utils/lang-from-path.ts +5 -0
  98. package/src/utils/markit.ts +24 -1
  99. package/src/utils/title-generator.ts +4 -4
  100. package/dist/types/tools/render-mermaid.d.ts +0 -38
  101. package/src/prompts/tools/render-mermaid.md +0 -9
  102. package/src/tools/render-mermaid.ts +0 -69
package/CHANGELOG.md CHANGED
@@ -2,6 +2,76 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.0.3] - 2026-06-16
6
+
7
+ ### Added
8
+
9
+ - Added support for LaTeX color commands (`\textcolor`, `\colorbox`, and `\fcolorbox`) in user-visible terminal prose and final chat to colorize output
10
+
11
+ ### Changed
12
+
13
+ - Changed STT dependency setup to validate recorder and model assets per `stt.modelName`, so switching speech models re-runs dependency checks and downloads for the new model
14
+ - Changed STT startup with cached models to warm the speech model in the background and defer full model loading until transcription begins, reducing push-to-talk start latency
15
+ - Allowed user-visible terminal and final-chat responses to include LaTeX math delimiters/commands and Mermaid ` ```mermaid ` diagrams
16
+ - Changed the hold-`Space` push-to-talk gesture to recognize a held bar from the *regularity* of the OS key auto-repeat rather than a raw space count or speed alone, so it no longer spams the editor, no longer eats deliberate space taps, and no longer triggers when the bar is smashed. Recording starts only after two consecutive inter-space deltas are "mechanical" — both fast (within ~120 ms) and near-identical, the metronomic signature of auto-repeat; the few pre-burst spaces typed are then tracked back out. Smashing (fast but jittery) and deliberate spacing (steady but slow) both keep typing real spaces and never start recording.
17
+ - Updated markdown Mermaid rendering to color ASCII diagrams with the active theme and automatically choose a narrower layout that better fits the terminal width
18
+ - Made the watched-session transcript sent to the advisor (and shown by `/advisor dump`) clearer: each turn now opens with a `### Session update` heading; watched-agent roles render as inline `**agent**:` / `**user**:` labels instead of level-2 headings that collided with the advisor's own turns; consecutive same-role messages collapse under one label (the watched agent emits one assistant message per tool call); and batched updates are joined by a blank line rather than a `---` rule.
19
+ - Changed the compact transcript tool-intent prefix (`history://`, `/advisor dump`) from `# ` to `// ` so intent lines read as comments instead of rendering as Markdown H1 headings.
20
+ - Changed the advisor advice injected into the primary transcript from a `Advisor (...): - [severity] note` prose block to one `<advisory severity="…" guidance="weigh, don't blindly obey">…</advisory>` element per note, with XML-escaped bodies. (Relocated the shared `escapeXmlText` helper to `@oh-my-pi/pi-utils`.)
21
+ - Reverted `/dump` and `/advisor dump raw` to the pre-16.x full verbose dump: system prompt, model/thinking config, tool inventory with parameters, and the message transcript rendered with markdown role headings (`## User`, `## Assistant`, `### Tool Call: <name>` with the call's `_i` intent as a `//` comment under the heading and the remaining arguments as a fenced YAML block, `### Tool Result: <name>`, plus `## Bash Execution`/`## File Mention`/summary sections) instead of the model's native-dialect turn envelopes and `<invoke>`/`<parameter>` XML tool calls. Dropped the compact default and the `[raw]` flag on `/dump`; the compact `→ tool(...) ⇒ ok` history format is no longer reachable from `/dump`. `/advisor dump` still defaults to compact, and `/advisor dump raw` now renders the same markdown dump (previously the model's native-dialect envelopes).
22
+
23
+ ### Fixed
24
+
25
+ - Fixed Whisper STT cache detection to require both encoder and decoder `.onnx` files, so partial model downloads now trigger a proper foreground download instead of being treated as fully cached
26
+ - Fixed same-process `JsRuntime` cleanup so disposing an older inline/direct runtime no longer deletes a newer runtime's JS helper globals; inactive cmux/direct runtimes now re-activate their globals before sequential use while overlapping cross-runtime runs fail explicitly.
27
+ - Fixed magic-keyword steering notices (`ultrathink-notice`, `orchestrate-notice`, `workflow-notice`) to be prepended before the related user message so they influence that same turn
28
+ - Fixed dequeuing or popping queued user messages to remove their preceding hidden magic-keyword notice companions, preventing orphaned queued notices
29
+ - Fixed queued user steers to auto-resume after interrupts even when the transcript tail is a preserved advisor card or other non-conversational custom message
30
+ - Fixed queued user follow-up messages to remain queued after an interrupt and only run on explicit resume, even when an IRC wake leaves a provider-valid tail
31
+ - Fixed stranded IRC asides to wake a response turn after interruption instead of remaining pending
32
+ - Fixed accepted IRC asides to be flushed into the transcript during disposal instead of being discarded
33
+ - Fixed interactive submissions made while the TUI had no active input waiter: they now start a real prompt directly, with steer fallback if a background turn races in, instead of queueing behind a non-resumable idle transcript and appearing to do nothing.
34
+ - Fixed pressing Esc (or Alt+Up dequeue) while agent-authored messages were queued — advisor concern/blocker notes, hidden goal/plan/budget steers, IRC/extension asides — dumping their text into the user's editor. Editor restoration (`clearQueue()`), pending chips (`getQueuedMessages()`), and `popLastQueuedMessage()` now surface only genuinely user-authored queued messages (plain user turns and `attribution: "user"` custom messages like `/skill`). Plain Alt+Up dequeue leaves all other queued messages in place for the continuing stream; only the Esc interrupt path keeps just advisor cards (so abort's preservation still re-records them as visible advice) and drops other internal steers, so a user interrupt can't be silently undone by an auto-resume on leftover internal context. `queuedMessageCount` still reflects all actual queued work (advisor cards included) so `hasPendingMessages()`/RPC and the empty-submit abort gate stay accurate.
35
+ - Fixed advisor `concern`/`blocker` advice being withheld from the running agent and then dumped as one burst at the next user prompt after a deliberate interrupt. A user interrupt latches advisor auto-resume suppression, but a non-user resume (synthetic/auto-continue, or a queued steer draining after the abort) leaves the run streaming with that latch still set, so every interrupting note was parked hidden in the next-turn queue instead of steered into the live turn — the agent never heard the advisor mid-run and the backlog flushed all at once on the next prompt. Suppression now only withholds interrupting advice while the agent is idle (or still tearing the interrupted turn down); once a turn is streaming again the note is steered in live, since steering an active run never auto-resumes a stopped one. A concern that strands in the steer queue past the resumed turn's final poll is reclaimed as visible advice when the agent settles (mirroring abort), so it neither auto-resumes the stopped run nor lingers to flush at the next prompt.
36
+ - Fixed `omp --continue`/`-c` sometimes resuming into a subagent transcript instead of the interactive session. Subagent (and HTML-export) `SessionManager.open()` calls run in the parent's terminal and were clobbering the per-TTY `--continue` breadcrumb with their own artifact-dir session file; these headless opens now suppress the breadcrumb. `continueRecent()` also recovers already-poisoned breadcrumbs by resolving any session file inside a parent's artifacts dir (`<parent>/<agentId>.jsonl`) back up to the top-level session.
37
+ - Fixed the Agent Hub stacking duplicate `Agent Hub · N running` frames and stranding garbage rows in scrollback while navigating with subagents still streaming. The hub was a non-fullscreen overlay composited over a live transcript, so each time a running subagent's progress grew the frame and scrolled the window the previously-painted hub copy was pushed permanently into the terminal's native scrollback (which the engine can't rewrite). It now renders inline in the editor slot — the same anchored region every other selector and the `ask` tool use — riding the normal append-only commit path, so the transcript commits above it exactly once and the hub repaints in place instead of leaking copies. (Avoids borrowing the alternate screen.)
38
+ - Fixed every subagent registering itself as its own parent in the agent registry (`parentId === id`), so the Agent Hub rendered each agent as `sub · of <itself>` and the ←← parent-navigation gesture looped on the same agent. The SDK was reusing `parentTaskPrefix` — the agent's own artifact/output-id prefix — as the registry parent link; spawns now pass a separate `parentAgentId` (the spawning agent's id: `Main` for top-level `task` spawns, the parent subagent for nested spawns and eval `agent()`, the focused agent for `/tan`) and the registry records that as the parent.
39
+ - Fixed messaging a `parked` subagent that was restored from disk (Agent Hub scan, or a resumed/restarted session) failing with `cannot be revived (no reviver registered)` even though its transcript was intact. Such refs carry a session file but no in-memory reviver — the executor's live reviver closure dies with the spawning turn/process — so IRC sends and Agent Hub focus refused them. `AgentLifecycleManager.ensureLive` now cold-revives them through a persisted-subagent reviver factory (installed by the top-level interactive/RPC session) that rebuilds the subagent from its JSONL the way `--resume` rebuilds a session: it reopens the file and replays it through `createAgentSession`, but sources the runtime contract from a now-readable `session_init` record (`SessionManager.peekSessionInit`) so tools, system prompt, output schema, and kind are restored rather than resurrected as a default top-level session. `session_init` now also persists the effective `spawns` allowlist and read-summarization flag so a cold revive keeps the original capability surface (old files without them deny re-spawning rather than defaulting to wildcard). Isolated runs and pre-`session_init` files whose recorded workspace no longer exists stay transcript-only (`history://`).
40
+ - Fixed the terminal window-title OSC writes (`setTerminalTitle`/`pushTerminalTitle`/`popTerminalTitle`) leaking escape sequences to a developer's terminal during `bun test`; they now skip when the terminal is headless (the test-runtime default), matching the `ProcessTerminal` render/probe suppression so interactive-mode tests no longer paint to the real terminal
41
+ - Fixed empty CLI sessions being retained after opening `omp` and exiting without a prompt ([#2800](https://github.com/can1357/oh-my-pi/issues/2800)).
42
+ - Fixed `hooks/pre/*.ts` and `hooks/post/*.ts` files discovered through `hookCapability` being registered in discovery but never loaded into the extension runner, so their `tool_call` handlers now run without a manual `settings.json` `extensions` entry ([#2796](https://github.com/can1357/oh-my-pi/issues/2796)).
43
+ - Fixed startup model fallback choosing the plain OpenAI `gpt-5.5` provider before the Codex OAuth provider when both shared the same default model id, which could surface a misleading OpenAI 401 despite valid Codex credentials ([#2807](https://github.com/can1357/oh-my-pi/issues/2807)).
44
+ - Fixed local auto-thinking classification for reasoning-capable tiny models by giving them the same safe answer budget as online reasoning classifiers, with a larger local floor for non-reasoning tiny models ([#2808](https://github.com/can1357/oh-my-pi/issues/2808)).
45
+
46
+ ### Removed
47
+
48
+ - Removed the built-in `render_mermaid` tool and its `renderMermaid.enabled` setting, so it can no longer be invoked directly
49
+
50
+ ## [16.0.2] - 2026-06-16
51
+
52
+ ### Added
53
+
54
+ - Added the `UMANS_WEBSEARCH_PROVIDER` environment variable to CLI help for Umans gateway web search backend selection.
55
+
56
+ ### Changed
57
+
58
+ - The eager `task` (`task.eager: always`) and eager `todo` (`todo.eager: preferred`/`always`) hidden reminders now re-fire on the auto-continuation turn after a compaction (context-full / snapcompact / handoff / shake). Compaction summarizes away the first-message prelude, so the agent would otherwise silently lose the delegate-via-tasks / phased-todo guidance mid-work; the post-compaction todo nudge is reminder-only and never forces the `todo` tool onto the resumed turn.
59
+
60
+ ### Fixed
61
+
62
+ - Fixed edit-tool block operations on Emacs Lisp files: `.el` and `.emacs` paths now resolve top-level forms for `SWAP.BLK`, `DEL.BLK`, and `INS.BLK.POST` instead of reporting an unsupported-language block-resolution error.
63
+ - Fixed PDF reads leaking recoverable MuPDF WASM warnings into the terminal TUI by routing MuPDF output through the file logger before `markit-ai` loads it ([#2766](https://github.com/can1357/oh-my-pi/issues/2766)).
64
+ - Fixed `/exit` and `/quit` waiting one shutdown timeout per hanging extension by running `session_shutdown` handlers within a shared shutdown window ([#2736](https://github.com/can1357/oh-my-pi/issues/2736)).
65
+ - Fixed GitHub Copilot `.github/instructions/*.instructions.md` discovery by loading those files as rules that honor `applyTo` scoping, including always-apply `**` files and `rule://<name>` access for glob-scoped entries ([#2731](https://github.com/can1357/oh-my-pi/issues/2731)).
66
+ - Fixed Windows bash-tool child processes defaulting interpreter pipe I/O to the ANSI codepage by adding UTF-8 encoding defaults when the inherited environment is unset ([#2701](https://github.com/can1357/oh-my-pi/issues/2701)).
67
+ - Fixed `/advisor dump raw` so Opus 4.5 thinking content that already includes literal `<thinking>` tags is not rendered with nested thinking tags ([#2700](https://github.com/can1357/oh-my-pi/issues/2700)).
68
+ - The `plugin-extensions-discovery` test suite no longer writes fixtures into — and `rm -rf`s the `node_modules` of — the developer's real `~/.omp/plugins`. Its `XDG_DATA_HOME` isolation was a no-op on Windows (XDG is gated to Linux/macOS) and was bypassed in XDG-migrated Linux/macOS environments, so a local run could delete installed plugins. The suite now isolates the whole config root via an `os.homedir()` mock plus cleared `XDG_*` vars, with a pre-write guard that fails if resolution escapes the temp home ([#2721](https://github.com/can1357/oh-my-pi/issues/2721)).
69
+ - Installed plugins whose `extensions` manifest entry points at a directory of sub-extensions (the standard pi `extensions/<name>/index.ts` layout, e.g. `pi.extensions: ["./extensions"]`) are no longer rejected at install (`declared extension entry not found on disk`) or silently dropped at load. The plugin manifest resolver now resolves a directory the same way as the configured-directory (`-e`) extension loader: the directory's own `package.json` `omp`/`pi` `extensions` (authoritative — a missing declared entry is reported instead of falling back to a decoy `index`), then a direct `index.{ts,js,mjs,cjs}`, then a one-level scan of sub-extensions ([#2713](https://github.com/can1357/oh-my-pi/issues/2713)).
70
+ - Fixed OpenRouter `@upstream` routing selectors whose upstream slug also appears in the model id, so `openrouter/...@deepseek:high` keeps `openRouterRouting.only` instead of being consumed by provider-scoped fuzzy matching ([#2708](https://github.com/can1357/oh-my-pi/issues/2708)).
71
+ - Fixed `omp plugin list --json` omitting locally linked plugins that exist only in `omp-plugins.lock.json` and `node_modules` symlinks. ([#2742](https://github.com/can1357/oh-my-pi/issues/2742))
72
+ - Fixed task subagents to install their configured ordered model candidates as child-session retry fallback chains, so retryable provider failures can advance to the next subagent model instead of failing the worker ([#2750](https://github.com/can1357/oh-my-pi/issues/2750)).
73
+ - Fixed empty reasonless aborted assistant turns to auto-retry without switching model fallback, so transient provider-side aborts after tool results do not end headless sessions ([#2685](https://github.com/can1357/oh-my-pi/issues/2685)).
74
+
5
75
  ## [16.0.1] - 2026-06-15
6
76
 
7
77
  ### Breaking Changes
package/README.md CHANGED
@@ -12,7 +12,6 @@ Package-specific references:
12
12
  - [MCP runtime lifecycle](../../docs/mcp-runtime-lifecycle.md)
13
13
  - [MCP server/tool authoring](../../docs/mcp-server-tool-authoring.md)
14
14
  - [DEVELOPMENT](./DEVELOPMENT.md)
15
- - [RenderMermaid guide](../../docs/render-mermaid.md)
16
15
 
17
16
  ## Memory backends
18
17