@oh-my-pi/pi-coding-agent 15.10.4 → 15.10.6
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.
- package/CHANGELOG.md +74 -0
- package/dist/types/capability/rule-buckets.d.ts +1 -1
- package/dist/types/capability/rule.d.ts +6 -1
- package/dist/types/cli/update-cli.d.ts +11 -1
- package/dist/types/config/model-registry.d.ts +18 -1
- package/dist/types/discovery/at-imports.d.ts +15 -0
- package/dist/types/edit/diff.d.ts +3 -2
- package/dist/types/eval/__tests__/helpers-local-roots.test.d.ts +1 -0
- package/dist/types/eval/backend.d.ts +7 -0
- package/dist/types/eval/js/context-manager.d.ts +1 -0
- package/dist/types/eval/js/executor.d.ts +2 -0
- package/dist/types/eval/js/index.d.ts +1 -1
- package/dist/types/eval/js/shared/helpers.d.ts +6 -0
- package/dist/types/eval/js/shared/runtime.d.ts +5 -0
- package/dist/types/eval/js/worker-protocol.d.ts +6 -0
- package/dist/types/eval/py/executor.d.ts +7 -0
- package/dist/types/eval/py/index.d.ts +1 -1
- package/dist/types/exa/index.d.ts +1 -19
- package/dist/types/exa/mcp-client.d.ts +10 -3
- package/dist/types/exa/types.d.ts +0 -83
- package/dist/types/export/ttsr.d.ts +14 -0
- package/dist/types/extensibility/extensions/types.d.ts +8 -1
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +1 -1
- package/dist/types/internal-urls/local-protocol.d.ts +10 -0
- package/dist/types/mcp/oauth-flow.d.ts +2 -2
- package/dist/types/modes/components/custom-editor.d.ts +3 -0
- package/dist/types/modes/components/{status-line.d.ts → status-line/component.d.ts} +2 -32
- package/dist/types/modes/components/status-line/index.d.ts +1 -0
- package/dist/types/modes/components/status-line/types.d.ts +31 -2
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +8 -0
- package/dist/types/modes/image-references.d.ts +8 -3
- package/dist/types/modes/interactive-mode.d.ts +9 -1
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +3 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +2 -2
- package/dist/types/session/agent-session.d.ts +0 -2
- package/dist/types/task/render.d.ts +1 -0
- package/dist/types/tools/ask.d.ts +1 -0
- package/dist/types/tools/browser/tab-worker.d.ts +15 -0
- package/dist/types/tools/index.d.ts +17 -2
- package/dist/types/tools/render-utils.d.ts +1 -1
- package/dist/types/tools/tool-timeouts.d.ts +1 -1
- package/dist/types/utils/block-context.d.ts +35 -0
- package/dist/types/utils/git.d.ts +6 -0
- package/dist/types/utils/image-loading.d.ts +12 -0
- package/package.json +29 -9
- package/src/capability/rule-buckets.ts +4 -2
- package/src/capability/rule.ts +10 -1
- package/src/cli/auth-broker-cli.ts +6 -7
- package/src/cli/auth-gateway-cli.ts +4 -3
- package/src/cli/list-models.ts +5 -0
- package/src/cli/update-cli.ts +138 -16
- package/src/commit/agentic/tools/split-commit.ts +8 -1
- package/src/config/model-provider-priority.ts +1 -0
- package/src/config/model-registry.ts +81 -2
- package/src/debug/index.ts +4 -8
- package/src/discovery/at-imports.ts +273 -0
- package/src/discovery/builtin-rules/index.ts +4 -0
- package/src/discovery/builtin-rules/ts-no-test-timers.md +55 -0
- package/src/discovery/builtin-rules/ts-redundant-clear-guard.md +75 -0
- package/src/discovery/helpers.ts +2 -1
- package/src/edit/diff.ts +114 -4
- package/src/edit/hashline/diff.ts +1 -1
- package/src/edit/hashline/execute.ts +1 -1
- package/src/edit/modes/patch.ts +6 -2
- package/src/edit/modes/replace.ts +1 -1
- package/src/edit/renderer.ts +12 -2
- package/src/eval/__tests__/helpers-local-roots.test.ts +58 -0
- package/src/eval/backend.ts +15 -0
- package/src/eval/js/context-manager.ts +4 -2
- package/src/eval/js/executor.ts +3 -0
- package/src/eval/js/index.ts +7 -1
- package/src/eval/js/shared/helpers.ts +53 -6
- package/src/eval/js/shared/runtime.ts +8 -0
- package/src/eval/js/worker-core.ts +1 -0
- package/src/eval/js/worker-protocol.ts +6 -0
- package/src/eval/py/executor.ts +12 -0
- package/src/eval/py/index.ts +7 -1
- package/src/eval/py/prelude.py +43 -4
- package/src/eval/py/runner.py +1 -0
- package/src/exa/index.ts +1 -26
- package/src/exa/mcp-client.ts +10 -10
- package/src/exa/types.ts +0 -97
- package/src/export/ttsr.ts +122 -1
- package/src/extensibility/extensions/types.ts +8 -1
- package/src/extensibility/legacy-pi-ai-shim.ts +1 -1
- package/src/extensibility/plugins/doctor.ts +1 -1
- package/src/extensibility/plugins/legacy-pi-compat.ts +6 -5
- package/src/goals/tools/goal-tool.ts +1 -1
- package/src/internal-urls/docs-index.generated.ts +7 -6
- package/src/internal-urls/local-protocol.ts +13 -0
- package/src/lsp/render.ts +8 -6
- package/src/mcp/oauth-flow.ts +3 -3
- package/src/mcp/render.ts +7 -1
- package/src/modes/components/agent-dashboard.ts +6 -4
- package/src/modes/components/custom-editor.ts +12 -6
- package/src/modes/components/login-dialog.ts +1 -1
- package/src/modes/components/oauth-selector.ts +4 -4
- package/src/modes/components/read-tool-group.ts +10 -3
- package/src/modes/components/{status-line.ts → status-line/component.ts} +18 -40
- package/src/modes/components/status-line/index.ts +1 -0
- package/src/modes/components/status-line/types.ts +23 -8
- package/src/modes/components/tool-execution.ts +1 -1
- package/src/modes/components/transcript-container.ts +17 -10
- package/src/modes/components/user-message.ts +6 -3
- package/src/modes/components/welcome.ts +1 -1
- package/src/modes/controllers/event-controller.ts +8 -0
- package/src/modes/controllers/extension-ui-controller.ts +143 -127
- package/src/modes/controllers/input-controller.ts +60 -11
- package/src/modes/controllers/mcp-command-controller.ts +52 -17
- package/src/modes/controllers/selector-controller.ts +4 -11
- package/src/modes/controllers/ssh-command-controller.ts +2 -2
- package/src/modes/image-references.ts +13 -7
- package/src/modes/interactive-mode.ts +35 -3
- package/src/modes/rpc/rpc-mode.ts +1 -1
- package/src/modes/setup-wizard/scenes/sign-in.ts +3 -11
- package/src/modes/theme/theme.ts +95 -1
- package/src/modes/types.ts +3 -1
- package/src/modes/utils/ui-helpers.ts +14 -5
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/eval.md +4 -4
- package/src/sdk.ts +31 -14
- package/src/session/agent-session.ts +290 -196
- package/src/session/session-manager.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +9 -1
- package/src/system-prompt.ts +15 -9
- package/src/task/index.ts +9 -1
- package/src/task/render.ts +36 -14
- package/src/tools/ask.ts +14 -5
- package/src/tools/bash-interactive.ts +1 -1
- package/src/tools/bash.ts +14 -2
- package/src/tools/browser/render.ts +5 -2
- package/src/tools/browser/tab-worker.ts +211 -91
- package/src/tools/debug.ts +5 -2
- package/src/tools/eval-render.ts +6 -3
- package/src/tools/eval.ts +1 -1
- package/src/tools/gh-renderer.ts +29 -15
- package/src/tools/index.ts +32 -4
- package/src/tools/inspect-image-renderer.ts +12 -5
- package/src/tools/job.ts +9 -6
- package/src/tools/memory-render.ts +19 -5
- package/src/tools/read.ts +165 -18
- package/src/tools/render-utils.ts +3 -1
- package/src/tools/resolve.ts +1 -1
- package/src/tools/review.ts +1 -1
- package/src/tools/ssh.ts +4 -1
- package/src/tools/todo.ts +8 -1
- package/src/tools/tool-timeouts.ts +1 -1
- package/src/tools/write.ts +1 -1
- package/src/tui/code-cell.ts +1 -1
- package/src/utils/block-context.ts +312 -0
- package/src/utils/git.ts +41 -0
- package/src/utils/image-loading.ts +31 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/src/web/search/render.ts +14 -6
- package/dist/types/exa/factory.d.ts +0 -13
- package/dist/types/exa/render.d.ts +0 -19
- package/dist/types/exa/researcher.d.ts +0 -9
- package/dist/types/exa/search.d.ts +0 -9
- package/dist/types/exa/websets.d.ts +0 -9
- package/src/exa/factory.ts +0 -60
- package/src/exa/render.ts +0 -244
- package/src/exa/researcher.ts +0 -36
- package/src/exa/search.ts +0 -47
- package/src/exa/websets.ts +0 -248
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,80 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.10.6] - 2026-06-08
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added a `/plan-review` command that manually (re-)opens the plan-review overlay while plan mode is active. Since there is no fixed plan filename, it reviews the newest `local://<slug>-plan.md` the agent wrote — useful for pulling the review back up after dismissing it, or reviewing a plan the agent wrote without calling `resolve`.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Reverted the `task` tool's result-header glyph from the `⇶` signature icon back to the quiet `status.done` bullet (`•`): white while a subagent is running, accent once it finishes. The reviewer verdict line and per-agent result lines use the same bullet.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixed `/login` API-key prompts (OpenCode Zen, Perplexity OTP, GitHub Enterprise URL, manual OAuth redirect URL, …) silently dropping pasted content on kitty/Linux/Wayland — and any other terminal supporting OSC 5522 enhanced paste. `InputController` enables kitty's enhanced clipboard protocol on TUI start and consumes the resulting OSC 5522 packets in an `addInputListener` that runs before focus dispatch, so the paste never reached the modal `Input`'s bracketed-paste handler; the routing then stuffed the text into the main `CustomEditor` unconditionally, even when `selector-controller` had detached the editor and focused a temporary OAuth input. The pasted API key accumulated in the hidden editor and only resurfaced in the main prompt when the user dismissed the modal with Enter or Esc. The enhanced-paste callback now consults `ui.getFocused()` and routes the text to the focused component when it exposes a `pasteText` hook, falling back to the editor only when no modal target is in focus; image pastes refuse with a status message instead of stuffing a binary blob into the hidden editor. ([#2127](https://github.com/can1357/oh-my-pi/issues/2127))
|
|
18
|
+
- Fixed an auto-compaction dead loop when `compaction.strategy` was `shake` and the configured threshold was low enough that a single shake pass could not bring the context below it (e.g. a 50K-token threshold on a session well above it). Each pass auto-continued, the next agent turn re-triggered the threshold check, and the second shake had nothing new to drop, so the session spun forever. The shake recovery path now estimates post-shake context and, when it is still above the threshold (or shake reclaimed nothing on overflow recovery), surfaces a one-shot warning and falls back to the summarization-driven `context-full` compaction so progress actually resumes ([#2119](https://github.com/can1357/oh-my-pi/issues/2119)).
|
|
19
|
+
- Fixed `/skill:` prompts so magic keywords and turn-budget directives in skill args inject the same hidden notices as normal user prompts, matching the editor highlight behavior ([#2128](https://github.com/can1357/oh-my-pi/issues/2128)).
|
|
20
|
+
- Fixed MCP OAuth fallback rendering to show a short terminal hyperlink and keep the raw authorization URL on one unwrapped copy line ([#2121](https://github.com/can1357/oh-my-pi/issues/2121)).
|
|
21
|
+
- Fixed the `task` tool rendering a success bullet and a `success` frame state for detail-less error results (e.g. an argument-validation failure that never executes): the header now shows the error glyph with an error border and `error` state, and surfaces the dispatched agent name.
|
|
22
|
+
- Fixed Agent Control Center new-agent creation so Windows Ctrl+Enter sequences submitted as a single LF generate the agent instead of inserting a newline ([#2118](https://github.com/can1357/oh-my-pi/issues/2118)).
|
|
23
|
+
- Fixed plan-mode subagents preserving read-only specialty tools such as `report_finding` while still stripping mutating tools ([#1998](https://github.com/can1357/oh-my-pi/issues/1998)).
|
|
24
|
+
- Removed unreachable standalone Exa tool-suite exports and stale tool-count barrel exposure while keeping the live Exa `web_search` provider helpers ([#2093](https://github.com/can1357/oh-my-pi/issues/2093)).
|
|
25
|
+
- Fixed `omp commit` split plans accepting hunk selectors that resolve to no parsed hunks, which crashed the apply step after the index reset and left the working tree fully unstaged ([#2098](https://github.com/can1357/oh-my-pi/issues/2098)).
|
|
26
|
+
|
|
27
|
+
## [15.10.5] - 2026-06-08
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- Added Homebrew and mise package-manager update paths to the self-update command so installations launched from those tools are updated through their native workflows
|
|
32
|
+
- Added detection of Homebrew and mise install locations so self-update chooses the manager-specific updater when the active `omp` binary comes from a package-manager-managed path
|
|
33
|
+
- Added `astCondition` to TTSR rule frontmatter as a syntax-aware alternative to regex `condition`, enabling AST-based matching for edit/write tool snapshots
|
|
34
|
+
- Added a built-in `ts-redundant-clear-guard` rule that flags redundant guards around `clearTimeout`, `clearInterval`, and `clearImmediate` calls
|
|
35
|
+
- Added a built-in `ts-no-test-timers` rule that flags real timers (`Bun.sleep`, `setTimeout`, `setInterval`) in `*.test.ts` files, steering toward fake timers (`vi.useFakeTimers()` / `vi.advanceTimersByTime()`)
|
|
36
|
+
- Added support for paste marker highlighting with accent styling (`[Paste #N, +X lines]`/`[Paste #N, Y chars]`) in the prompt editor, matching the visual treatment of image references
|
|
37
|
+
- Added pixel dimensions to pasted/loaded image placeholders in the prompt — the marker now reads `[Image #N, WxH]` (falling back to `[Image #N]` when the header can't be decoded).
|
|
38
|
+
- The bundled shell now treats `nohup` as a builtin: `nohup … &` runs the command without masking `SIGHUP` or detaching it, so agent-started daemons stay tied to this agent's lifetime instead of leaking as orphans when the agent exits. Updated the bash tool prompt's daemon guidance to match (dropped the `nohup … & / setsid … & / disown` detach recommendation in favor of a large `timeout` plus the persistent session).
|
|
39
|
+
- Added per-tool `tool.*` theme symbol keys (nerd/unicode/ascii presets) plus a quiet `status.done` glyph, so each tool's result header can carry a signature icon instead of a generic status mark
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Updated pi-ai OAuth imports to the renamed `@oh-my-pi/pi-ai/oauth` subpath (was `@oh-my-pi/pi-ai/utils/oauth`) across the login UI, MCP OAuth flow, model registry, setup wizard, and web-search Codex auth. The legacy-plugin specifier shim drops its `pi-ai/oauth` → `pi-ai/utils/oauth` subpath rewrite, since the canonical `@oh-my-pi/pi-ai/oauth` export now resolves directly.
|
|
44
|
+
- Changed forced self-updates for Homebrew installs to run `brew reinstall` and for mise installs to run `mise install --force` after `mise upgrade` when `--force` is requested
|
|
45
|
+
- Changed TTSR rule bucketing and matching so rules with only `astCondition` are treated as TTSR rules and evaluated in the interrupt flow using reconstructed edit/write source snapshots
|
|
46
|
+
- Normalized image content before it enters model context so attached images are downscaled and preprocessed for prompts, steering messages, follow-ups, and custom agent messages
|
|
47
|
+
- Changed image marker format to include pixel dimensions when available (`[Image #N, WxH]`), falling back to bare `[Image #N]` when header cannot be decoded
|
|
48
|
+
- Changed the prompt editor to highlight large-paste placeholders (`[Paste #N, +X lines]`/`[Paste #N, Y chars]`) with the same accent styling as image references (bold, no hyperlink), and to delete image/paste markers atomically: a single backspace or forward-delete removes the whole marker instead of leaving a broken `[Paste #N, +X lines` behind.
|
|
49
|
+
- Browser tool helpers (`tab.*`) are now individually tracked and time-bounded: when a `run` cell hits its budget, the timeout error names the still-running helper(s) and how long each has been stalled (e.g. `... (stalled on tab.screenshot({ selector: ".x" }) (29.9s))`) instead of the opaque `Browser code execution timed out after 30000ms`. Page-coupled helpers that should resolve quickly (`observe`, `screenshot`, `extract`) also fail fast with a named per-op error at `min(cellBudget, 20s)`, leaving budget for the rest of the cell, rather than silently consuming the whole budget.
|
|
50
|
+
- Derived the auth-broker OAuth callback ports (`CALLBACK_PORTS`) and the paste-code login-provider set from the `@oh-my-pi/pi-ai` provider registry, removing the duplicated `CALLBACK_SERVER_PROVIDERS` tables in the model selector and the setup-wizard sign-in scene.
|
|
51
|
+
- Raised the `eval` tool's per-cell `timeout` ceiling from 600s to 3600s (matching `bash`), in both the Zod schema and the `TOOL_TIMEOUTS.eval` runtime clamp, so heavy local-compute cells can request budgets above 10 minutes.
|
|
52
|
+
- Derived the auth-broker OAuth callback ports (`CALLBACK_PORTS`) and the paste-code login-provider set from the `@oh-my-pi/pi-ai` provider registry, removing the duplicated `CALLBACK_SERVER_PROVIDERS` tables in the model selector and the setup-wizard sign-in scene.
|
|
53
|
+
- Reworked tool result-header glyphs to cut the overused success checkmark/dot: each tool now shows its own signature icon on success (terminal for bash, pencil for edit, magnifier/globe for search, plug for MCP, etc.; read keeps the read-group status dot), tools without a custom renderer fall back to a quiet `status.done` dot, and error/warning/pending states keep the universal cross/warning/spinner
|
|
54
|
+
- Changed steady-state health indicators (LSP server ready, OAuth logged-in, plugin-doctor checks) from a success checkmark to a colored `status.enabled` dot, so failures stand out instead of every line reading as a check
|
|
55
|
+
- Changed one-shot MCP/SSH/debug confirmation messages from a generic checkmark to contextual action glyphs (add/remove, connect/enable/disable toggles, reload, job-completed), reflecting what happened rather than just "success"
|
|
56
|
+
- Derived the auth-broker OAuth callback ports (`CALLBACK_PORTS`) and the paste-code login-provider set from the `@oh-my-pi/pi-ai` provider registry, removing the duplicated `CALLBACK_SERVER_PROVIDERS` tables in the model selector and the setup-wizard sign-in scene.
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
|
|
60
|
+
- Fixed package subpath exports for status-line, setup-wizard, tool-discovery, and gallery fixture modules so rewritten test imports resolve through `@oh-my-pi/pi-coding-agent`.
|
|
61
|
+
- Fixed runtime model provider discovery so extension-registered providers are now refreshed after extension load and extension-supplied models appear without restarting
|
|
62
|
+
- Fixed task-row shimmer timing so every running description starts its highlight on the first character together and reaches the last character together, regardless of text length.
|
|
63
|
+
- Fixed the `eval` tool's `read`/`write`/`append` helpers (both Python and JS backends) treating `local://` (and other internal-URL) paths as plain filesystem paths. `pathlib.Path`/`path.resolve` collapse `local://x.md` to `local:/x.md`, so `write("local://x.md", …)` created a junk `local:` directory under the cwd instead of writing where `read local://x.md` resolves. The helpers now substitute injected on-disk roots for known schemes (currently `local://`, pinned to the session's own `local://` root), reject path traversal and unknown `scheme://` paths, and leave plain paths resolving against the cwd.
|
|
64
|
+
- Fixed read and edit previews to surface the enclosing syntactic block's off-window boundary line (behind an ellipsis) when a shown line opens or closes a block whose other end falls outside the displayed range. Powered by a new tree-sitter `enclosingBlockBoundaries` native, so it covers brace languages and indentation languages (Python) using real syntactic spans, with a lexical bracket scan as fallback for unparseable sources.
|
|
65
|
+
- Fixed `tab.screenshot({ selector })` hanging for the entire cell budget on continuously-animating pages (WebGL / `backdrop-filter` "glass" effects). The element-screenshot path no longer routes through puppeteer's `scrollIntoViewIfNeeded()`, whose `IntersectionObserver` promise can stall indefinitely under heavy rendering; it now does a single instant `scrollIntoView` and captures with `scrollIntoView: false` (relying on `captureBeyondViewport`), so off-screen elements are still captured without the stall.
|
|
66
|
+
- Fixed follow-up message submissions to forward pending clipboard-pasted images to `session.prompt` in both streaming and non-streaming flows
|
|
67
|
+
- Fixed follow-up handling to clear consumed clipboard image state after submission so pasted images are not silently carried into later messages
|
|
68
|
+
- Fixed clipboard-pasted images being rejected when steering or following up during compaction. Instead of bailing with "Retry after it completes to send images", the message and its images are now queued via `queueCompactionMessage` and forwarded to the session (steer/follow-up/prompt) when the compaction queue flushes.
|
|
69
|
+
- Fixed edit tool result previews to show only current-file lines and collapse long inserted blocks instead of echoing removed content.
|
|
70
|
+
- Fixed `generateDiffString` to omit the mid-skip `...` placeholder between two nearby edits, conveying the elided gap via the jump in line numbers instead (consistent with how leading/trailing context skips already render). The placeholder row was indistinguishable from a genuine `...` context line and wasted a row in compact previews.
|
|
71
|
+
- Fixed concurrent interactive dialogs clobbering each other on the shared editor surface. `ExtensionUiController` presents the selector / input / editor modals by swapping a component into the single `editorContainer` and stealing focus, with no serialization — so a second `select`/`input`/`editor` request (from a hook, extension, the `ask` tool, or an internal flow) opened while one was already up would clear the container and re-focus, orphaning the first dialog. Its promise then hung until the caller's signal aborted (surfacing a stray `Ask input was cancelled` on top of the answered call). These modals are now serialized through `#presentDialog`: at most one shows at a time and the rest queue (FIFO); a queued request whose signal aborts before its turn resolves `undefined` and is never shown. The first dialog is still presented synchronously, so single-dialog timing is unchanged.
|
|
72
|
+
- Fixed the `ask` tool potentially hanging when the model emitted two `ask` calls in one tool batch. `ask` now declares `concurrency: "exclusive"`, so the agent loop serializes the batch and each question's selector runs to completion before the next starts, instead of racing for the shared selector surface.
|
|
73
|
+
- Expanded `@path/to/file` import references in CLAUDE.md / AGENTS.md / GEMINI.md (and the other discovered context-file flavors) when loading them into the system prompt, matching the convention used by Claude Code, Goose, and other agents. Imports resolve relative to the importing file's directory, support `~/...`, recurse up to 5 hops, and are skipped inside fenced code blocks and inline code spans so technical examples like `npm install @types/node` survive intact ([#2111](https://github.com/can1357/oh-my-pi/issues/2111)).
|
|
74
|
+
|
|
75
|
+
### Removed
|
|
76
|
+
|
|
77
|
+
- Removed the special Anthropic `claude-opus-4-8` tool-call batch cap; sessions no longer abort an in-flight provider stream after a fixed number of completed tool calls.
|
|
78
|
+
|
|
5
79
|
## [15.10.4] - 2026-06-08
|
|
6
80
|
|
|
7
81
|
### Added
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* manager, and splits the rest into the always-apply and rulebook buckets.
|
|
7
7
|
*
|
|
8
8
|
* Bucket precedence (matches docs/rulebook-matching-pipeline.md §5):
|
|
9
|
-
* 1. TTSR — non-empty `condition` that `TtsrManager.addRule` accepts
|
|
9
|
+
* 1. TTSR — non-empty `condition`/`astCondition` that `TtsrManager.addRule` accepts
|
|
10
10
|
* 2. always — `alwaysApply === true`
|
|
11
11
|
* 3. rulebook — has a `description`
|
|
12
12
|
*/
|
|
@@ -15,6 +15,8 @@ export interface RuleFrontmatter {
|
|
|
15
15
|
alwaysApply?: boolean;
|
|
16
16
|
/** New key for TTSR match conditions. */
|
|
17
17
|
condition?: string | string[];
|
|
18
|
+
/** TTSR match condition(s) expressed as ast-grep patterns (edit/write streams only). */
|
|
19
|
+
astCondition?: string | string[];
|
|
18
20
|
/** New key for TTSR stream scope. */
|
|
19
21
|
scope?: string | string[];
|
|
20
22
|
/** Per-rule TTSR interrupt mode override. */
|
|
@@ -39,6 +41,8 @@ export interface Rule {
|
|
|
39
41
|
description?: string;
|
|
40
42
|
/** Regex condition(s) that can trigger TTSR interruption. */
|
|
41
43
|
condition?: string[];
|
|
44
|
+
/** ast-grep pattern condition(s) that can trigger TTSR interruption (edit/write streams only). */
|
|
45
|
+
astCondition?: string[];
|
|
42
46
|
/** Optional stream scope tokens (for example: text, thinking, tool:edit(*.ts)). */
|
|
43
47
|
scope?: string[];
|
|
44
48
|
/** Per-rule TTSR interrupt mode override (falls back to global ttsr.interruptMode). */
|
|
@@ -54,8 +58,9 @@ export interface Rule {
|
|
|
54
58
|
* - legacy `ttsr_trigger` / `ttsrTrigger` are accepted as a `condition` fallback
|
|
55
59
|
* - condition tokens that look like file globs become scope shorthands:
|
|
56
60
|
* `*.rs` => `tool:edit(*.rs)`, `tool:write(*.rs)` and a catch-all condition `.*`
|
|
61
|
+
* - `astCondition` holds ast-grep patterns and is kept verbatim (no glob inference)
|
|
57
62
|
*/
|
|
58
|
-
export declare function parseRuleConditionAndScope(frontmatter: RuleFrontmatter): Pick<Rule, "condition" | "scope">;
|
|
63
|
+
export declare function parseRuleConditionAndScope(frontmatter: RuleFrontmatter): Pick<Rule, "condition" | "astCondition" | "scope">;
|
|
59
64
|
/**
|
|
60
65
|
* Process-global snapshot of rules the active session loaded.
|
|
61
66
|
* Read by internal URL protocol handlers (rule://).
|
|
@@ -20,7 +20,13 @@ export declare function parseUpdateArgs(args: string[]): {
|
|
|
20
20
|
force: boolean;
|
|
21
21
|
check: boolean;
|
|
22
22
|
} | undefined;
|
|
23
|
-
|
|
23
|
+
type UpdateMethod = "brew" | "mise" | "bun" | "binary";
|
|
24
|
+
interface UpdateMethodResolutionOptions {
|
|
25
|
+
homebrewPrefix?: string;
|
|
26
|
+
miseBinDirs?: readonly string[];
|
|
27
|
+
miseDataDir?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function resolveUpdateMethodForTest(ompPath: string, bunBinDir: string | undefined, options?: UpdateMethodResolutionOptions): UpdateMethod;
|
|
24
30
|
/**
|
|
25
31
|
* Atomically replace the installed binary and roll back if version verification fails.
|
|
26
32
|
*/
|
|
@@ -56,6 +62,9 @@ export declare function replaceBinaryForUpdate(options: BinaryReplacementOptions
|
|
|
56
62
|
* See #1824.
|
|
57
63
|
*/
|
|
58
64
|
export declare function buildBunInstallArgs(expectedVersion: string, nativeTag?: string): string[];
|
|
65
|
+
export declare function buildHomebrewUpdateArgs(force: boolean): string[];
|
|
66
|
+
export declare function buildMiseUpgradeArgs(): string[];
|
|
67
|
+
export declare function buildMiseForceInstallArgs(expectedVersion: string): string[];
|
|
59
68
|
/**
|
|
60
69
|
* Run the update command.
|
|
61
70
|
*/
|
|
@@ -67,3 +76,4 @@ export declare function runUpdateCommand(opts: {
|
|
|
67
76
|
* Print update command help.
|
|
68
77
|
*/
|
|
69
78
|
export declare function printUpdateHelp(): void;
|
|
79
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { type ModelRefreshStrategy } from "@oh-my-pi/pi-ai/model-manager";
|
|
|
2
2
|
import type { Api, Context, Model, SimpleStreamOptions, ThinkingConfig } from "@oh-my-pi/pi-ai/types";
|
|
3
3
|
import type { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream";
|
|
4
4
|
import type { ApiKeyResolver } from "@oh-my-pi/pi-ai";
|
|
5
|
-
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/
|
|
5
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
6
6
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
7
7
|
import type { AuthStorage } from "../session/auth-storage";
|
|
8
8
|
import { type ApiKeyResolverOptions } from "./api-key-resolver";
|
|
@@ -284,6 +284,16 @@ export declare class ModelRegistry {
|
|
|
284
284
|
refresh(strategy?: ModelRefreshStrategy): Promise<void>;
|
|
285
285
|
refreshInBackground(strategy?: ModelRefreshStrategy): void;
|
|
286
286
|
refreshProvider(providerId: string, strategy?: ModelRefreshStrategy): Promise<void>;
|
|
287
|
+
/**
|
|
288
|
+
* Discover models for providers registered at runtime via `fetchDynamicModels`
|
|
289
|
+
* (extension providers). Merges the discovered catalog into the existing model
|
|
290
|
+
* set without reloading static models, so dynamically-discovered models from
|
|
291
|
+
* other providers are preserved. No-op when no runtime providers are registered.
|
|
292
|
+
*
|
|
293
|
+
* Drives the same SQLite model cache as built-in providers, so the default
|
|
294
|
+
* `online-if-uncached` strategy fetches at most once per cache TTL (24 h).
|
|
295
|
+
*/
|
|
296
|
+
refreshRuntimeProviders(strategy?: ModelRefreshStrategy): Promise<void>;
|
|
287
297
|
/**
|
|
288
298
|
* Get any error from loading models.json (undefined if no error).
|
|
289
299
|
*/
|
|
@@ -399,6 +409,13 @@ export interface ProviderConfigInput {
|
|
|
399
409
|
getApiKey?(credentials: OAuthCredentials): string;
|
|
400
410
|
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
401
411
|
};
|
|
412
|
+
/**
|
|
413
|
+
* Async factory that fetches the live model list from the provider endpoint.
|
|
414
|
+
* When present, the result is run through the same SQLite model-cache as
|
|
415
|
+
* built-in providers (keyed by provider name, default 24 h TTL).
|
|
416
|
+
* The factory receives the resolved API key (undefined when unauthenticated).
|
|
417
|
+
*/
|
|
418
|
+
fetchDynamicModels?: (apiKey: string | undefined) => Promise<readonly NonNullable<ProviderConfigInput["models"]>[number][]>;
|
|
402
419
|
models?: Array<{
|
|
403
420
|
id: string;
|
|
404
421
|
name: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Maximum number of recursive `@`-import hops. Matches Claude Code's documented cap. */
|
|
2
|
+
export declare const MAX_AT_IMPORT_DEPTH = 5;
|
|
3
|
+
export interface ExpandAtImportsOptions {
|
|
4
|
+
/** Maximum hop depth (default: {@link MAX_AT_IMPORT_DEPTH}). */
|
|
5
|
+
maxDepth?: number;
|
|
6
|
+
/** Override the home directory used to resolve `~/...` (default: `os.homedir()`). */
|
|
7
|
+
home?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Expand `@path/to/file` references in `content` against `filePath`'s directory.
|
|
11
|
+
*
|
|
12
|
+
* Returns the expanded text. When no imports match, the original string is
|
|
13
|
+
* returned unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export declare function expandAtImports(content: string, filePath: string, options?: ExpandAtImportsOptions): Promise<string>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BlockContextSource } from "../utils/block-context";
|
|
1
2
|
export interface DiffResult {
|
|
2
3
|
diff: string;
|
|
3
4
|
firstChangedLine: number | undefined;
|
|
@@ -25,7 +26,7 @@ export declare class ApplyPatchError extends Error {
|
|
|
25
26
|
* Generate a unified diff string with line numbers and context.
|
|
26
27
|
* Returns both the diff string and the first changed line number (in the new file).
|
|
27
28
|
*/
|
|
28
|
-
export declare function generateDiffString(oldContent: string, newContent: string, contextLines?: number): DiffResult;
|
|
29
|
+
export declare function generateDiffString(oldContent: string, newContent: string, contextLines?: number, source?: BlockContextSource): DiffResult;
|
|
29
30
|
export interface ReplaceOptions {
|
|
30
31
|
/** Allow fuzzy matching */
|
|
31
32
|
fuzzy: boolean;
|
|
@@ -44,7 +45,7 @@ export interface ReplaceResult {
|
|
|
44
45
|
* Generate a unified diff string without file headers.
|
|
45
46
|
* Returns both the diff string and the first changed line number (in the new file).
|
|
46
47
|
*/
|
|
47
|
-
export declare function generateUnifiedDiffString(oldContent: string, newContent: string, contextLines?: number): DiffResult;
|
|
48
|
+
export declare function generateUnifiedDiffString(oldContent: string, newContent: string, contextLines?: number, source?: BlockContextSource): DiffResult;
|
|
48
49
|
export declare function normalizeDiff(diff: string): string;
|
|
49
50
|
export declare function normalizeCreateContent(content: string): string;
|
|
50
51
|
export declare function parseDiffHunks(diff: string): DiffHunk[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -53,3 +53,10 @@ export interface ExecutorBackend {
|
|
|
53
53
|
/** Execute one cell. Caller invokes once per cell and aggregates results. */
|
|
54
54
|
execute(code: string, opts: ExecutorBackendExecOptions): Promise<ExecutorBackendResult>;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the on-disk roots that the eval helpers substitute for internal-URL
|
|
58
|
+
* schemes (currently `local://`). Prefers the session's own
|
|
59
|
+
* {@link LocalProtocolOptions} — the exact mapping `read local://…` uses — so an
|
|
60
|
+
* eval `write("local://x")` and a later `read local://x` agree on the location.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveEvalUrlRoots(session: ToolSession): Record<string, string>;
|
|
@@ -20,6 +20,8 @@ export interface JsExecutorOptions {
|
|
|
20
20
|
artifactPath?: string;
|
|
21
21
|
artifactId?: string;
|
|
22
22
|
session: ToolSession;
|
|
23
|
+
/** On-disk roots the helpers substitute for internal-URL schemes (e.g. `local://`). */
|
|
24
|
+
localRoots?: Record<string, string>;
|
|
23
25
|
}
|
|
24
26
|
export interface JsResult {
|
|
25
27
|
output: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolSession } from "../../tools";
|
|
2
|
-
import type
|
|
2
|
+
import { type ExecutorBackendExecOptions, type ExecutorBackendResult } from "../backend";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
id: "js";
|
|
5
5
|
label: string;
|
|
@@ -17,6 +17,12 @@ export interface HelperOptions {
|
|
|
17
17
|
export interface HelperContext {
|
|
18
18
|
cwd(): string;
|
|
19
19
|
env: Map<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* On-disk roots for internal-URL schemes the helpers accept (e.g.
|
|
22
|
+
* `{ local: "/…/artifacts/local" }`). A path like `local://x.md` is rewritten
|
|
23
|
+
* to `<root>/x.md` before any filesystem op; unknown schemes are rejected.
|
|
24
|
+
*/
|
|
25
|
+
localRoots(): Record<string, string>;
|
|
20
26
|
emitStatus(event: JsStatusEvent): void;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
@@ -25,6 +25,11 @@ export interface RuntimeOptions {
|
|
|
25
25
|
* via `setRunScope()` instead.
|
|
26
26
|
*/
|
|
27
27
|
extraGlobals?: Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* On-disk roots the helpers substitute for internal-URL schemes (e.g.
|
|
30
|
+
* `{ local: "/…/artifacts/local" }`). Stable for the worker's lifetime.
|
|
31
|
+
*/
|
|
32
|
+
localRoots?: Record<string, string>;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* Shared JS runtime for the eval worker and the browser tab worker. Owns the prelude,
|
|
@@ -3,6 +3,12 @@ export type { JsDisplayOutput } from "./shared/types";
|
|
|
3
3
|
export interface SessionSnapshot {
|
|
4
4
|
cwd: string;
|
|
5
5
|
sessionId: string;
|
|
6
|
+
/**
|
|
7
|
+
* On-disk roots the helpers substitute for internal-URL schemes
|
|
8
|
+
* (e.g. `{ local: "/…/artifacts/local" }`). Lets `read`/`write`/`append`
|
|
9
|
+
* accept `local://…` paths instead of writing a literal `local:/` directory.
|
|
10
|
+
*/
|
|
11
|
+
localRoots?: Record<string, string>;
|
|
6
12
|
}
|
|
7
13
|
export interface RunErrorPayload {
|
|
8
14
|
name?: string;
|
|
@@ -39,6 +39,13 @@ export interface PythonExecutorOptions {
|
|
|
39
39
|
/** Artifact path/id for full output storage */
|
|
40
40
|
artifactPath?: string;
|
|
41
41
|
artifactId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* On-disk roots the prelude helpers (`read`/`write`/`append`) substitute for
|
|
44
|
+
* internal-URL schemes (e.g. `{ local: "/…/artifacts/local" }`). Exported to
|
|
45
|
+
* the kernel as `PI_EVAL_LOCAL_ROOTS` (JSON) so `write("local://x")` lands
|
|
46
|
+
* where `read local://x` resolves instead of a literal `local:/` directory.
|
|
47
|
+
*/
|
|
48
|
+
localRoots?: Record<string, string>;
|
|
42
49
|
/**
|
|
43
50
|
* ToolSession used to resolve host-side `tool.<name>(args)` calls made from
|
|
44
51
|
* the Python prelude's bridge proxy. When omitted, the bridge env vars are
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolSession } from "../../tools";
|
|
2
|
-
import type
|
|
2
|
+
import { type ExecutorBackendExecOptions, type ExecutorBackendResult } from "../backend";
|
|
3
3
|
export declare function namespaceSessionId(sessionId: string): string;
|
|
4
4
|
declare const _default: {
|
|
5
5
|
id: "python";
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exa MCP Tools
|
|
3
|
-
*
|
|
4
|
-
* 22 tools for Exa's MCP servers:
|
|
5
|
-
* - 4 search tools (search, deep, code, crawl)
|
|
6
|
-
* - 1 LinkedIn search tool
|
|
7
|
-
* - 1 company research tool
|
|
8
|
-
* - 2 researcher tools (start, poll)
|
|
9
|
-
* - 14 websets tools (CRUD, items, search, enrichment, monitor)
|
|
10
|
-
*/
|
|
11
|
-
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
12
|
-
import type { ExaRenderDetails } from "./types";
|
|
13
|
-
/** All Exa tools (22 total) - static export for backward compatibility */
|
|
14
|
-
export declare const exaTools: CustomTool<any, ExaRenderDetails>[];
|
|
15
1
|
export * from "./mcp-client";
|
|
16
|
-
export {
|
|
17
|
-
export { researcherTools } from "./researcher";
|
|
18
|
-
export { searchTools } from "./search";
|
|
19
|
-
export type { ExaRenderDetails, ExaSearchResponse, ExaSearchResult, MCPToolWrapperConfig } from "./types";
|
|
20
|
-
export { websetsTools } from "./websets";
|
|
2
|
+
export type { ExaSearchResponse, MCPCallResponse, MCPTool, MCPToolsResponse, MCPToolWrapperConfig } from "./types";
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { TSchema } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import type { CustomTool, CustomToolResult } from "../extensibility/custom-tools/types";
|
|
3
3
|
import { type CallMcpOptions } from "../mcp/json-rpc";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExaSearchResponse, MCPTool, MCPToolWrapperConfig } from "./types";
|
|
5
|
+
type MCPWrappedToolDetails = {
|
|
6
|
+
response?: ExaSearchResponse;
|
|
7
|
+
error?: string;
|
|
8
|
+
toolName?: string;
|
|
9
|
+
raw?: unknown;
|
|
10
|
+
};
|
|
5
11
|
/** Find EXA_API_KEY from Bun.env or .env files */
|
|
6
12
|
export declare function findApiKey(): string | null;
|
|
7
13
|
/** Fetch available tools from Exa MCP */
|
|
@@ -29,14 +35,14 @@ export declare function fetchMCPToolSchema(apiKey: string, mcpToolName: string,
|
|
|
29
35
|
* This allows tools to be generated from MCP server schemas without hardcoding,
|
|
30
36
|
* reducing drift when MCP servers add new parameters.
|
|
31
37
|
*/
|
|
32
|
-
export declare class MCPWrappedTool implements CustomTool<TSchema,
|
|
38
|
+
export declare class MCPWrappedTool implements CustomTool<TSchema, MCPWrappedToolDetails> {
|
|
33
39
|
private readonly config;
|
|
34
40
|
readonly parameters: TSchema;
|
|
35
41
|
readonly description: string;
|
|
36
42
|
readonly name: string;
|
|
37
43
|
readonly label: string;
|
|
38
44
|
constructor(config: MCPToolWrapperConfig, parameters: TSchema, description: string);
|
|
39
|
-
execute(_toolCallId: string, params: unknown, _onUpdate?: unknown, _ctx?: unknown, _signal?: AbortSignal): Promise<CustomToolResult<
|
|
45
|
+
execute(_toolCallId: string, params: unknown, _onUpdate?: unknown, _ctx?: unknown, _signal?: AbortSignal): Promise<CustomToolResult<MCPWrappedToolDetails>>;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* Create a CustomTool by fetching schema from MCP server.
|
|
@@ -44,3 +50,4 @@ export declare class MCPWrappedTool implements CustomTool<TSchema, ExaRenderDeta
|
|
|
44
50
|
* Falls back to provided fallback schema if MCP fetch fails.
|
|
45
51
|
*/
|
|
46
52
|
export declare function createMCPToolFromServer(apiKey: string, config: MCPToolWrapperConfig, fallbackSchema: TSchema, fallbackDescription: string): Promise<MCPWrappedTool>;
|
|
53
|
+
export {};
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
* Types for the Exa MCP client and tool implementations.
|
|
5
5
|
*/
|
|
6
6
|
import type { TSchema } from "@oh-my-pi/pi-ai";
|
|
7
|
-
/** MCP endpoint URLs */
|
|
8
|
-
export declare const EXA_MCP_URL = "https://mcp.exa.ai/mcp";
|
|
9
|
-
export declare const WEBSETS_MCP_URL = "https://websetsmcp.exa.ai/mcp";
|
|
10
7
|
/** MCP tool definition from server */
|
|
11
8
|
export interface MCPTool {
|
|
12
9
|
name: string;
|
|
@@ -73,83 +70,3 @@ export interface ExaSearchResponse {
|
|
|
73
70
|
searchTime?: number;
|
|
74
71
|
requestId?: string;
|
|
75
72
|
}
|
|
76
|
-
/** Researcher task status */
|
|
77
|
-
export interface ResearcherStatus {
|
|
78
|
-
id: string;
|
|
79
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
80
|
-
result?: string;
|
|
81
|
-
error?: string;
|
|
82
|
-
}
|
|
83
|
-
/** Webset definition */
|
|
84
|
-
export interface Webset {
|
|
85
|
-
id: string;
|
|
86
|
-
name: string;
|
|
87
|
-
description?: string;
|
|
88
|
-
createdAt?: string;
|
|
89
|
-
updatedAt?: string;
|
|
90
|
-
}
|
|
91
|
-
/** Webset item */
|
|
92
|
-
export interface WebsetItem {
|
|
93
|
-
id: string;
|
|
94
|
-
websetId: string;
|
|
95
|
-
url: string;
|
|
96
|
-
title?: string;
|
|
97
|
-
content?: string;
|
|
98
|
-
metadata?: Record<string, unknown>;
|
|
99
|
-
}
|
|
100
|
-
/** Webset search */
|
|
101
|
-
export interface WebsetSearch {
|
|
102
|
-
id: string;
|
|
103
|
-
websetId: string;
|
|
104
|
-
query: string;
|
|
105
|
-
status: "pending" | "running" | "completed" | "cancelled";
|
|
106
|
-
resultCount?: number;
|
|
107
|
-
}
|
|
108
|
-
/** Webset enrichment */
|
|
109
|
-
export interface WebsetEnrichment {
|
|
110
|
-
id: string;
|
|
111
|
-
websetId: string;
|
|
112
|
-
name: string;
|
|
113
|
-
prompt: string;
|
|
114
|
-
status: "pending" | "running" | "completed" | "cancelled";
|
|
115
|
-
}
|
|
116
|
-
/** Tool name mappings: MCP name -> our tool name */
|
|
117
|
-
export declare const EXA_TOOL_MAPPINGS: {
|
|
118
|
-
readonly web_search_exa: "exa_search";
|
|
119
|
-
readonly get_code_context_exa: "exa_search_code";
|
|
120
|
-
readonly crawling_exa: "exa_crawl";
|
|
121
|
-
readonly linkedin_search_exa: "exa_linkedin";
|
|
122
|
-
readonly company_research_exa: "exa_company";
|
|
123
|
-
readonly deep_researcher_start: "exa_researcher_start";
|
|
124
|
-
readonly deep_researcher_check: "exa_researcher_poll";
|
|
125
|
-
};
|
|
126
|
-
export declare const WEBSETS_TOOL_MAPPINGS: {
|
|
127
|
-
readonly create_webset: "webset_create";
|
|
128
|
-
readonly list_websets: "webset_list";
|
|
129
|
-
readonly get_webset: "webset_get";
|
|
130
|
-
readonly update_webset: "webset_update";
|
|
131
|
-
readonly delete_webset: "webset_delete";
|
|
132
|
-
readonly list_webset_items: "webset_items_list";
|
|
133
|
-
readonly get_item: "webset_item_get";
|
|
134
|
-
readonly create_search: "webset_search_create";
|
|
135
|
-
readonly get_search: "webset_search_get";
|
|
136
|
-
readonly cancel_search: "webset_search_cancel";
|
|
137
|
-
readonly create_enrichment: "webset_enrichment_create";
|
|
138
|
-
readonly get_enrichment: "webset_enrichment_get";
|
|
139
|
-
readonly update_enrichment: "webset_enrichment_update";
|
|
140
|
-
readonly delete_enrichment: "webset_enrichment_delete";
|
|
141
|
-
readonly cancel_enrichment: "webset_enrichment_cancel";
|
|
142
|
-
readonly create_monitor: "webset_monitor_create";
|
|
143
|
-
};
|
|
144
|
-
export type ExaMcpToolName = keyof typeof EXA_TOOL_MAPPINGS;
|
|
145
|
-
export type WebsetsMcpToolName = keyof typeof WEBSETS_TOOL_MAPPINGS;
|
|
146
|
-
export type ExaToolName = (typeof EXA_TOOL_MAPPINGS)[ExaMcpToolName];
|
|
147
|
-
export type WebsetsToolName = (typeof WEBSETS_TOOL_MAPPINGS)[WebsetsMcpToolName];
|
|
148
|
-
/** Render details for TUI */
|
|
149
|
-
export interface ExaRenderDetails {
|
|
150
|
-
response?: ExaSearchResponse;
|
|
151
|
-
error?: string;
|
|
152
|
-
toolName?: string;
|
|
153
|
-
/** Raw result for non-search responses */
|
|
154
|
-
raw?: unknown;
|
|
155
|
-
}
|
|
@@ -32,6 +32,18 @@ export declare class TtsrManager {
|
|
|
32
32
|
* of being appended to it.
|
|
33
33
|
*/
|
|
34
34
|
checkSnapshot(snapshot: string, context: TtsrMatchContext): Rule[];
|
|
35
|
+
/**
|
|
36
|
+
* Evaluate ast-grep `astCondition` rules against a reconstructed tool snapshot.
|
|
37
|
+
*
|
|
38
|
+
* Only edit/write tool streams reach here (AST conditions need a language, which
|
|
39
|
+
* we infer from the file extension on the tool's path argument). The snapshot is
|
|
40
|
+
* matched in memory by the native engine (`astMatch`), so this is async and
|
|
41
|
+
* intentionally throttled: identical consecutive snapshots (the common case when
|
|
42
|
+
* only non-source arguments change between deltas) are skipped.
|
|
43
|
+
*/
|
|
44
|
+
checkAstSnapshot(snapshot: string, context: TtsrMatchContext): Promise<Rule[]>;
|
|
45
|
+
/** True when any registered rule carries ast-grep conditions. */
|
|
46
|
+
hasAstRules(): boolean;
|
|
35
47
|
/** Mark rules as injected (won't trigger again until conditions allow). */
|
|
36
48
|
markInjected(rulesToMark: Rule[]): void;
|
|
37
49
|
/** Mark rule names as injected (won't trigger again until conditions allow). */
|
|
@@ -44,6 +56,8 @@ export declare class TtsrManager {
|
|
|
44
56
|
resetBuffer(): void;
|
|
45
57
|
/** Check if any TTSR rules are registered. */
|
|
46
58
|
hasRules(): boolean;
|
|
59
|
+
/** All rules currently registered for TTSR monitoring, in registration order. */
|
|
60
|
+
getRules(): Rule[];
|
|
47
61
|
/** Increment message counter (call after each turn). */
|
|
48
62
|
incrementMessageCount(): void;
|
|
49
63
|
/** Get current message count. */
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel, ToolApproval } from "@oh-my-pi/pi-agent-core";
|
|
11
11
|
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
12
12
|
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, ProviderResponseMetadata, SimpleStreamOptions, Static, TextContent, TSchema } from "@oh-my-pi/pi-ai";
|
|
13
|
-
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/
|
|
13
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/oauth/types";
|
|
14
14
|
import type * as piCodingAgent from "@oh-my-pi/pi-coding-agent";
|
|
15
15
|
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
16
16
|
import type { logger as PiLogger } from "@oh-my-pi/pi-utils";
|
|
@@ -727,6 +727,13 @@ export interface ProviderConfig {
|
|
|
727
727
|
/** Optional model rewrite hook for credential-aware routing (e.g., enterprise URLs). */
|
|
728
728
|
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
729
729
|
};
|
|
730
|
+
/**
|
|
731
|
+
* Async factory that fetches the live model list from the provider endpoint.
|
|
732
|
+
* Runs through the same SQLite model-cache as built-in providers (keyed by
|
|
733
|
+
* provider name, default 24 h TTL). Receives the resolved API key (undefined
|
|
734
|
+
* when unauthenticated). Mutually exclusive with `models`.
|
|
735
|
+
*/
|
|
736
|
+
fetchDynamicModels?: (apiKey: string | undefined) => Promise<readonly ProviderModelConfig[]>;
|
|
730
737
|
}
|
|
731
738
|
/** Configuration for a model within a provider. */
|
|
732
739
|
export interface ProviderModelConfig {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* entrypoint. Legacy extensions still author parameter schemas as
|
|
9
9
|
* `Type.Object({ ... })`, so this file is served by `legacy-pi-compat.ts` in
|
|
10
10
|
* place of the real pi-ai entrypoint whenever a legacy extension imports the
|
|
11
|
-
* bare package root. Subpath imports (`@oh-my-pi/pi-ai/
|
|
11
|
+
* bare package root. Subpath imports (`@oh-my-pi/pi-ai/oauth`, etc.)
|
|
12
12
|
* continue to resolve directly against the bundled pi-ai package.
|
|
13
13
|
*
|
|
14
14
|
* The `Type` runtime is borrowed from the Zod-backed TypeBox shim that
|
|
@@ -5,6 +5,16 @@ export interface LocalProtocolOptions {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function resolveLocalRoot(options: LocalProtocolOptions): string;
|
|
7
7
|
export declare function resolveLocalUrlToPath(input: string | InternalUrl, options: LocalProtocolOptions): string;
|
|
8
|
+
/**
|
|
9
|
+
* On-disk roots the eval helpers (`read`/`write`/`append`) substitute for
|
|
10
|
+
* internal-URL schemes so e.g. `write("local://x.md")` lands where a later
|
|
11
|
+
* `read local://x.md` resolves — instead of a literal `local:/` directory under
|
|
12
|
+
* the cwd (a stdlib `pathlib.Path`/`path.resolve` collapses `local://` to
|
|
13
|
+
* `local:/`). Keyed by scheme without the `://`. Currently only `local`, but the
|
|
14
|
+
* shape is a map so additional file-backed schemes can be added without
|
|
15
|
+
* re-plumbing the worker boundary.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildEvalUrlRoots(options: LocalProtocolOptions): Record<string, string>;
|
|
8
18
|
/**
|
|
9
19
|
* Protocol handler for local:// URLs.
|
|
10
20
|
*
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Allows users to authenticate with any OAuth-compatible MCP server
|
|
5
5
|
* by providing authorization URL, token URL, and client credentials.
|
|
6
6
|
*/
|
|
7
|
-
import { OAuthCallbackFlow } from "@oh-my-pi/pi-ai/
|
|
8
|
-
import type { OAuthController, OAuthCredentials } from "@oh-my-pi/pi-ai/
|
|
7
|
+
import { OAuthCallbackFlow } from "@oh-my-pi/pi-ai/oauth/callback-server";
|
|
8
|
+
import type { OAuthController, OAuthCredentials } from "@oh-my-pi/pi-ai/oauth/types";
|
|
9
9
|
export interface MCPOAuthConfig {
|
|
10
10
|
/** Authorization endpoint URL */
|
|
11
11
|
authorizationUrl: string;
|
|
@@ -8,6 +8,9 @@ export declare function extractBracketedImagePastePath(data: string): string | u
|
|
|
8
8
|
export declare class CustomEditor extends Editor {
|
|
9
9
|
#private;
|
|
10
10
|
imageLinks?: readonly (string | undefined)[];
|
|
11
|
+
/** Treat image/paste markers as indivisible: a stray backspace deletes the whole token
|
|
12
|
+
* instead of corrupting `[Paste #1, +30 lines]` into plain text. */
|
|
13
|
+
atomicTokenPattern: RegExp;
|
|
11
14
|
/** Gradient-highlight the "ultrathink" / "orchestrate" / "workflowz" keywords as the user types
|
|
12
15
|
* them, skipping any occurrence inside code spans, fenced blocks, or XML sections. Also make
|
|
13
16
|
* pasted image placeholders visually distinct and hyperlink them once their blob file exists. */
|