@oh-my-pi/pi-coding-agent 13.13.0 → 13.13.2
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 +13 -1
- package/README.md +3 -1
- package/package.json +7 -7
- package/src/capability/mcp.ts +2 -0
- package/src/config/keybindings.ts +0 -4
- package/src/config/mcp-schema.json +230 -0
- package/src/config/settings-schema.ts +10 -0
- package/src/discovery/builtin.ts +1 -0
- package/src/discovery/mcp-json.ts +3 -0
- package/src/extensibility/custom-tools/types.ts +4 -0
- package/src/extensibility/extensions/types.ts +4 -0
- package/src/internal-urls/docs-index.generated.ts +2 -1
- package/src/mcp/client.ts +46 -16
- package/src/mcp/config-writer.ts +9 -2
- package/src/mcp/config.ts +1 -0
- package/src/mcp/discoverable-tool-metadata.ts +10 -0
- package/src/mcp/manager.ts +28 -0
- package/src/mcp/transports/http.ts +148 -28
- package/src/mcp/transports/stdio.ts +62 -12
- package/src/mcp/types.ts +22 -1
- package/src/modes/components/custom-editor.ts +126 -71
- package/src/modes/controllers/command-controller.ts +3 -12
- package/src/modes/controllers/extension-ui-controller.ts +3 -1
- package/src/modes/controllers/input-controller.ts +36 -37
- package/src/modes/controllers/selector-controller.ts +11 -0
- package/src/modes/interactive-mode.ts +5 -12
- package/src/modes/utils/hotkeys-markdown.ts +24 -22
- package/src/patch/index.ts +21 -0
- package/src/sdk.ts +19 -2
- package/src/session/agent-session.ts +37 -5
- package/src/session/compaction/compaction.ts +1 -1
- package/src/system-prompt.ts +26 -14
- package/src/tools/write.ts +26 -2
- package/src/utils/title-generator.ts +46 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [13.13.2] - 2026-03-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added automatic stripping of hashline display prefixes (LINE#ID:) from write tool content when hashline edit mode is enabled, preventing the model from accidentally copying display markers into files
|
|
10
|
+
- Added `mcpServerName` and `mcpToolName` optional properties to custom tools for MCP server discovery and search metadata
|
|
11
|
+
|
|
12
|
+
## [13.13.1] - 2026-03-18
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Automatic deduplication of identical context files by content, keeping the closest (lowest depth) copy when duplicates are discovered
|
|
16
|
+
|
|
5
17
|
## [13.13.0] - 2026-03-18
|
|
6
18
|
|
|
7
19
|
### Added
|
|
@@ -2214,7 +2226,7 @@
|
|
|
2214
2226
|
- New `appendModeChange()` method in SessionManager to record mode transitions
|
|
2215
2227
|
- New `mode` and `modeData` fields in SessionContext to track active agent mode
|
|
2216
2228
|
- Support for `PI_PACKAGE_DIR` environment variable to override package directory (useful for Nix/Guix store paths)
|
|
2217
|
-
- New keybindings for session management: `
|
|
2229
|
+
- New keybindings for session management: `newSession`, `tree`, `fork`, and `resume` actions
|
|
2218
2230
|
- Support for shell command execution in configuration values (API keys, headers) using `!` prefix, with result caching
|
|
2219
2231
|
- New `clearOnShrink` display setting to control whether empty rows are cleared when content shrinks
|
|
2220
2232
|
- New `SlashCommandInfo`, `SlashCommandLocation`, and `SlashCommandSource` types for extension slash command discovery
|
package/README.md
CHANGED
|
@@ -8,5 +8,7 @@ For installation, setup, provider configuration, model roles, slash commands, an
|
|
|
8
8
|
|
|
9
9
|
Package-specific references:
|
|
10
10
|
- [CHANGELOG](./CHANGELOG.md)
|
|
11
|
-
- [
|
|
11
|
+
- [MCP configuration guide](../../docs/mcp-config.md)
|
|
12
|
+
- [MCP runtime lifecycle](../../docs/mcp-runtime-lifecycle.md)
|
|
13
|
+
- [MCP server/tool authoring](../../docs/mcp-server-tool-authoring.md)
|
|
12
14
|
- [DEVELOPMENT](./DEVELOPMENT.md)
|
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.13.
|
|
4
|
+
"version": "13.13.2",
|
|
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.13.
|
|
45
|
-
"@oh-my-pi/pi-agent-core": "13.13.
|
|
46
|
-
"@oh-my-pi/pi-ai": "13.13.
|
|
47
|
-
"@oh-my-pi/pi-natives": "13.13.
|
|
48
|
-
"@oh-my-pi/pi-tui": "13.13.
|
|
49
|
-
"@oh-my-pi/pi-utils": "13.13.
|
|
44
|
+
"@oh-my-pi/omp-stats": "13.13.2",
|
|
45
|
+
"@oh-my-pi/pi-agent-core": "13.13.2",
|
|
46
|
+
"@oh-my-pi/pi-ai": "13.13.2",
|
|
47
|
+
"@oh-my-pi/pi-natives": "13.13.2",
|
|
48
|
+
"@oh-my-pi/pi-tui": "13.13.2",
|
|
49
|
+
"@oh-my-pi/pi-utils": "13.13.2",
|
|
50
50
|
"@sinclair/typebox": "^0.34",
|
|
51
51
|
"@xterm/headless": "^6.0",
|
|
52
52
|
"ajv": "^8.18",
|
package/src/capability/mcp.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface MCPServer {
|
|
|
23
23
|
args?: string[];
|
|
24
24
|
/** Environment variables */
|
|
25
25
|
env?: Record<string, string>;
|
|
26
|
+
/** Working directory for stdio transport */
|
|
27
|
+
cwd?: string;
|
|
26
28
|
/** URL (for HTTP/SSE transport) */
|
|
27
29
|
url?: string;
|
|
28
30
|
/** HTTP headers (for HTTP transport) */
|
|
@@ -25,7 +25,6 @@ export type AppAction =
|
|
|
25
25
|
| "togglePlanMode"
|
|
26
26
|
| "expandTools"
|
|
27
27
|
| "toggleThinking"
|
|
28
|
-
| "toggleSessionNamedFilter"
|
|
29
28
|
| "externalEditor"
|
|
30
29
|
| "historySearch"
|
|
31
30
|
| "followUp"
|
|
@@ -67,7 +66,6 @@ export const DEFAULT_APP_KEYBINDINGS: Record<AppAction, KeyId | KeyId[]> = {
|
|
|
67
66
|
historySearch: "ctrl+r",
|
|
68
67
|
expandTools: "ctrl+o",
|
|
69
68
|
toggleThinking: "ctrl+t",
|
|
70
|
-
toggleSessionNamedFilter: "ctrl+n",
|
|
71
69
|
externalEditor: "ctrl+g",
|
|
72
70
|
followUp: "ctrl+enter",
|
|
73
71
|
dequeue: "alt+up",
|
|
@@ -80,7 +78,6 @@ export const DEFAULT_APP_KEYBINDINGS: Record<AppAction, KeyId | KeyId[]> = {
|
|
|
80
78
|
resume: [],
|
|
81
79
|
toggleSTT: "alt+h",
|
|
82
80
|
};
|
|
83
|
-
|
|
84
81
|
/**
|
|
85
82
|
* All default keybindings (app + editor).
|
|
86
83
|
*/
|
|
@@ -103,7 +100,6 @@ const APP_ACTIONS: AppAction[] = [
|
|
|
103
100
|
"historySearch",
|
|
104
101
|
"expandTools",
|
|
105
102
|
"toggleThinking",
|
|
106
|
-
"toggleSessionNamedFilter",
|
|
107
103
|
"externalEditor",
|
|
108
104
|
"followUp",
|
|
109
105
|
"dequeue",
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/src/config/mcp-schema.json",
|
|
4
|
+
"title": "OMP MCP configuration",
|
|
5
|
+
"description": "Schema for mcp.json, .mcp.json, .omp/mcp.json, and ~/.omp/mcp.json used by the OMP coding agent.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Optional schema reference for editor autocomplete and validation."
|
|
12
|
+
},
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"description": "Map of MCP server name to server configuration.",
|
|
16
|
+
"propertyNames": {
|
|
17
|
+
"pattern": "^[a-zA-Z0-9_.-]{1,100}$"
|
|
18
|
+
},
|
|
19
|
+
"additionalProperties": {
|
|
20
|
+
"$ref": "#/$defs/serverConfig"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"disabledServers": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "User-level denylist for disabling discovered servers by name.",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1
|
|
29
|
+
},
|
|
30
|
+
"uniqueItems": true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"$defs": {
|
|
34
|
+
"stringMap": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"authConfig": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["type"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"type": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": ["oauth", "apikey"],
|
|
48
|
+
"description": "Auth strategy understood by OMP."
|
|
49
|
+
},
|
|
50
|
+
"credentialId": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Stored OAuth credential id from agent auth storage."
|
|
53
|
+
},
|
|
54
|
+
"tokenUrl": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Token endpoint persisted for refresh."
|
|
57
|
+
},
|
|
58
|
+
"clientId": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "OAuth client id persisted for refresh."
|
|
61
|
+
},
|
|
62
|
+
"clientSecret": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "OAuth client secret persisted for refresh."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"oauthConfig": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"properties": {
|
|
72
|
+
"clientId": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"clientSecret": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"redirectUri": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"callbackPort": {
|
|
82
|
+
"type": "integer",
|
|
83
|
+
"minimum": 1,
|
|
84
|
+
"maximum": 65535
|
|
85
|
+
},
|
|
86
|
+
"callbackPath": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"description": "Explicit OAuth client settings for servers that need them during /mcp reauth or initial connect."
|
|
91
|
+
},
|
|
92
|
+
"serverBase": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"enabled": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "Whether OMP should try to connect this server."
|
|
98
|
+
},
|
|
99
|
+
"timeout": {
|
|
100
|
+
"type": "number",
|
|
101
|
+
"exclusiveMinimum": 0,
|
|
102
|
+
"description": "Connection timeout in milliseconds."
|
|
103
|
+
},
|
|
104
|
+
"auth": {
|
|
105
|
+
"$ref": "#/$defs/authConfig"
|
|
106
|
+
},
|
|
107
|
+
"oauth": {
|
|
108
|
+
"$ref": "#/$defs/oauthConfig"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"stdioServer": {
|
|
113
|
+
"allOf": [
|
|
114
|
+
{
|
|
115
|
+
"$ref": "#/$defs/serverBase"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": ["command"],
|
|
121
|
+
"properties": {
|
|
122
|
+
"type": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": ["stdio"],
|
|
125
|
+
"description": "Default transport when omitted."
|
|
126
|
+
},
|
|
127
|
+
"command": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"minLength": 1,
|
|
130
|
+
"description": "Executable to spawn."
|
|
131
|
+
},
|
|
132
|
+
"args": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
"description": "Arguments passed to the stdio server process."
|
|
138
|
+
},
|
|
139
|
+
"env": {
|
|
140
|
+
"$ref": "#/$defs/stringMap",
|
|
141
|
+
"description": "Environment variables passed to the stdio process."
|
|
142
|
+
},
|
|
143
|
+
"cwd": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "Working directory used when spawning the stdio process."
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"not": {
|
|
149
|
+
"required": ["url"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"httpServer": {
|
|
155
|
+
"allOf": [
|
|
156
|
+
{
|
|
157
|
+
"$ref": "#/$defs/serverBase"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"required": ["type", "url"],
|
|
163
|
+
"properties": {
|
|
164
|
+
"type": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"enum": ["http"],
|
|
167
|
+
"description": "Streamable HTTP transport."
|
|
168
|
+
},
|
|
169
|
+
"url": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"minLength": 1,
|
|
172
|
+
"description": "MCP endpoint URL."
|
|
173
|
+
},
|
|
174
|
+
"headers": {
|
|
175
|
+
"$ref": "#/$defs/stringMap",
|
|
176
|
+
"description": "HTTP headers sent with MCP requests."
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"not": {
|
|
180
|
+
"required": ["command"]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"sseServer": {
|
|
186
|
+
"allOf": [
|
|
187
|
+
{
|
|
188
|
+
"$ref": "#/$defs/serverBase"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"required": ["type", "url"],
|
|
194
|
+
"properties": {
|
|
195
|
+
"type": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"enum": ["sse"],
|
|
198
|
+
"description": "Legacy SSE transport kept for compatibility. Prefer http for new configs."
|
|
199
|
+
},
|
|
200
|
+
"url": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1,
|
|
203
|
+
"description": "Legacy SSE endpoint URL."
|
|
204
|
+
},
|
|
205
|
+
"headers": {
|
|
206
|
+
"$ref": "#/$defs/stringMap",
|
|
207
|
+
"description": "HTTP headers sent with the SSE transport."
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"not": {
|
|
211
|
+
"required": ["command"]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"serverConfig": {
|
|
217
|
+
"oneOf": [
|
|
218
|
+
{
|
|
219
|
+
"$ref": "#/$defs/stdioServer"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"$ref": "#/$defs/httpServer"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"$ref": "#/$defs/sseServer"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -1217,6 +1217,16 @@ export const SETTINGS_SCHEMA = {
|
|
|
1217
1217
|
},
|
|
1218
1218
|
},
|
|
1219
1219
|
|
|
1220
|
+
"mcp.discoveryDefaultServers": {
|
|
1221
|
+
type: "array",
|
|
1222
|
+
default: [] as string[],
|
|
1223
|
+
ui: {
|
|
1224
|
+
tab: "tools",
|
|
1225
|
+
label: "MCP Discovery Default Servers",
|
|
1226
|
+
description: "Keep MCP tools from these servers visible while discovery mode hides other MCP tools",
|
|
1227
|
+
},
|
|
1228
|
+
},
|
|
1229
|
+
|
|
1220
1230
|
"mcp.notifications": {
|
|
1221
1231
|
type: "boolean",
|
|
1222
1232
|
default: false,
|
package/src/discovery/builtin.ts
CHANGED
|
@@ -158,6 +158,7 @@ async function loadMCPServers(ctx: LoadContext): Promise<LoadResult<MCPServer>>
|
|
|
158
158
|
command: serverConfig.command as string | undefined,
|
|
159
159
|
args: serverConfig.args as string[] | undefined,
|
|
160
160
|
env: serverConfig.env as Record<string, string> | undefined,
|
|
161
|
+
cwd: serverConfig.cwd as string | undefined,
|
|
161
162
|
url: serverConfig.url as string | undefined,
|
|
162
163
|
headers: serverConfig.headers as Record<string, string> | undefined,
|
|
163
164
|
auth: serverConfig.auth as
|
|
@@ -29,6 +29,7 @@ interface MCPConfigFile {
|
|
|
29
29
|
command?: string;
|
|
30
30
|
args?: string[];
|
|
31
31
|
env?: Record<string, string>;
|
|
32
|
+
cwd?: string;
|
|
32
33
|
url?: string;
|
|
33
34
|
headers?: Record<string, string>;
|
|
34
35
|
auth?: {
|
|
@@ -88,6 +89,7 @@ function transformMCPConfig(config: MCPConfigFile, source: SourceMeta): MCPServe
|
|
|
88
89
|
command: serverConfig.command,
|
|
89
90
|
args: serverConfig.args,
|
|
90
91
|
env: serverConfig.env,
|
|
92
|
+
cwd: serverConfig.cwd,
|
|
91
93
|
url: serverConfig.url,
|
|
92
94
|
headers: serverConfig.headers,
|
|
93
95
|
auth: serverConfig.auth,
|
|
@@ -100,6 +102,7 @@ function transformMCPConfig(config: MCPConfigFile, source: SourceMeta): MCPServe
|
|
|
100
102
|
if (server.command) server.command = expandEnvVarsDeep(server.command);
|
|
101
103
|
if (server.args) server.args = expandEnvVarsDeep(server.args);
|
|
102
104
|
if (server.env) server.env = expandEnvVarsDeep(server.env);
|
|
105
|
+
if (server.cwd) server.cwd = expandEnvVarsDeep(server.cwd);
|
|
103
106
|
if (server.url) server.url = expandEnvVarsDeep(server.url);
|
|
104
107
|
if (server.headers) server.headers = expandEnvVarsDeep(server.headers);
|
|
105
108
|
if (server.auth) server.auth = expandEnvVarsDeep(server.auth);
|
|
@@ -184,6 +184,10 @@ export interface CustomTool<TParams extends TSchema = TSchema, TDetails = any> {
|
|
|
184
184
|
hidden?: boolean;
|
|
185
185
|
/** If true, tool may stage deferred changes that require explicit resolve/discard. */
|
|
186
186
|
deferrable?: boolean;
|
|
187
|
+
/** MCP server name for discovery/search metadata when this tool fronts an MCP server. */
|
|
188
|
+
mcpServerName?: string;
|
|
189
|
+
/** Original MCP tool name for discovery/search metadata. */
|
|
190
|
+
mcpToolName?: string;
|
|
187
191
|
/**
|
|
188
192
|
* Execute the tool.
|
|
189
193
|
* @param toolCallId - Unique ID for this tool call
|
|
@@ -300,6 +300,10 @@ export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = un
|
|
|
300
300
|
hidden?: boolean;
|
|
301
301
|
/** If true, tool may stage deferred changes that require explicit resolve/discard. */
|
|
302
302
|
deferrable?: boolean;
|
|
303
|
+
/** MCP server name for discovery/search metadata when this tool fronts an MCP server. */
|
|
304
|
+
mcpServerName?: string;
|
|
305
|
+
/** Original MCP tool name for discovery/search metadata. */
|
|
306
|
+
mcpToolName?: string;
|
|
303
307
|
/** Execute the tool. */
|
|
304
308
|
execute(
|
|
305
309
|
toolCallId: string,
|