@oh-my-pi/pi-coding-agent 13.2.0 → 13.3.0
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 +54 -1
- package/package.json +7 -7
- package/scripts/format-prompts.ts +33 -14
- package/scripts/generate-docs-index.ts +2 -2
- package/src/capability/index.ts +1 -2
- package/src/cli/args.ts +3 -3
- package/src/cli/config-cli.ts +1 -1
- package/src/cli/file-processor.ts +1 -2
- package/src/cli/grep-cli.ts +1 -1
- package/src/cli/jupyter-cli.ts +1 -1
- package/src/cli/plugin-cli.ts +1 -1
- package/src/cli/setup-cli.ts +1 -1
- package/src/cli/shell-cli.ts +1 -1
- package/src/cli/ssh-cli.ts +1 -1
- package/src/cli/stats-cli.ts +1 -2
- package/src/cli/update-cli.ts +1 -2
- package/src/cli/web-search-cli.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/commands/launch.ts +2 -1
- package/src/commit/agentic/agent.ts +2 -1
- package/src/commit/agentic/index.ts +1 -2
- package/src/commit/agentic/prompts/system.md +3 -3
- package/src/commit/agentic/tools/propose-changelog.ts +30 -19
- package/src/commit/changelog/generate.ts +16 -6
- package/src/commit/changelog/index.ts +2 -1
- package/src/commit/pipeline.ts +1 -2
- package/src/commit/prompts/reduce-system.md +1 -1
- package/src/commit/types.ts +10 -1
- package/src/config/keybindings.ts +1 -2
- package/src/config/model-registry.ts +1 -1
- package/src/config/prompt-templates.ts +14 -2
- package/src/config/settings-schema.ts +36 -4
- package/src/config/settings.ts +19 -2
- package/src/config.ts +1 -2
- package/src/debug/index.ts +1 -1
- package/src/debug/report-bundle.ts +1 -2
- package/src/debug/system-info.ts +1 -2
- package/src/discovery/agents.ts +2 -2
- package/src/discovery/builtin.ts +8 -9
- package/src/discovery/claude-plugins.ts +2 -2
- package/src/discovery/claude.ts +30 -12
- package/src/discovery/codex.ts +3 -3
- package/src/discovery/cursor.ts +5 -4
- package/src/discovery/gemini.ts +5 -5
- package/src/discovery/helpers.ts +47 -69
- package/src/discovery/mcp-json.ts +3 -3
- package/src/discovery/opencode.ts +7 -8
- package/src/discovery/ssh.ts +3 -3
- package/src/discovery/vscode.ts +3 -2
- package/src/discovery/windsurf.ts +3 -2
- package/src/exa/company.ts +1 -1
- package/src/exa/factory.ts +1 -6
- package/src/exa/linkedin.ts +1 -1
- package/src/exa/mcp-client.ts +19 -8
- package/src/exa/search.ts +2 -2
- package/src/exa/types.ts +3 -3
- package/src/exec/bash-executor.ts +2 -1
- package/src/exec/non-interactive-env.ts +43 -0
- package/src/export/custom-share.ts +1 -1
- package/src/export/html/index.ts +1 -2
- package/src/extensibility/custom-commands/loader.ts +1 -2
- package/src/extensibility/plugins/installer.ts +1 -2
- package/src/extensibility/plugins/loader.ts +1 -2
- package/src/extensibility/plugins/manager.ts +3 -2
- package/src/extensibility/skills.ts +59 -115
- package/src/index.ts +1 -3
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/ipy/executor.ts +1 -2
- package/src/ipy/gateway-coordinator.ts +1 -2
- package/src/ipy/modules.ts +1 -1
- package/src/ipy/runtime.ts +2 -3
- package/src/main.ts +1 -2
- package/src/mcp/config.ts +2 -2
- package/src/mcp/transports/stdio.ts +1 -2
- package/src/memories/index.ts +1 -2
- package/src/modes/components/extensions/extension-dashboard.ts +1 -1
- package/src/modes/components/extensions/inspector-panel.ts +8 -2
- package/src/modes/components/footer.ts +1 -2
- package/src/modes/components/settings-defs.ts +17 -1
- package/src/modes/components/status-line/segments.ts +1 -2
- package/src/modes/components/status-line.ts +7 -5
- package/src/modes/components/tool-execution.ts +3 -10
- package/src/modes/components/welcome.ts +1 -1
- package/src/modes/controllers/command-controller.ts +1 -2
- package/src/modes/controllers/mcp-command-controller.ts +5 -4
- package/src/modes/controllers/selector-controller.ts +22 -1
- package/src/modes/controllers/ssh-command-controller.ts +1 -1
- package/src/modes/interactive-mode.ts +11 -3
- package/src/modes/oauth-manual-input.ts +42 -0
- package/src/modes/shared.ts +1 -2
- package/src/modes/theme/theme.ts +1 -2
- package/src/modes/types.ts +2 -0
- package/src/patch/hashline.ts +19 -1
- package/src/patch/index.ts +1 -25
- package/src/prompts/agents/designer.md +7 -10
- package/src/prompts/agents/explore.md +15 -23
- package/src/prompts/agents/init.md +23 -23
- package/src/prompts/agents/plan.md +14 -77
- package/src/prompts/agents/reviewer.md +6 -5
- package/src/prompts/agents/task.md +13 -11
- package/src/prompts/compaction/branch-summary.md +3 -3
- package/src/prompts/compaction/compaction-short-summary.md +7 -7
- package/src/prompts/compaction/compaction-summary-context.md +1 -1
- package/src/prompts/compaction/compaction-summary.md +5 -5
- package/src/prompts/compaction/compaction-turn-prefix.md +3 -3
- package/src/prompts/compaction/compaction-update-summary.md +11 -11
- package/src/prompts/memories/consolidation.md +5 -5
- package/src/prompts/memories/read-path.md +6 -6
- package/src/prompts/memories/stage_one_input.md +1 -1
- package/src/prompts/memories/stage_one_system.md +5 -5
- package/src/prompts/review-request.md +4 -4
- package/src/prompts/system/agent-creation-architect.md +17 -17
- package/src/prompts/system/agent-creation-user.md +2 -2
- package/src/prompts/system/commit-message-system.md +2 -0
- package/src/prompts/system/custom-system-prompt.md +4 -4
- package/src/prompts/system/plan-mode-active.md +20 -20
- package/src/prompts/system/plan-mode-approved.md +7 -7
- package/src/prompts/system/plan-mode-reference.md +2 -2
- package/src/prompts/system/plan-mode-subagent.md +8 -8
- package/src/prompts/system/subagent-submit-reminder.md +5 -5
- package/src/prompts/system/subagent-system-prompt.md +29 -22
- package/src/prompts/system/subagent-user-prompt.md +7 -3
- package/src/prompts/system/summarization-system.md +1 -1
- package/src/prompts/system/system-prompt.md +214 -226
- package/src/prompts/system/title-system.md +2 -2
- package/src/prompts/system/ttsr-interrupt.md +1 -1
- package/src/prompts/system/web-search.md +16 -16
- package/src/prompts/tools/ask.md +1 -3
- package/src/prompts/tools/await.md +2 -4
- package/src/prompts/tools/bash.md +5 -7
- package/src/prompts/tools/browser.md +4 -6
- package/src/prompts/tools/calculator.md +1 -3
- package/src/prompts/tools/cancel-job.md +2 -4
- package/src/prompts/tools/exit-plan-mode.md +7 -7
- package/src/prompts/tools/fetch.md +0 -2
- package/src/prompts/tools/find.md +3 -5
- package/src/prompts/tools/gemini-image.md +6 -22
- package/src/prompts/tools/grep.md +4 -6
- package/src/prompts/tools/hashline.md +56 -15
- package/src/prompts/tools/lsp.md +1 -3
- package/src/prompts/tools/patch.md +7 -9
- package/src/prompts/tools/python.md +10 -14
- package/src/prompts/tools/read.md +0 -2
- package/src/prompts/tools/replace.md +5 -7
- package/src/prompts/tools/ssh.md +3 -5
- package/src/prompts/tools/task-summary.md +4 -4
- package/src/prompts/tools/task.md +7 -9
- package/src/prompts/tools/todo-write.md +7 -9
- package/src/prompts/tools/web-search.md +3 -5
- package/src/prompts/tools/write.md +3 -5
- package/src/sdk.ts +4 -2
- package/src/session/agent-session.ts +10 -26
- package/src/session/agent-storage.ts +1 -2
- package/src/session/history-storage.ts +1 -2
- package/src/session/session-manager.ts +10 -2
- package/src/slash-commands/builtin-registry.ts +26 -1
- package/src/ssh/connection-manager.ts +11 -2
- package/src/ssh/sshfs-mount.ts +7 -1
- package/src/system-prompt.ts +29 -103
- package/src/task/agents.ts +1 -1
- package/src/task/index.ts +211 -70
- package/src/task/render.ts +24 -8
- package/src/task/types.ts +6 -1
- package/src/task/worktree.ts +394 -32
- package/src/tools/ask.ts +0 -1
- package/src/tools/bash-interactive.ts +2 -45
- package/src/tools/bash.ts +5 -5
- package/src/tools/browser.ts +1 -2
- package/src/tools/gemini-image.ts +8 -28
- package/src/tools/json-tree.ts +2 -1
- package/src/tools/python.ts +1 -1
- package/src/tools/read.ts +1 -2
- package/src/tools/submit-result.ts +22 -23
- package/src/utils/commit-message-generator.ts +132 -0
- package/src/utils/tools-manager.ts +1 -2
- package/src/web/scrapers/artifacthub.ts +2 -1
- package/src/web/scrapers/aur.ts +2 -1
- package/src/web/scrapers/biorxiv.ts +2 -1
- package/src/web/scrapers/bluesky.ts +2 -1
- package/src/web/scrapers/chocolatey.ts +2 -1
- package/src/web/scrapers/cisa-kev.ts +2 -1
- package/src/web/scrapers/clojars.ts +2 -1
- package/src/web/scrapers/coingecko.ts +2 -1
- package/src/web/scrapers/crates-io.ts +2 -1
- package/src/web/scrapers/crossref.ts +2 -1
- package/src/web/scrapers/discogs.ts +3 -1
- package/src/web/scrapers/discourse.ts +2 -1
- package/src/web/scrapers/dockerhub.ts +2 -1
- package/src/web/scrapers/fdroid.ts +2 -1
- package/src/web/scrapers/firefox-addons.ts +2 -1
- package/src/web/scrapers/flathub.ts +2 -1
- package/src/web/scrapers/gitlab.ts +1 -1
- package/src/web/scrapers/go-pkg.ts +2 -1
- package/src/web/scrapers/hackage.ts +2 -1
- package/src/web/scrapers/hackernews.ts +2 -1
- package/src/web/scrapers/hex.ts +2 -1
- package/src/web/scrapers/huggingface.ts +2 -1
- package/src/web/scrapers/jetbrains-marketplace.ts +2 -1
- package/src/web/scrapers/lemmy.ts +2 -1
- package/src/web/scrapers/lobsters.ts +2 -1
- package/src/web/scrapers/mastodon.ts +2 -1
- package/src/web/scrapers/maven.ts +2 -1
- package/src/web/scrapers/mdn.ts +2 -1
- package/src/web/scrapers/metacpan.ts +2 -1
- package/src/web/scrapers/musicbrainz.ts +3 -1
- package/src/web/scrapers/npm.ts +2 -1
- package/src/web/scrapers/nuget.ts +2 -1
- package/src/web/scrapers/nvd.ts +2 -1
- package/src/web/scrapers/ollama.ts +2 -1
- package/src/web/scrapers/open-vsx.ts +2 -1
- package/src/web/scrapers/opencorporates.ts +2 -1
- package/src/web/scrapers/openlibrary.ts +2 -1
- package/src/web/scrapers/orcid.ts +3 -1
- package/src/web/scrapers/osv.ts +2 -1
- package/src/web/scrapers/packagist.ts +2 -1
- package/src/web/scrapers/pub-dev.ts +2 -1
- package/src/web/scrapers/pubmed.ts +2 -1
- package/src/web/scrapers/pypi.ts +2 -1
- package/src/web/scrapers/rawg.ts +2 -8
- package/src/web/scrapers/reddit.ts +2 -1
- package/src/web/scrapers/repology.ts +2 -1
- package/src/web/scrapers/rfc.ts +2 -1
- package/src/web/scrapers/rubygems.ts +2 -1
- package/src/web/scrapers/searchcode.ts +2 -1
- package/src/web/scrapers/sec-edgar.ts +2 -1
- package/src/web/scrapers/semantic-scholar.ts +2 -1
- package/src/web/scrapers/snapcraft.ts +2 -1
- package/src/web/scrapers/sourcegraph.ts +2 -1
- package/src/web/scrapers/spdx.ts +2 -1
- package/src/web/scrapers/stackoverflow.ts +2 -1
- package/src/web/scrapers/terraform.ts +2 -1
- package/src/web/scrapers/types.ts +0 -11
- package/src/web/scrapers/vimeo.ts +2 -1
- package/src/web/scrapers/vscode-marketplace.ts +2 -1
- package/src/web/scrapers/w3c.ts +2 -1
- package/src/web/scrapers/wikidata.ts +2 -1
- package/src/web/search/index.ts +10 -14
- package/src/web/search/provider.ts +2 -2
- package/src/web/search/providers/codex.ts +1 -2
- package/src/web/search/providers/exa.ts +42 -10
- package/src/web/search/providers/gemini.ts +1 -1
- package/src/web/search/providers/perplexity.ts +20 -9
- package/src/web/search/providers/utils.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,18 +2,71 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [13.3.0] - 2026-02-26
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Renamed `task.isolation.enabled` (boolean) setting to `task.isolation.mode` (enum: `none`, `worktree`, `fuse-overlay`). Existing `true`/`false` values are auto-migrated to `worktree`/`none`.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `PERPLEXITY_COOKIES` env var for Perplexity web search via session cookies extracted from desktop app
|
|
14
|
+
- Added `fuse-overlay` isolation mode for subagents using `fuse-overlayfs` (copy-on-write overlay, no baseline patch apply needed)
|
|
15
|
+
- Added `task.isolation.merge` setting (`patch` or `branch`) to control how isolated task changes are integrated back. `branch` mode commits each task to a temp branch and cherry-picks for clean commit history
|
|
16
|
+
- Added `task.isolation.commits` setting (`generic` or `ai`) for commit messages on isolated task branches and nested repos. `ai` mode uses a smol model to generate conventional commit messages from diffs
|
|
17
|
+
- Nested non-submodule git repos are now discovered and handled during task isolation (changes captured and applied independently from parent repo)
|
|
18
|
+
- Added `task.eager` setting to encourage the agent to delegate work to subagents by default
|
|
19
|
+
- Added manual OAuth login flow that lets users paste redirect URLs with /login for callback-server providers and prevents overlapping logins
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Fixed nested repo changes being lost when tasks commit inside the isolation (baseline state is now committed before task runs, so delta correctly excludes it)
|
|
24
|
+
- Fixed nested repo patches conflicting when multiple tasks contribute to the same repo (baseline untracked files no longer leak into patches)
|
|
25
|
+
- Nested repo changes are now committed after patch application (previously left as untracked files)
|
|
26
|
+
- Failed tasks no longer create stale branches or capture garbage patches (gated on exit code)
|
|
27
|
+
- Merge failures (e.g. conflicting patches) are now non-fatal — agent output is preserved with `merge failed` status instead of `failed`
|
|
28
|
+
- Stale branches are cleaned up when `commitToBranch` fails
|
|
29
|
+
- Commit message generator filters lock files from diffs before AI summarization
|
|
30
|
+
|
|
31
|
+
## [13.2.1] - 2026-02-24
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- Fixed changelog tools to enforce category-specific arrays and reuse the shared category list for generation
|
|
35
|
+
- Non-interactive environment variables (pager, editor, prompt suppression) were not applied to non-PTY bash execution, causing commands to potentially block on pagers or prompts
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Extracted non-interactive environment config from `bash-interactive.ts` into shared `non-interactive-env.ts` module, applied consistently to all bash execution paths
|
|
5
40
|
## [13.2.0] - 2026-02-23
|
|
6
41
|
### Breaking Changes
|
|
7
42
|
|
|
8
43
|
- Made `description` field required in CustomTool interface
|
|
9
44
|
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- Reorganized imports from `@oh-my-pi/pi-utils/dirs` to consolidate with main `@oh-my-pi/pi-utils` exports for cleaner dependency management
|
|
48
|
+
- Renamed `loadSkillsFromDir` to `scanSkillsFromDir` with updated interface for improved clarity on skill discovery behavior
|
|
49
|
+
- Moved `tryParseJson` utility from local scrapers module to `@oh-my-pi/pi-utils` for centralized JSON parsing
|
|
50
|
+
- Simplified patch module exports by consolidating type re-exports with `export * from './types'`
|
|
51
|
+
- Removed `emitCustomToolSessionEvent` method from AgentSession for streamlined session lifecycle management
|
|
52
|
+
- Changed skill discovery from recursive to non-recursive (one level deep only) for improved performance and clarity
|
|
53
|
+
- Simplified skill loading logic by removing recursive directory traversal and consolidating ignore rule handling
|
|
54
|
+
|
|
55
|
+
### Removed
|
|
56
|
+
|
|
57
|
+
- Removed `parseJSON` helper function from discovery module (replaced by `tryParseJson` from pi-utils)
|
|
58
|
+
- Removed backwards compatibility comment from `AskToolDetails.question` field
|
|
59
|
+
- Removed unused SSH resource cleanup functions `closeAllConnections` and `unmountAll` from session imports
|
|
60
|
+
|
|
10
61
|
## [13.1.2] - 2026-02-23
|
|
11
|
-
### Breaking Changes
|
|
12
62
|
|
|
63
|
+
### Breaking Changes
|
|
13
64
|
- Removed `timeout` parameter from await tool—tool now waits indefinitely until jobs complete or the call is aborted
|
|
14
65
|
- Renamed `job_ids` parameter to `jobs` in await tool schema
|
|
15
66
|
- Removed `timedOut` field from await tool result details
|
|
16
67
|
|
|
68
|
+
### Changed
|
|
69
|
+
- Resolved docs index generation paths using path.resolve relative to the script directory
|
|
17
70
|
## [13.1.1] - 2026-02-23
|
|
18
71
|
|
|
19
72
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.3.0",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/can1357/oh-my-pi",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@mozilla/readability": "^0.6",
|
|
44
|
-
"@oh-my-pi/omp-stats": "13.
|
|
45
|
-
"@oh-my-pi/pi-agent-core": "13.
|
|
46
|
-
"@oh-my-pi/pi-ai": "13.
|
|
47
|
-
"@oh-my-pi/pi-natives": "13.
|
|
48
|
-
"@oh-my-pi/pi-tui": "13.
|
|
49
|
-
"@oh-my-pi/pi-utils": "13.
|
|
44
|
+
"@oh-my-pi/omp-stats": "13.3.0",
|
|
45
|
+
"@oh-my-pi/pi-agent-core": "13.3.0",
|
|
46
|
+
"@oh-my-pi/pi-ai": "13.3.0",
|
|
47
|
+
"@oh-my-pi/pi-natives": "13.3.0",
|
|
48
|
+
"@oh-my-pi/pi-tui": "13.3.0",
|
|
49
|
+
"@oh-my-pi/pi-utils": "13.3.0",
|
|
50
50
|
"@sinclair/typebox": "^0.34",
|
|
51
51
|
"@xterm/headless": "^6.0",
|
|
52
52
|
"ajv": "^8.18",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* 6. Collapse 2+ blank lines to single blank line
|
|
12
12
|
* 7. Trim trailing whitespace (preserve indentation)
|
|
13
13
|
* 8. No trailing newline at EOF
|
|
14
|
+
* 9. Bold RFC 2119 keywords (MUST, SHOULD, MAY, etc.) in prompt content
|
|
14
15
|
*/
|
|
15
16
|
import { Glob } from "bun";
|
|
16
17
|
|
|
@@ -37,6 +38,23 @@ const TABLE_ROW = /^\|.*\|$/;
|
|
|
37
38
|
// Table separator (|---|---|)
|
|
38
39
|
const TABLE_SEP = /^\|[-:\s|]+\|$/;
|
|
39
40
|
|
|
41
|
+
/** RFC 2119 keywords used in prompts. */
|
|
42
|
+
const RFC2119_KEYWORDS = /\b(?:MUST NOT|SHOULD NOT|SHALL NOT|RECOMMENDED|REQUIRED|OPTIONAL|SHOULD|SHALL|MUST|MAY)\b/g;
|
|
43
|
+
|
|
44
|
+
function boldRfc2119Keywords(line: string): string {
|
|
45
|
+
return line.replace(RFC2119_KEYWORDS, (match, offset, source) => {
|
|
46
|
+
const isAlreadyBold =
|
|
47
|
+
source[offset - 2] === "*" &&
|
|
48
|
+
source[offset - 1] === "*" &&
|
|
49
|
+
source[offset + match.length] === "*" &&
|
|
50
|
+
source[offset + match.length + 1] === "*";
|
|
51
|
+
if (isAlreadyBold) {
|
|
52
|
+
return match;
|
|
53
|
+
}
|
|
54
|
+
return `**${match}**`;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
40
58
|
/** Compact a table row by trimming cell padding */
|
|
41
59
|
function compactTableRow(line: string): string {
|
|
42
60
|
// Split by |, trim each cell, rejoin
|
|
@@ -62,12 +80,6 @@ function compactTableSep(line: string): string {
|
|
|
62
80
|
}
|
|
63
81
|
|
|
64
82
|
function formatPrompt(content: string): string {
|
|
65
|
-
// Replace common ascii ellipsis and arrow patterns with their unicode equivalents
|
|
66
|
-
content = content
|
|
67
|
-
.replace(/\.{3}/g, "…")
|
|
68
|
-
.replace(/->/g, "→")
|
|
69
|
-
.replace(/<-/g, "←")
|
|
70
|
-
.replace(/<->/g, "↔");
|
|
71
83
|
const lines = content.split("\n");
|
|
72
84
|
const result: string[] = [];
|
|
73
85
|
let inCodeBlock = false;
|
|
@@ -75,9 +87,9 @@ function formatPrompt(content: string): string {
|
|
|
75
87
|
const topLevelTags: string[] = [];
|
|
76
88
|
|
|
77
89
|
for (let i = 0; i < lines.length; i++) {
|
|
78
|
-
let line = lines[i];
|
|
90
|
+
let line = lines[i].trimEnd();
|
|
79
91
|
|
|
80
|
-
const trimmed = line.
|
|
92
|
+
const trimmed = line.trimStart();
|
|
81
93
|
|
|
82
94
|
// Track code blocks - don't modify inside them
|
|
83
95
|
if (CODE_FENCE.test(trimmed)) {
|
|
@@ -91,9 +103,18 @@ function formatPrompt(content: string): string {
|
|
|
91
103
|
continue;
|
|
92
104
|
}
|
|
93
105
|
|
|
106
|
+
// Replace common ascii ellipsis and arrow patterns with their unicode equivalents
|
|
107
|
+
line = line
|
|
108
|
+
.replace(/\.{3}/g, "…")
|
|
109
|
+
.replace(/->/g, "→")
|
|
110
|
+
.replace(/<-/g, "←")
|
|
111
|
+
.replace(/<->/g, "↔")
|
|
112
|
+
.replace(/!=/g, "≠")
|
|
113
|
+
.replace(/<=/g, "≤")
|
|
114
|
+
.replace(/>=/g, "≥");
|
|
115
|
+
|
|
94
116
|
// Track top-level XML opening tags for depth-aware indent stripping
|
|
95
|
-
const isOpeningXml =
|
|
96
|
-
OPENING_XML.test(trimmed) && !trimmed.endsWith("/>");
|
|
117
|
+
const isOpeningXml = OPENING_XML.test(trimmed) && !trimmed.endsWith("/>");
|
|
97
118
|
if (isOpeningXml && line.length === trimmed.length) {
|
|
98
119
|
// Opening tag at column 0 — track as top-level
|
|
99
120
|
const match = OPENING_XML.exec(trimmed);
|
|
@@ -104,10 +125,7 @@ function formatPrompt(content: string): string {
|
|
|
104
125
|
const closingMatch = CLOSING_XML.exec(trimmed);
|
|
105
126
|
if (closingMatch) {
|
|
106
127
|
const tagName = closingMatch[1];
|
|
107
|
-
if (
|
|
108
|
-
topLevelTags.length > 0 &&
|
|
109
|
-
topLevelTags[topLevelTags.length - 1] === tagName
|
|
110
|
-
) {
|
|
128
|
+
if (topLevelTags.length > 0 && topLevelTags[topLevelTags.length - 1] === tagName) {
|
|
111
129
|
// Closing tag matches a top-level opener — strip indent
|
|
112
130
|
line = trimmed;
|
|
113
131
|
topLevelTags.pop();
|
|
@@ -126,6 +144,7 @@ function formatPrompt(content: string): string {
|
|
|
126
144
|
// Trim trailing whitespace (preserve leading for non-closing-tags)
|
|
127
145
|
line = line.trimEnd();
|
|
128
146
|
}
|
|
147
|
+
line = boldRfc2119Keywords(line);
|
|
129
148
|
|
|
130
149
|
const isBlank = trimmed === "";
|
|
131
150
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { Glob } from "bun";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
|
|
6
|
-
const docsDir =
|
|
7
|
-
const outputPath =
|
|
6
|
+
const docsDir = path.resolve(import.meta.dir, "../../../docs");
|
|
7
|
+
const outputPath = path.resolve(import.meta.dir, "../src/internal-urls/docs-index.generated.ts");
|
|
8
8
|
|
|
9
9
|
const glob = new Glob("**/*.md");
|
|
10
10
|
const entries: string[] = [];
|
package/src/capability/index.ts
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as os from "node:os";
|
|
10
10
|
import * as path from "node:path";
|
|
11
|
-
import { logger } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils/dirs";
|
|
11
|
+
import { getProjectDir, logger } from "@oh-my-pi/pi-utils";
|
|
13
12
|
|
|
14
13
|
import type { Settings } from "../config/settings";
|
|
15
14
|
import { clearCache as clearFsCache, cacheStats as fsCacheStats, invalidate as invalidateFs } from "./fs";
|
package/src/cli/args.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* CLI argument parsing and help display
|
|
3
3
|
*/
|
|
4
4
|
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
5
|
-
import { logger } from "@oh-my-pi/pi-utils";
|
|
6
|
-
import { APP_NAME, CONFIG_DIR_NAME } from "@oh-my-pi/pi-utils/dirs";
|
|
5
|
+
import { APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils";
|
|
7
6
|
import chalk from "chalk";
|
|
8
7
|
import { BUILTIN_TOOLS } from "../tools";
|
|
9
8
|
|
|
@@ -217,7 +216,8 @@ export function getExtraHelpText(): string {
|
|
|
217
216
|
${chalk.dim("# Search & Tools")}
|
|
218
217
|
EXA_API_KEY - Exa web search
|
|
219
218
|
BRAVE_API_KEY - Brave web search
|
|
220
|
-
PERPLEXITY_API_KEY - Perplexity web search
|
|
219
|
+
PERPLEXITY_API_KEY - Perplexity web search (API)
|
|
220
|
+
PERPLEXITY_COOKIES - Perplexity web search (session cookie)
|
|
221
221
|
ANTHROPIC_SEARCH_API_KEY - Anthropic search provider
|
|
222
222
|
|
|
223
223
|
${chalk.dim("# Configuration")}
|
package/src/cli/config-cli.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
7
|
-
import { isEnoent } from "@oh-my-pi/pi-utils";
|
|
8
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils/dirs";
|
|
7
|
+
import { getProjectDir, isEnoent } from "@oh-my-pi/pi-utils";
|
|
9
8
|
import chalk from "chalk";
|
|
10
9
|
import { resolveReadPath } from "../tools/path-utils";
|
|
11
10
|
import { formatBytes } from "../tools/render-utils";
|
package/src/cli/grep-cli.ts
CHANGED
package/src/cli/jupyter-cli.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles `omp jupyter` subcommand for managing the shared Python gateway.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { APP_NAME } from "@oh-my-pi/pi-utils
|
|
7
|
+
import { APP_NAME } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { getGatewayStatus, shutdownSharedGateway } from "../ipy/gateway-coordinator";
|
|
10
10
|
|
package/src/cli/plugin-cli.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles `omp plugin <command>` subcommands for plugin lifecycle management.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { APP_NAME } from "@oh-my-pi/pi-utils
|
|
7
|
+
import { APP_NAME } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { PluginManager, parseSettingValue, validateSetting } from "../extensibility/plugins";
|
|
10
10
|
import { theme } from "../modes/theme/theme";
|
package/src/cli/setup-cli.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles `omp setup <component>` to install dependencies for optional features.
|
|
5
5
|
*/
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
-
import { APP_NAME, getPythonEnvDir } from "@oh-my-pi/pi-utils
|
|
7
|
+
import { APP_NAME, getPythonEnvDir } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import { $ } from "bun";
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { theme } from "../modes/theme/theme";
|
package/src/cli/shell-cli.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
import { createInterface } from "node:readline/promises";
|
|
8
8
|
import { Shell } from "@oh-my-pi/pi-natives";
|
|
9
|
-
import { APP_NAME, getProjectDir } from "@oh-my-pi/pi-utils
|
|
9
|
+
import { APP_NAME, getProjectDir } from "@oh-my-pi/pi-utils";
|
|
10
10
|
import chalk from "chalk";
|
|
11
11
|
import { Settings } from "../config/settings";
|
|
12
12
|
import { getOrCreateSnapshot } from "../utils/shell-snapshot";
|
package/src/cli/ssh-cli.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles `omp ssh <command>` subcommands for SSH host configuration management.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getSSHConfigPath } from "@oh-my-pi/pi-utils
|
|
7
|
+
import { getSSHConfigPath } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { addSSHHost, readSSHConfigFile, removeSSHHost, type SSHHostConfig } from "../ssh/config-writer";
|
|
10
10
|
|
package/src/cli/stats-cli.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* Handles `omp stats` subcommand for viewing AI usage statistics.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { formatDuration, formatNumber, formatPercent } from "@oh-my-pi/pi-utils";
|
|
8
|
-
import { APP_NAME } from "@oh-my-pi/pi-utils/dirs";
|
|
7
|
+
import { APP_NAME, formatDuration, formatNumber, formatPercent } from "@oh-my-pi/pi-utils";
|
|
9
8
|
import chalk from "chalk";
|
|
10
9
|
import { openPath } from "../utils/open";
|
|
11
10
|
|
package/src/cli/update-cli.ts
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
import { execSync, spawnSync } from "node:child_process";
|
|
8
8
|
import * as fs from "node:fs";
|
|
9
9
|
import { pipeline } from "node:stream/promises";
|
|
10
|
-
import { isEnoent } from "@oh-my-pi/pi-utils";
|
|
11
|
-
import { APP_NAME, VERSION } from "@oh-my-pi/pi-utils/dirs";
|
|
10
|
+
import { APP_NAME, isEnoent, VERSION } from "@oh-my-pi/pi-utils";
|
|
12
11
|
import chalk from "chalk";
|
|
13
12
|
import { theme } from "../modes/theme/theme";
|
|
14
13
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles `omp q`/`omp web-search` subcommands for testing web search providers.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { APP_NAME } from "@oh-my-pi/pi-utils
|
|
7
|
+
import { APP_NAME } from "@oh-my-pi/pi-utils";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { initTheme, theme } from "../modes/theme/theme";
|
|
10
10
|
import { runSearchQuery, type SearchParams } from "../web/search/index";
|
package/src/cli.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
import { APP_NAME, VERSION } from "@oh-my-pi/pi-utils";
|
|
2
3
|
/**
|
|
3
4
|
* CLI entry point — registers all commands explicitly and delegates to the
|
|
4
5
|
* lightweight CLI runner from pi-utils.
|
|
5
6
|
*/
|
|
6
7
|
import { type CommandEntry, run } from "@oh-my-pi/pi-utils/cli";
|
|
7
|
-
import { APP_NAME, VERSION } from "@oh-my-pi/pi-utils/dirs";
|
|
8
8
|
|
|
9
9
|
// Detect known Bun errata that cause TUI crashes (e.g. Bun.stringWidth mishandling OSC sequences).
|
|
10
10
|
if (Bun.stringWidth("\x1b[0m\x1b]8;;\x07") !== 0) {
|
package/src/commands/launch.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Root command for the coding agent CLI.
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
import { APP_NAME } from "@oh-my-pi/pi-utils";
|
|
4
6
|
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
5
|
-
import { APP_NAME } from "@oh-my-pi/pi-utils/dirs";
|
|
6
7
|
import { parseArgs } from "../cli/args";
|
|
7
8
|
import { runRootCommand } from "../main";
|
|
8
9
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { INTENT_FIELD } from "@oh-my-pi/pi-agent-core";
|
|
1
2
|
import type { Api, Model } from "@oh-my-pi/pi-ai";
|
|
2
3
|
import { Markdown } from "@oh-my-pi/pi-tui";
|
|
3
4
|
import chalk from "chalk";
|
|
@@ -245,7 +246,7 @@ function formatToolArgs(args?: Record<string, unknown>): string[] {
|
|
|
245
246
|
}
|
|
246
247
|
};
|
|
247
248
|
for (const [key, value] of Object.entries(args)) {
|
|
248
|
-
if (key ===
|
|
249
|
+
if (key === INTENT_FIELD) continue;
|
|
249
250
|
visit(value, key);
|
|
250
251
|
}
|
|
251
252
|
return lines;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
import { createInterface } from "node:readline/promises";
|
|
3
|
-
import { $env, isEnoent } from "@oh-my-pi/pi-utils";
|
|
4
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils/dirs";
|
|
3
|
+
import { $env, getProjectDir, isEnoent } from "@oh-my-pi/pi-utils";
|
|
5
4
|
import { applyChangelogProposals } from "../../commit/changelog";
|
|
6
5
|
import { detectChangelogBoundaries } from "../../commit/changelog/detect";
|
|
7
6
|
import { parseUnreleasedSection } from "../../commit/changelog/parse";
|
|
@@ -13,11 +13,11 @@ Workflow rules:
|
|
|
13
13
|
6. Do not use read.
|
|
14
14
|
|
|
15
15
|
Commit requirements:
|
|
16
|
-
- Summary line: past-tense verb,
|
|
16
|
+
- Summary line: past-tense verb, ≤ 72 chars, no trailing period.
|
|
17
17
|
- Avoid filler words: comprehensive, various, several, improved, enhanced, better.
|
|
18
18
|
- Avoid meta phrases: "this commit", "this change", "updated code", "modified files".
|
|
19
19
|
- Scope: lowercase, max two segments; only letters, digits, hyphens, underscores.
|
|
20
|
-
- Detail lines optional (0-6). Each sentence ending in period,
|
|
20
|
+
- Detail lines optional (0-6). Each sentence ending in period, ≤ 120 chars.
|
|
21
21
|
|
|
22
22
|
Conventional commit types:
|
|
23
23
|
{{types_description}}
|
|
@@ -34,5 +34,5 @@ Tool guidance:
|
|
|
34
34
|
|
|
35
35
|
## Changelog Requirements
|
|
36
36
|
|
|
37
|
-
If changelog targets provided, you MUST call `propose_changelog` before finishing.
|
|
37
|
+
If changelog targets provided, you **MUST** call `propose_changelog` before finishing.
|
|
38
38
|
If you propose split commit plan, include changelog target files in relevant commit changes.
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
1
|
+
import { type TSchema, Type } from "@sinclair/typebox";
|
|
2
2
|
import type { CommitAgentState } from "../../../commit/agentic/state";
|
|
3
|
-
import type
|
|
3
|
+
import { CHANGELOG_CATEGORIES, type ChangelogCategory } from "../../../commit/types";
|
|
4
4
|
import type { CustomTool } from "../../../extensibility/custom-tools/types";
|
|
5
5
|
|
|
6
|
+
const changelogEntryProperties = CHANGELOG_CATEGORIES.reduce<Record<ChangelogCategory, TSchema>>(
|
|
7
|
+
(acc, category) => {
|
|
8
|
+
acc[category] = Type.Optional(Type.Array(Type.String()));
|
|
9
|
+
return acc;
|
|
10
|
+
},
|
|
11
|
+
{} as Record<ChangelogCategory, TSchema>,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const changelogEntriesSchema = Type.Object(changelogEntryProperties);
|
|
15
|
+
const changelogDeletionsSchema = Type.Object(changelogEntryProperties, {
|
|
16
|
+
description: "Entries to remove from existing changelog sections (case-insensitive match)",
|
|
17
|
+
});
|
|
18
|
+
|
|
6
19
|
const changelogEntrySchema = Type.Object({
|
|
7
20
|
path: Type.String(),
|
|
8
|
-
entries:
|
|
9
|
-
deletions: Type.Optional(
|
|
10
|
-
Type.Record(Type.String(), Type.Array(Type.String()), {
|
|
11
|
-
description: "Entries to remove from existing changelog sections (case-insensitive match)",
|
|
12
|
-
}),
|
|
13
|
-
),
|
|
21
|
+
entries: changelogEntriesSchema,
|
|
22
|
+
deletions: Type.Optional(changelogDeletionsSchema),
|
|
14
23
|
});
|
|
15
24
|
|
|
16
25
|
const proposeChangelogSchema = Type.Object({
|
|
@@ -23,15 +32,7 @@ interface ChangelogResponse {
|
|
|
23
32
|
warnings: string[];
|
|
24
33
|
}
|
|
25
34
|
|
|
26
|
-
const allowedCategories = new Set<ChangelogCategory>(
|
|
27
|
-
"Breaking Changes",
|
|
28
|
-
"Added",
|
|
29
|
-
"Changed",
|
|
30
|
-
"Deprecated",
|
|
31
|
-
"Removed",
|
|
32
|
-
"Fixed",
|
|
33
|
-
"Security",
|
|
34
|
-
]);
|
|
35
|
+
const allowedCategories = new Set<ChangelogCategory>(CHANGELOG_CATEGORIES);
|
|
35
36
|
|
|
36
37
|
export function createProposeChangelogTool(
|
|
37
38
|
state: CommitAgentState,
|
|
@@ -50,11 +51,16 @@ export function createProposeChangelogTool(
|
|
|
50
51
|
|
|
51
52
|
const normalized = params.entries.map(entry => {
|
|
52
53
|
const cleaned: Record<string, string[]> = {};
|
|
53
|
-
|
|
54
|
+
const entries = entry.entries as Record<string, string[]>;
|
|
55
|
+
for (const [category, values] of Object.entries(entries)) {
|
|
54
56
|
if (!allowedCategories.has(category as ChangelogCategory)) {
|
|
55
57
|
errors.push(`Unknown changelog category for ${entry.path}: ${category}`);
|
|
56
58
|
continue;
|
|
57
59
|
}
|
|
60
|
+
if (!Array.isArray(values)) {
|
|
61
|
+
errors.push(`Invalid changelog entries for ${entry.path}: ${category}`);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
58
64
|
const items = values.map(value => value.trim().replace(/\.$/, "")).filter(value => value.length > 0);
|
|
59
65
|
if (items.length > 0) {
|
|
60
66
|
cleaned[category] = Array.from(new Set(items));
|
|
@@ -64,11 +70,16 @@ export function createProposeChangelogTool(
|
|
|
64
70
|
let cleanedDeletions: Record<string, string[]> | undefined;
|
|
65
71
|
if (entry.deletions) {
|
|
66
72
|
cleanedDeletions = {};
|
|
67
|
-
|
|
73
|
+
const deletions = entry.deletions as Record<string, string[]>;
|
|
74
|
+
for (const [category, values] of Object.entries(deletions)) {
|
|
68
75
|
if (!allowedCategories.has(category as ChangelogCategory)) {
|
|
69
76
|
errors.push(`Unknown deletion category for ${entry.path}: ${category}`);
|
|
70
77
|
continue;
|
|
71
78
|
}
|
|
79
|
+
if (!Array.isArray(values)) {
|
|
80
|
+
errors.push(`Invalid deletion entries for ${entry.path}: ${category}`);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
72
83
|
const items = values.map(value => value.trim()).filter(value => value.length > 0);
|
|
73
84
|
if (items.length > 0) {
|
|
74
85
|
cleanedDeletions[category] = Array.from(new Set(items));
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import type { Api, AssistantMessage, Model } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { completeSimple, validateToolCall } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { type TSchema, Type } from "@sinclair/typebox";
|
|
4
4
|
import changelogSystemPrompt from "../../commit/prompts/changelog-system.md" with { type: "text" };
|
|
5
5
|
import changelogUserPrompt from "../../commit/prompts/changelog-user.md" with { type: "text" };
|
|
6
|
-
import type
|
|
6
|
+
import { CHANGELOG_CATEGORIES, type ChangelogCategory, type ChangelogGenerationResult } from "../../commit/types";
|
|
7
7
|
import { renderPromptTemplate } from "../../config/prompt-templates";
|
|
8
8
|
import { extractTextContent, extractToolCall, parseJsonPayload } from "../utils";
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const changelogEntryProperties = CHANGELOG_CATEGORIES.reduce<Record<ChangelogCategory, TSchema>>(
|
|
11
|
+
(acc, category) => {
|
|
12
|
+
acc[category] = Type.Optional(Type.Array(Type.String()));
|
|
13
|
+
return acc;
|
|
14
|
+
},
|
|
15
|
+
{} as Record<ChangelogCategory, TSchema>,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const changelogEntriesSchema = Type.Object(changelogEntryProperties);
|
|
19
|
+
|
|
20
|
+
export const changelogTool = {
|
|
11
21
|
name: "create_changelog_entries",
|
|
12
22
|
description: "Generate changelog entries grouped by Keep a Changelog categories.",
|
|
13
23
|
parameters: Type.Object({
|
|
14
|
-
entries:
|
|
24
|
+
entries: changelogEntriesSchema,
|
|
15
25
|
}),
|
|
16
26
|
};
|
|
17
27
|
|
|
@@ -46,7 +56,7 @@ export async function generateChangelogEntries({
|
|
|
46
56
|
{
|
|
47
57
|
systemPrompt: renderPromptTemplate(changelogSystemPrompt),
|
|
48
58
|
messages: [{ role: "user", content: prompt, timestamp: Date.now() }],
|
|
49
|
-
tools: [
|
|
59
|
+
tools: [changelogTool],
|
|
50
60
|
},
|
|
51
61
|
{ apiKey, maxTokens: 1200 },
|
|
52
62
|
);
|
|
@@ -58,7 +68,7 @@ export async function generateChangelogEntries({
|
|
|
58
68
|
function parseChangelogResponse(message: AssistantMessage): ChangelogGenerationResult {
|
|
59
69
|
const toolCall = extractToolCall(message, "create_changelog_entries");
|
|
60
70
|
if (toolCall) {
|
|
61
|
-
const parsed = validateToolCall([
|
|
71
|
+
const parsed = validateToolCall([changelogTool], toolCall) as ChangelogGenerationResult;
|
|
62
72
|
return { entries: parsed.entries ?? {} };
|
|
63
73
|
}
|
|
64
74
|
|
|
@@ -2,11 +2,12 @@ import * as path from "node:path";
|
|
|
2
2
|
import type { Api, Model } from "@oh-my-pi/pi-ai";
|
|
3
3
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
4
4
|
import type { ControlledGit } from "../../commit/git";
|
|
5
|
+
import { CHANGELOG_CATEGORIES } from "../../commit/types";
|
|
5
6
|
import { detectChangelogBoundaries } from "./detect";
|
|
6
7
|
import { generateChangelogEntries } from "./generate";
|
|
7
8
|
import { parseUnreleasedSection } from "./parse";
|
|
8
9
|
|
|
9
|
-
const CHANGELOG_SECTIONS =
|
|
10
|
+
const CHANGELOG_SECTIONS = CHANGELOG_CATEGORIES;
|
|
10
11
|
|
|
11
12
|
const DEFAULT_MAX_DIFF_CHARS = 120_000;
|
|
12
13
|
|
package/src/commit/pipeline.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
import type { Api, Model } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import { logger } from "@oh-my-pi/pi-utils";
|
|
4
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils/dirs";
|
|
3
|
+
import { getProjectDir, logger } from "@oh-my-pi/pi-utils";
|
|
5
4
|
import { ModelRegistry } from "../config/model-registry";
|
|
6
5
|
import { renderPromptTemplate } from "../config/prompt-templates";
|
|
7
6
|
import { Settings } from "../config/settings";
|
|
@@ -10,7 +10,7 @@ Determine:
|
|
|
10
10
|
4. CHANGELOG: Metadata for user-visible changes
|
|
11
11
|
</instructions>
|
|
12
12
|
<scope-rules>
|
|
13
|
-
- Component name if
|
|
13
|
+
- Component name if ≥60% changes target it
|
|
14
14
|
- null if spread across multiple components
|
|
15
15
|
- scope_candidates as primary source
|
|
16
16
|
- Valid: specific component names (api, parser, config, etc.)
|
package/src/commit/types.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types for the omp commit pipeline.
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
export type CommitType =
|
|
6
5
|
| "feat"
|
|
7
6
|
| "fix"
|
|
@@ -24,6 +23,16 @@ export type ChangelogCategory =
|
|
|
24
23
|
| "Fixed"
|
|
25
24
|
| "Security";
|
|
26
25
|
|
|
26
|
+
export const CHANGELOG_CATEGORIES: ChangelogCategory[] = [
|
|
27
|
+
"Breaking Changes",
|
|
28
|
+
"Added",
|
|
29
|
+
"Changed",
|
|
30
|
+
"Deprecated",
|
|
31
|
+
"Removed",
|
|
32
|
+
"Fixed",
|
|
33
|
+
"Security",
|
|
34
|
+
];
|
|
35
|
+
|
|
27
36
|
export interface CommitCommandArgs {
|
|
28
37
|
/** Push after commit */
|
|
29
38
|
push: boolean;
|
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
matchesKey,
|
|
9
9
|
setEditorKeybindings,
|
|
10
10
|
} from "@oh-my-pi/pi-tui";
|
|
11
|
-
import { isEnoent, logger } from "@oh-my-pi/pi-utils";
|
|
12
|
-
import { getAgentDir } from "@oh-my-pi/pi-utils/dirs";
|
|
11
|
+
import { getAgentDir, isEnoent, logger } from "@oh-my-pi/pi-utils";
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Application-level actions (coding agent specific).
|
|
@@ -47,7 +47,7 @@ export const MODEL_ROLES: Record<ModelRole, ModelRoleInfo> = {
|
|
|
47
47
|
smol: { tag: "SMOL", name: "Fast", color: "warning" },
|
|
48
48
|
slow: { tag: "SLOW", name: "Thinking", color: "accent" },
|
|
49
49
|
plan: { tag: "PLAN", name: "Architect", color: "muted" },
|
|
50
|
-
commit: { name: "Commit" },
|
|
50
|
+
commit: { tag: "COMMIT", name: "Commit", color: "dim" },
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const MODEL_ROLE_IDS: ModelRole[] = ["default", "smol", "slow", "plan", "commit"];
|