@oh-my-pi/pi-coding-agent 3.36.0 → 3.37.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 +5 -0
- package/package.json +5 -5
- package/src/core/tools/bash.ts +20 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [3.37.0] - 2026-01-10
|
|
6
|
+
### Changed
|
|
7
|
+
|
|
8
|
+
- Improved bash command display to show relative paths for working directories within the current directory, and hide redundant `cd` prefix when working directory matches current directory
|
|
9
|
+
|
|
5
10
|
## [3.36.0] - 2026-01-10
|
|
6
11
|
### Added
|
|
7
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"ompConfig": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"prepublishOnly": "bun run generate-template && bun run clean && bun run build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@oh-my-pi/pi-ai": "3.
|
|
43
|
-
"@oh-my-pi/pi-agent-core": "3.
|
|
44
|
-
"@oh-my-pi/pi-git-tool": "3.
|
|
45
|
-
"@oh-my-pi/pi-tui": "3.
|
|
42
|
+
"@oh-my-pi/pi-ai": "3.37.0",
|
|
43
|
+
"@oh-my-pi/pi-agent-core": "3.37.0",
|
|
44
|
+
"@oh-my-pi/pi-git-tool": "3.37.0",
|
|
45
|
+
"@oh-my-pi/pi-tui": "3.37.0",
|
|
46
46
|
"@openai/agents": "^0.3.7",
|
|
47
47
|
"@sinclair/typebox": "^0.34.46",
|
|
48
48
|
"ajv": "^8.17.1",
|
package/src/core/tools/bash.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { relative, resolve, sep } from "node:path";
|
|
1
2
|
import type { AgentTool, AgentToolContext } from "@oh-my-pi/pi-agent-core";
|
|
2
3
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
3
4
|
import { Text } from "@oh-my-pi/pi-tui";
|
|
@@ -137,8 +138,25 @@ export const bashToolRenderer = {
|
|
|
137
138
|
const ui = createToolUIKit(uiTheme);
|
|
138
139
|
const command = args.command || uiTheme.format.ellipsis;
|
|
139
140
|
const prompt = uiTheme.fg("accent", "$");
|
|
140
|
-
const
|
|
141
|
-
|
|
141
|
+
const cwd = process.cwd();
|
|
142
|
+
let displayWorkdir = args.workdir;
|
|
143
|
+
|
|
144
|
+
if (displayWorkdir) {
|
|
145
|
+
const resolvedCwd = resolve(cwd);
|
|
146
|
+
const resolvedWorkdir = resolve(displayWorkdir);
|
|
147
|
+
if (resolvedWorkdir === resolvedCwd) {
|
|
148
|
+
displayWorkdir = undefined;
|
|
149
|
+
} else {
|
|
150
|
+
const relativePath = relative(resolvedCwd, resolvedWorkdir);
|
|
151
|
+
const isWithinCwd = relativePath && !relativePath.startsWith("..") && !relativePath.startsWith(`..${sep}`);
|
|
152
|
+
if (isWithinCwd) {
|
|
153
|
+
displayWorkdir = relativePath;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const cmdText = displayWorkdir
|
|
159
|
+
? `${prompt} ${uiTheme.fg("dim", `cd ${displayWorkdir} &&`)} ${command}`
|
|
142
160
|
: `${prompt} ${command}`;
|
|
143
161
|
const text = ui.title(cmdText);
|
|
144
162
|
return new Text(text, 0, 0);
|