@oh-my-pi/pi-coding-agent 1.340.0 → 2.0.1337
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 +115 -1
- package/README.md +1 -1
- package/examples/custom-tools/subagent/index.ts +1 -1
- package/package.json +5 -3
- package/src/cli/args.ts +13 -6
- package/src/cli/file-processor.ts +3 -3
- package/src/cli/list-models.ts +2 -2
- package/src/cli/plugin-cli.ts +1 -1
- package/src/cli/session-picker.ts +2 -2
- package/src/cli.ts +1 -1
- package/src/config.ts +3 -3
- package/src/core/agent-session.ts +189 -29
- package/src/core/bash-executor.ts +50 -10
- package/src/core/compaction/branch-summarization.ts +5 -5
- package/src/core/compaction/compaction.ts +3 -3
- package/src/core/compaction/index.ts +3 -3
- package/src/core/custom-commands/bundled/review/index.ts +156 -0
- package/src/core/custom-commands/index.ts +15 -0
- package/src/core/custom-commands/loader.ts +232 -0
- package/src/core/custom-commands/types.ts +112 -0
- package/src/core/custom-tools/index.ts +3 -3
- package/src/core/custom-tools/loader.ts +10 -8
- package/src/core/custom-tools/types.ts +11 -6
- package/src/core/custom-tools/wrapper.ts +2 -1
- package/src/core/exec.ts +22 -12
- package/src/core/export-html/index.ts +5 -5
- package/src/core/file-mentions.ts +54 -0
- package/src/core/hooks/index.ts +5 -5
- package/src/core/hooks/loader.ts +21 -16
- package/src/core/hooks/runner.ts +6 -6
- package/src/core/hooks/tool-wrapper.ts +2 -2
- package/src/core/hooks/types.ts +12 -15
- package/src/core/index.ts +6 -6
- package/src/core/logger.ts +112 -0
- package/src/core/mcp/client.ts +3 -3
- package/src/core/mcp/config.ts +1 -1
- package/src/core/mcp/index.ts +12 -12
- package/src/core/mcp/loader.ts +2 -2
- package/src/core/mcp/manager.ts +6 -6
- package/src/core/mcp/tool-bridge.ts +3 -3
- package/src/core/mcp/transports/http.ts +1 -1
- package/src/core/mcp/transports/index.ts +2 -2
- package/src/core/mcp/transports/stdio.ts +1 -1
- package/src/core/messages.ts +22 -0
- package/src/core/model-registry.ts +2 -2
- package/src/core/model-resolver.ts +103 -2
- package/src/core/plugins/doctor.ts +1 -1
- package/src/core/plugins/index.ts +6 -6
- package/src/core/plugins/installer.ts +4 -4
- package/src/core/plugins/loader.ts +4 -9
- package/src/core/plugins/manager.ts +5 -5
- package/src/core/plugins/paths.ts +3 -3
- package/src/core/sdk.ts +127 -52
- package/src/core/session-manager.ts +123 -20
- package/src/core/settings-manager.ts +106 -22
- package/src/core/skills.ts +5 -5
- package/src/core/slash-commands.ts +60 -45
- package/src/core/system-prompt.ts +6 -6
- package/src/core/title-generator.ts +94 -0
- package/src/core/tools/bash.ts +33 -157
- package/src/core/tools/context.ts +2 -2
- package/src/core/tools/edit-diff.ts +5 -5
- package/src/core/tools/edit.ts +60 -9
- package/src/core/tools/exa/company.ts +3 -3
- package/src/core/tools/exa/index.ts +16 -17
- package/src/core/tools/exa/linkedin.ts +3 -3
- package/src/core/tools/exa/mcp-client.ts +9 -9
- package/src/core/tools/exa/render.ts +5 -5
- package/src/core/tools/exa/researcher.ts +3 -3
- package/src/core/tools/exa/search.ts +6 -5
- package/src/core/tools/exa/types.ts +5 -6
- package/src/core/tools/exa/websets.ts +3 -3
- package/src/core/tools/find.ts +3 -3
- package/src/core/tools/grep.ts +6 -5
- package/src/core/tools/index.ts +114 -40
- package/src/core/tools/ls.ts +4 -4
- package/src/core/tools/lsp/client.ts +204 -108
- package/src/core/tools/lsp/config.ts +709 -35
- package/src/core/tools/lsp/edits.ts +2 -2
- package/src/core/tools/lsp/index.ts +432 -30
- package/src/core/tools/lsp/render.ts +2 -2
- package/src/core/tools/lsp/rust-analyzer.ts +3 -3
- package/src/core/tools/lsp/types.ts +5 -0
- package/src/core/tools/lsp/utils.ts +1 -1
- package/src/core/tools/notebook.ts +1 -1
- package/src/core/tools/output.ts +175 -0
- package/src/core/tools/read.ts +7 -7
- package/src/core/tools/renderers.ts +92 -13
- package/src/core/tools/review.ts +268 -0
- package/src/core/tools/task/agents.ts +1 -1
- package/src/core/tools/task/bundled-agents/explore.md +1 -1
- package/src/core/tools/task/bundled-agents/reviewer.md +53 -38
- package/src/core/tools/task/discovery.ts +2 -2
- package/src/core/tools/task/executor.ts +145 -28
- package/src/core/tools/task/index.ts +78 -30
- package/src/core/tools/task/model-resolver.ts +72 -13
- package/src/core/tools/task/parallel.ts +1 -1
- package/src/core/tools/task/render.ts +219 -30
- package/src/core/tools/task/subprocess-tool-registry.ts +89 -0
- package/src/core/tools/task/types.ts +36 -2
- package/src/core/tools/web-fetch.ts +5 -3
- package/src/core/tools/web-search/auth.ts +1 -1
- package/src/core/tools/web-search/index.ts +17 -15
- package/src/core/tools/web-search/providers/anthropic.ts +2 -2
- package/src/core/tools/web-search/providers/exa.ts +3 -5
- package/src/core/tools/web-search/providers/perplexity.ts +1 -1
- package/src/core/tools/web-search/render.ts +3 -3
- package/src/core/tools/write.ts +70 -7
- package/src/index.ts +33 -17
- package/src/main.ts +60 -34
- package/src/migrations.ts +3 -3
- package/src/modes/index.ts +5 -5
- package/src/modes/interactive/components/armin.ts +1 -1
- package/src/modes/interactive/components/assistant-message.ts +1 -1
- package/src/modes/interactive/components/bash-execution.ts +4 -4
- package/src/modes/interactive/components/bordered-loader.ts +2 -2
- package/src/modes/interactive/components/branch-summary-message.ts +2 -2
- package/src/modes/interactive/components/compaction-summary-message.ts +2 -2
- package/src/modes/interactive/components/diff.ts +1 -1
- package/src/modes/interactive/components/dynamic-border.ts +1 -1
- package/src/modes/interactive/components/footer.ts +5 -5
- package/src/modes/interactive/components/hook-editor.ts +2 -2
- package/src/modes/interactive/components/hook-input.ts +2 -2
- package/src/modes/interactive/components/hook-message.ts +3 -3
- package/src/modes/interactive/components/hook-selector.ts +2 -2
- package/src/modes/interactive/components/model-selector.ts +341 -41
- package/src/modes/interactive/components/oauth-selector.ts +3 -3
- package/src/modes/interactive/components/plugin-settings.ts +4 -4
- package/src/modes/interactive/components/queue-mode-selector.ts +2 -2
- package/src/modes/interactive/components/session-selector.ts +24 -11
- package/src/modes/interactive/components/settings-defs.ts +51 -3
- package/src/modes/interactive/components/settings-selector.ts +13 -16
- package/src/modes/interactive/components/show-images-selector.ts +2 -2
- package/src/modes/interactive/components/theme-selector.ts +2 -2
- package/src/modes/interactive/components/thinking-selector.ts +2 -2
- package/src/modes/interactive/components/tool-execution.ts +44 -8
- package/src/modes/interactive/components/tree-selector.ts +5 -5
- package/src/modes/interactive/components/user-message-selector.ts +2 -2
- package/src/modes/interactive/components/user-message.ts +1 -1
- package/src/modes/interactive/components/welcome.ts +42 -5
- package/src/modes/interactive/interactive-mode.ts +169 -48
- package/src/modes/interactive/theme/theme.ts +8 -7
- package/src/modes/print-mode.ts +4 -3
- package/src/modes/rpc/rpc-client.ts +4 -4
- package/src/modes/rpc/rpc-mode.ts +21 -11
- package/src/modes/rpc/rpc-types.ts +3 -3
- package/src/utils/changelog.ts +2 -2
- package/src/utils/clipboard.ts +1 -1
- package/src/utils/shell-snapshot.ts +218 -0
- package/src/utils/shell.ts +93 -13
- package/src/utils/tools-manager.ts +1 -1
- package/examples/custom-tools/subagent/agents/reviewer.md +0 -35
- package/src/core/tools/exa/logger.ts +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,120 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.0.1337] - 2026-01-03
|
|
6
|
+
### Added
|
|
7
|
+
|
|
8
|
+
- Added shell environment snapshot to preserve user aliases, functions, and shell options when executing bash commands
|
|
9
|
+
- Added support for `PI_BASH_NO_CI`, `PI_BASH_NO_LOGIN`, and `PI_SHELL_PREFIX` environment variables for shell customization
|
|
10
|
+
- Added zsh support alongside bash for shell detection and configuration
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Changed shell detection to prefer user's `$SHELL` when it's bash or zsh, with improved fallback path resolution
|
|
15
|
+
- Changed Edit tool to reject `.ipynb` files with guidance to use NotebookEdit tool instead
|
|
16
|
+
|
|
17
|
+
## [1.500.0] - 2026-01-03
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Added provider tabs to model selector with Tab/Arrow navigation for filtering models by provider
|
|
21
|
+
- Added context menu to model selector for choosing model role (Default, Smol, Slow) instead of keyboard shortcuts
|
|
22
|
+
- Added LSP diagnostics display in tool execution output showing errors and warnings after file edits
|
|
23
|
+
- Added centralized file logger with daily rotation to `~/.pi/logs/` for debugging production issues
|
|
24
|
+
- Added `logger` property to hook and custom tool APIs for error/warning/debug logging
|
|
25
|
+
- Added `output` tool to read full agent/task outputs by ID when truncated previews are insufficient
|
|
26
|
+
- Added `task` tool to reviewer agent, enabling parallel exploration of large codebases during reviews
|
|
27
|
+
- Added subprocess tool registry for extracting and rendering tool data from subprocess agents in real-time
|
|
28
|
+
- Added combined review result rendering showing verdict and findings in a tree structure
|
|
29
|
+
- Auto-read file mentions: Reference files with `@path/to/file.ext` syntax in prompts to automatically inject their contents, eliminating manual Read tool calls
|
|
30
|
+
- Added `hidden` property for custom tools to exclude them from default tool list unless explicitly requested
|
|
31
|
+
- Added `explicitTools` option to `createAgentSession` for enabling hidden tools by name
|
|
32
|
+
- Added example review tools (`report_finding`, `submit_review`) with structured findings accumulation and verdict rendering
|
|
33
|
+
- Added `/review` example command for interactive code review with branch comparison, uncommitted changes, and commit review modes
|
|
34
|
+
- Custom TypeScript slash commands: Create programmable commands at `~/.pi/agent/commands/[name]/index.ts` or `.pi/commands/[name]/index.ts`. Commands export a factory returning `{ name, description, execute(args, ctx) }`. Return a string to send as LLM prompt, or void for fire-and-forget actions. Full access to `HookCommandContext` for UI dialogs, session control, and shell execution.
|
|
35
|
+
- Claude command directories: Markdown slash commands now also load from `~/.claude/commands/` and `.claude/commands/` (parallel to existing `.pi/commands/` support)
|
|
36
|
+
- `commands.enableClaudeUser` and `commands.enableClaudeProject` settings to disable Claude command directory loading
|
|
37
|
+
- `/export --copy` option to copy entire session as formatted text to clipboard
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- Changed model selector keyboard shortcuts from S/L keys to a context menu opened with Enter
|
|
42
|
+
- Changed model role indicators from symbols (✓ ⚡ 🧠) to labeled badges ([ DEFAULT ] [ SMOL ] [ SLOW ])
|
|
43
|
+
- Changed model list sorting to include secondary sort by model ID within each provider
|
|
44
|
+
- Changed silent error suppression to log warnings and debug info for tool errors, theme loading, and command loading failures
|
|
45
|
+
- Changed Task tool progress display to show agent index (e.g., `reviewer(0)`) for easier Output tool ID derivation
|
|
46
|
+
- Changed Task tool output to only include file paths when Output tool is unavailable, providing Read tool fallback
|
|
47
|
+
- Changed Task tool output references to use simpler ID format (e.g., `reviewer_0`) with line/char counts for Output tool integration
|
|
48
|
+
- Changed subagent recursion prevention from blanket blocking to same-agent blocking. Non-recursive agents can now spawn other agent types (e.g., reviewer can spawn explore agents) but cannot spawn themselves.
|
|
49
|
+
- Changed `/review` command from markdown to interactive TypeScript with mode selection menu (branch comparison, uncommitted changes, commit review, custom)
|
|
50
|
+
- Changed bundled commands to be overridable by user/project commands with same name
|
|
51
|
+
- Changed subprocess termination to wait for message_end event to capture accurate token counts
|
|
52
|
+
- Changed token counting in subprocess to accumulate across messages instead of overwriting
|
|
53
|
+
- Updated bundled `reviewer` agent to use structured review tools with priority-based findings (P0-P3) and formal verdict submission
|
|
54
|
+
- Task tool now streams artifacts in real-time: input written before spawn, session jsonl written by subprocess, output written at completion
|
|
55
|
+
|
|
56
|
+
### Removed
|
|
57
|
+
|
|
58
|
+
- Removed separate Exa error logger in favor of centralized logging system
|
|
59
|
+
- Removed `findings_count` parameter from `submit_review` tool - findings are now counted automatically
|
|
60
|
+
- Removed artifacts location display from task tool output
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
|
|
64
|
+
- Fixed race condition in event listener iteration by copying array before iteration to prevent mutation during callbacks
|
|
65
|
+
- Fixed potential memory leak from orphaned abort controllers by properly aborting existing controllers before replacement
|
|
66
|
+
- Fixed stream reader resource leak by adding proper `releaseLock()` calls in finally blocks
|
|
67
|
+
- Fixed hook API methods throwing clear errors when handlers are not initialized instead of silently failing
|
|
68
|
+
- Fixed LSP client race conditions with concurrent client creation and file operations using proper locking
|
|
69
|
+
- Fixed Task tool progress display showing stale data by cloning progress objects before passing to callbacks
|
|
70
|
+
- Fixed Task tool missing final progress events by waiting for readline to close before resolving
|
|
71
|
+
- Fixed RPC mode race condition with concurrent prompt commands by serializing execution
|
|
72
|
+
- Fixed pre-commit hook race condition causing `index.lock` errors when GitKraken/IDE git integrations detect file changes during formatting
|
|
73
|
+
- Fixed Task tool output artifacts (`out.md`) containing duplicated text from streaming updates
|
|
74
|
+
- Fixed Task tool progress display showing repeated nearly-identical lines during streaming
|
|
75
|
+
- Fixed Task tool subprocess model selection ignoring agent's configured model and falling back to settings default. The `--model` flag now accepts `provider/model` format directly.
|
|
76
|
+
- Fixed Task tool showing "done + succeeded" when aborted; now correctly displays "⊘ aborted" status
|
|
77
|
+
|
|
78
|
+
## [1.341.0] - 2026-01-03
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- Added interruptMode setting to control when queued messages are processed during tool execution.
|
|
82
|
+
- Implemented getter and setter methods in SettingsManager for interrupt mode persistence.
|
|
83
|
+
- Exposed interruptMode configuration in interactive settings UI with immediate/wait options.
|
|
84
|
+
- Wired interrupt mode through AgentSession and SDK to enable runtime configuration.
|
|
85
|
+
- Model roles: Configure different models for different purposes (default, smol, slow) via `/model` selector
|
|
86
|
+
- Model selector key bindings: Enter sets default, S sets smol, L sets slow, Escape closes
|
|
87
|
+
- Model selector shows role markers: ✓ for default, ⚡ for smol, 🧠 for slow
|
|
88
|
+
- `pi/<role>` model aliases in Task tool agent definitions (e.g., `model: pi/smol, haiku, flash, mini`)
|
|
89
|
+
- Smol model auto-discovery using priority chain: haiku > flash > mini
|
|
90
|
+
- Slow model auto-discovery using priority chain: gpt-5.2-codex > codex > gpt > opus > pro
|
|
91
|
+
- CLI args for model roles: `--smol <model>` and `--slow <model>` (ephemeral, not persisted)
|
|
92
|
+
- Env var overrides: `PI_SMOL_MODEL` and `PI_SLOW_MODEL`
|
|
93
|
+
- Title generation now uses configured smol model from settings
|
|
94
|
+
- LSP diagnostics on edit: Edit tool can now return LSP diagnostics after editing code files. Disabled by default to avoid noise during multi-edit sequences. Enable via `lsp.diagnosticsOnEdit` setting.
|
|
95
|
+
- LSP workspace diagnostics: New `lsp action=workspace_diagnostics` command checks the entire project for errors. Auto-detects project type and uses appropriate checker (rust-analyzer/cargo for Rust, tsc for TypeScript, go build for Go, pyright for Python).
|
|
96
|
+
- LSP local binary resolution: LSP servers installed in project-local directories are now discovered automatically. Checks `node_modules/.bin/` for Node.js projects, `.venv/bin/`/`venv/bin/` for Python projects, and `vendor/bundle/bin/` for Ruby projects before falling back to `$PATH`.
|
|
97
|
+
- LSP format on write: Write tool now automatically formats code files using LSP after writing. Uses the language server's built-in formatter (e.g., rustfmt for Rust, gofmt for Go). Controlled via `lsp.formatOnWrite` setting (enabled by default).
|
|
98
|
+
- LSP diagnostics on write: Write tool now returns LSP diagnostics (errors/warnings) after writing code files. This gives immediate feedback on syntax errors and type issues. Controlled via `lsp.diagnosticsOnWrite` setting (enabled by default).
|
|
99
|
+
- LSP server warmup at startup: LSP servers are now started at launch to avoid cold-start delays when first writing files.
|
|
100
|
+
- LSP server status in welcome banner: Shows which language servers are active and ready.
|
|
101
|
+
- Edit fuzzy match setting: Added `edit.fuzzyMatch` setting (enabled by default) to control whether the edit tool accepts high-confidence fuzzy matches for whitespace/indentation differences. Toggle via `/settings`.
|
|
102
|
+
- Multi-server LSP diagnostics: Diagnostics now query all applicable language servers for a file type. For TypeScript/JavaScript projects with Biome, this means both type errors (from tsserver) and lint errors (from Biome) are reported together.
|
|
103
|
+
- Comprehensive LSP server configurations for 40+ languages including Rust, Go, Python, Java, Kotlin, Scala, Haskell, OCaml, Elixir, Ruby, PHP, C#, Lua, Nix, and many more. Each server includes sensible defaults for args, settings, and init options.
|
|
104
|
+
- Extended LSP config file search paths: Now searches for `lsp.json`, `.lsp.json` in project root and `.pi/` subdirectory, plus user-level configs in `~/.pi/` and home directory.
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
|
|
108
|
+
- LSP settings moved to dedicated "LSP" tab in `/settings` for better organization
|
|
109
|
+
- Improved grep tool description to document pagination options (`headLimit`, `offset`) and clarify recursive search behavior
|
|
110
|
+
- LSP idle timeout now disabled by default. Configure via `idleTimeoutMs` in lsp.json to auto-shutdown inactive servers.
|
|
111
|
+
- Model settings now use role-based storage (`modelRoles` map) instead of single `defaultProvider`/`defaultModel` fields. Supports multiple model roles (default, small, etc.)
|
|
112
|
+
- Session model persistence now uses `"provider/modelId"` string format with optional role field
|
|
113
|
+
|
|
114
|
+
### Fixed
|
|
115
|
+
|
|
116
|
+
- Recent sessions now show in welcome banner (was never wired up).
|
|
117
|
+
- Auto-generated session titles: Sessions are now automatically titled based on the first message using a small model (Haiku/GPT-4o-mini/Flash). Titles are shown in the terminal window title, recent sessions list, and --resume picker. The resume picker shows title with dimmed first message preview below.
|
|
118
|
+
|
|
5
119
|
## [1.340.0] - 2026-01-03
|
|
6
120
|
|
|
7
121
|
### Changed
|
|
@@ -1286,4 +1400,4 @@ Initial public release.
|
|
|
1286
1400
|
- Git branch display in footer
|
|
1287
1401
|
- Message queueing during streaming responses
|
|
1288
1402
|
- OAuth integration for Gmail and Google Calendar access
|
|
1289
|
-
- HTML export with syntax highlighting and collapsible sections
|
|
1403
|
+
- HTML export with syntax highlighting and collapsible sections
|
package/README.md
CHANGED
|
@@ -192,7 +192,7 @@ The agent reads, writes, and edits files, and executes commands via bash.
|
|
|
192
192
|
| ------------------------- | --------------------------------------------------------------------------- |
|
|
193
193
|
| `/settings` | Open settings menu (thinking, theme, queue mode, toggles) |
|
|
194
194
|
| `/model` | Switch models mid-session (fuzzy search, arrow keys, Enter to select) |
|
|
195
|
-
| `/export [file]`
|
|
195
|
+
| `/export [file\|--copy]` | Export session to HTML file or copy to clipboard |
|
|
196
196
|
| `/share` | Upload session as secret GitHub gist, get shareable URL (requires `gh` CLI) |
|
|
197
197
|
| `/session` | Show session info: path, message counts, token usage, cost |
|
|
198
198
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
@@ -18,7 +18,7 @@ import * as path from "node:path";
|
|
|
18
18
|
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
19
19
|
import type { Message } from "@oh-my-pi/pi-ai";
|
|
20
20
|
import type { CustomTool, CustomToolAPI, CustomToolFactory } from "@oh-my-pi/pi-coding-agent";
|
|
21
|
-
import { type AgentConfig, type AgentScope, discoverAgents, formatAgentList } from "./agents
|
|
21
|
+
import { type AgentConfig, type AgentScope, discoverAgents, formatAgentList } from "./agents";
|
|
22
22
|
|
|
23
23
|
const MAX_PARALLEL_TASKS = 8;
|
|
24
24
|
const MAX_CONCURRENCY = 4;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1337",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"clean": "rm -rf dist",
|
|
34
34
|
"build": "tsgo -p tsconfig.build.json && chmod +x dist/cli.js && npm run copy-assets",
|
|
35
35
|
"build:binary": "npm run build && bun build --compile ./dist/cli.js --outfile dist/pi && npm run copy-binary-assets",
|
|
36
|
-
"copy-assets": "mkdir -p dist/modes/interactive/theme && cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && mkdir -p dist/core/export-html && cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/",
|
|
36
|
+
"copy-assets": "mkdir -p dist/modes/interactive/theme && cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && mkdir -p dist/core/export-html && cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && mkdir -p dist/core/tools/task/bundled-agents && cp src/core/tools/task/bundled-agents/*.md dist/core/tools/task/bundled-agents/",
|
|
37
37
|
"copy-binary-assets": "cp package.json dist/ && cp README.md dist/ && cp CHANGELOG.md dist/ && mkdir -p dist/theme && cp src/modes/interactive/theme/*.json dist/theme/ && mkdir -p dist/export-html && cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/export-html/ && cp -r docs dist/ && cp -r examples dist/",
|
|
38
38
|
"test": "vitest --run",
|
|
39
39
|
"prepublishOnly": "npm run clean && npm run build"
|
|
@@ -53,7 +53,9 @@
|
|
|
53
53
|
"highlight.js": "^11.11.1",
|
|
54
54
|
"marked": "^15.0.12",
|
|
55
55
|
"minimatch": "^10.1.1",
|
|
56
|
-
"strip-ansi": "^7.1.2"
|
|
56
|
+
"strip-ansi": "^7.1.2",
|
|
57
|
+
"winston": "^3.17.0",
|
|
58
|
+
"winston-daily-rotate-file": "^5.0.0"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
61
|
"@types/diff": "^7.0.2",
|
package/src/cli/args.ts
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
-
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config
|
|
8
|
-
import { allTools, type ToolName } from "../core/tools/index
|
|
7
|
+
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config";
|
|
8
|
+
import { allTools, type ToolName } from "../core/tools/index";
|
|
9
9
|
|
|
10
10
|
export type Mode = "text" | "json" | "rpc";
|
|
11
11
|
|
|
12
12
|
export interface Args {
|
|
13
13
|
provider?: string;
|
|
14
14
|
model?: string;
|
|
15
|
+
smol?: string;
|
|
16
|
+
slow?: string;
|
|
15
17
|
apiKey?: string;
|
|
16
18
|
systemPrompt?: string;
|
|
17
19
|
appendSystemPrompt?: string;
|
|
@@ -69,6 +71,10 @@ export function parseArgs(args: string[]): Args {
|
|
|
69
71
|
result.provider = args[++i];
|
|
70
72
|
} else if (arg === "--model" && i + 1 < args.length) {
|
|
71
73
|
result.model = args[++i];
|
|
74
|
+
} else if (arg === "--smol" && i + 1 < args.length) {
|
|
75
|
+
result.smol = args[++i];
|
|
76
|
+
} else if (arg === "--slow" && i + 1 < args.length) {
|
|
77
|
+
result.slow = args[++i];
|
|
72
78
|
} else if (arg === "--api-key" && i + 1 < args.length) {
|
|
73
79
|
result.apiKey = args[++i];
|
|
74
80
|
} else if (arg === "--system-prompt" && i + 1 < args.length) {
|
|
@@ -146,8 +152,9 @@ ${chalk.bold("Usage:")}
|
|
|
146
152
|
${APP_NAME} [options] [@files...] [messages...]
|
|
147
153
|
|
|
148
154
|
${chalk.bold("Options:")}
|
|
149
|
-
--
|
|
150
|
-
--
|
|
155
|
+
--model <pattern> Model to use (fuzzy match: "opus", "gpt-5.2", or "p-openai/gpt-5.2")
|
|
156
|
+
--smol <id> Smol/fast model for lightweight tasks (or PI_SMOL_MODEL env)
|
|
157
|
+
--slow <id> Slow/reasoning model for thorough analysis (or PI_SLOW_MODEL env)
|
|
151
158
|
--api-key <key> API key (defaults to env vars)
|
|
152
159
|
--system-prompt <text> System prompt (default: coding assistant prompt)
|
|
153
160
|
--append-system-prompt <text> Append text or file contents to the system prompt
|
|
@@ -191,8 +198,8 @@ ${chalk.bold("Examples:")}
|
|
|
191
198
|
# Continue previous session
|
|
192
199
|
${APP_NAME} --continue "What did we discuss?"
|
|
193
200
|
|
|
194
|
-
# Use different model
|
|
195
|
-
${APP_NAME} --
|
|
201
|
+
# Use different model (fuzzy matching)
|
|
202
|
+
${APP_NAME} --model opus "Help me refactor this code"
|
|
196
203
|
|
|
197
204
|
# Limit model cycling to specific models
|
|
198
205
|
${APP_NAME} --models claude-sonnet,claude-haiku,gpt-4o
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { access, readFile, stat } from "node:fs/promises";
|
|
6
|
+
import { resolve } from "node:path";
|
|
6
7
|
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
7
8
|
import chalk from "chalk";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { detectSupportedImageMimeTypeFromFile } from "../utils/mime.js";
|
|
9
|
+
import { resolveReadPath } from "../core/tools/path-utils";
|
|
10
|
+
import { detectSupportedImageMimeTypeFromFile } from "../utils/mime";
|
|
11
11
|
|
|
12
12
|
export interface ProcessedFiles {
|
|
13
13
|
text: string;
|
package/src/cli/list-models.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { Api, Model } from "@oh-my-pi/pi-ai";
|
|
6
|
-
import type { ModelRegistry } from "../core/model-registry
|
|
7
|
-
import { fuzzyFilter } from "../utils/fuzzy
|
|
6
|
+
import type { ModelRegistry } from "../core/model-registry";
|
|
7
|
+
import { fuzzyFilter } from "../utils/fuzzy";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Format a number as human-readable (e.g., 200000 -> "200K", 1000000 -> "1M")
|
package/src/cli/plugin-cli.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
-
import { PluginManager, parseSettingValue, validateSetting } from "../core/plugins/index
|
|
8
|
+
import { PluginManager, parseSettingValue, validateSetting } from "../core/plugins/index";
|
|
9
9
|
|
|
10
10
|
// =============================================================================
|
|
11
11
|
// Types
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { ProcessTerminal, TUI } from "@oh-my-pi/pi-tui";
|
|
6
|
-
import type { SessionInfo } from "../core/session-manager
|
|
7
|
-
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector
|
|
6
|
+
import type { SessionInfo } from "../core/session-manager";
|
|
7
|
+
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector";
|
|
8
8
|
|
|
9
9
|
/** Show TUI session selector and return selected session path or null if cancelled */
|
|
10
10
|
export async function selectSession(sessions: SessionInfo[]): Promise<string | null> {
|
package/src/cli.ts
CHANGED
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "fs";
|
|
2
|
-
import { homedir } from "os";
|
|
3
|
-
import { dirname, join, resolve } from "path";
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
|
|
5
5
|
// =============================================================================
|
|
6
6
|
// Package Detection
|