@oh-my-pi/pi-coding-agent 13.1.0 → 13.1.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
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [13.1.2] - 2026-02-23
|
|
6
|
+
### Breaking Changes
|
|
7
|
+
|
|
8
|
+
- Removed `timeout` parameter from await tool—tool now waits indefinitely until jobs complete or the call is aborted
|
|
9
|
+
- Renamed `job_ids` parameter to `jobs` in await tool schema
|
|
10
|
+
- Removed `timedOut` field from await tool result details
|
|
11
|
+
|
|
12
|
+
## [13.1.1] - 2026-02-23
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Fixed bash internal URL expansion to resolve `local://` targets to concrete filesystem paths, including newly created destination files for commands like `mv src.json local://dest.json`
|
|
17
|
+
- Fixed bash local URL resolution to create missing parent directories under the session local root before command execution, preventing `mv` destination failures for new paths
|
|
5
18
|
## [13.1.0] - 2026-02-23
|
|
6
19
|
### Breaking Changes
|
|
7
20
|
|
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.1.
|
|
4
|
+
"version": "13.1.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.1.
|
|
45
|
-
"@oh-my-pi/pi-agent-core": "13.1.
|
|
46
|
-
"@oh-my-pi/pi-ai": "13.1.
|
|
47
|
-
"@oh-my-pi/pi-natives": "13.1.
|
|
48
|
-
"@oh-my-pi/pi-tui": "13.1.
|
|
49
|
-
"@oh-my-pi/pi-utils": "13.1.
|
|
44
|
+
"@oh-my-pi/omp-stats": "13.1.2",
|
|
45
|
+
"@oh-my-pi/pi-agent-core": "13.1.2",
|
|
46
|
+
"@oh-my-pi/pi-ai": "13.1.2",
|
|
47
|
+
"@oh-my-pi/pi-natives": "13.1.2",
|
|
48
|
+
"@oh-my-pi/pi-tui": "13.1.2",
|
|
49
|
+
"@oh-my-pi/pi-utils": "13.1.2",
|
|
50
50
|
"@sinclair/typebox": "^0.34",
|
|
51
51
|
"@xterm/headless": "^6.0",
|
|
52
52
|
"ajv": "^8.18",
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
</file>
|
|
17
17
|
{{/list}}
|
|
18
18
|
</instructions>
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if git.isRepo}}
|
|
21
|
+
## Version Control
|
|
22
|
+
Snapshot; does not update during conversation.
|
|
23
|
+
Current branch: {{git.currentBranch}}
|
|
24
|
+
Main branch: {{git.mainBranch}}
|
|
25
|
+
{{git.status}}
|
|
26
|
+
### History
|
|
27
|
+
{{git.commits}}
|
|
28
|
+
{{/if}}
|
|
19
29
|
</project>
|
|
20
30
|
{{/ifAny}}
|
|
21
31
|
{{#if skills.length}}
|
package/src/tools/await-tool.ts
CHANGED
|
@@ -5,16 +5,11 @@ import awaitDescription from "../prompts/tools/await.md" with { type: "text" };
|
|
|
5
5
|
import type { ToolSession } from "./index";
|
|
6
6
|
|
|
7
7
|
const awaitSchema = Type.Object({
|
|
8
|
-
|
|
8
|
+
jobs: Type.Optional(
|
|
9
9
|
Type.Array(Type.String(), {
|
|
10
10
|
description: "Specific job IDs to wait for. If omitted, waits for any running job.",
|
|
11
11
|
}),
|
|
12
12
|
),
|
|
13
|
-
timeout: Type.Optional(
|
|
14
|
-
Type.Number({
|
|
15
|
-
description: "Maximum seconds to wait before returning (default: 300)",
|
|
16
|
-
}),
|
|
17
|
-
),
|
|
18
13
|
});
|
|
19
14
|
|
|
20
15
|
type AwaitParams = Static<typeof awaitSchema>;
|
|
@@ -31,7 +26,6 @@ interface AwaitResult {
|
|
|
31
26
|
|
|
32
27
|
export interface AwaitToolDetails {
|
|
33
28
|
jobs: AwaitResult[];
|
|
34
|
-
timedOut: boolean;
|
|
35
29
|
}
|
|
36
30
|
|
|
37
31
|
export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails> {
|
|
@@ -61,12 +55,11 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
61
55
|
if (!manager) {
|
|
62
56
|
return {
|
|
63
57
|
content: [{ type: "text", text: "Async execution is disabled; no background jobs to poll." }],
|
|
64
|
-
details: { jobs: []
|
|
58
|
+
details: { jobs: [] },
|
|
65
59
|
};
|
|
66
60
|
}
|
|
67
61
|
|
|
68
|
-
const
|
|
69
|
-
const requestedIds = params.job_ids;
|
|
62
|
+
const requestedIds = params.jobs;
|
|
70
63
|
|
|
71
64
|
// Resolve which jobs to watch
|
|
72
65
|
const jobsToWatch = requestedIds?.length
|
|
@@ -79,19 +72,18 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
79
72
|
: "No running background jobs to wait for.";
|
|
80
73
|
return {
|
|
81
74
|
content: [{ type: "text", text: message }],
|
|
82
|
-
details: { jobs: []
|
|
75
|
+
details: { jobs: [] },
|
|
83
76
|
};
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
// If all watched jobs are already done, return immediately
|
|
87
80
|
const runningJobs = jobsToWatch.filter(j => j.status === "running");
|
|
88
81
|
if (runningJobs.length === 0) {
|
|
89
|
-
return this.#buildResult(jobsToWatch
|
|
82
|
+
return this.#buildResult(jobsToWatch);
|
|
90
83
|
}
|
|
91
84
|
|
|
92
|
-
// Block until at least one running job finishes or
|
|
85
|
+
// Block until at least one running job finishes or the call is aborted
|
|
93
86
|
const racePromises: Promise<unknown>[] = runningJobs.map(j => j.promise);
|
|
94
|
-
racePromises.push(Bun.sleep(timeoutMs));
|
|
95
87
|
|
|
96
88
|
if (signal) {
|
|
97
89
|
const { promise: abortPromise, resolve: abortResolve } = Promise.withResolvers<void>();
|
|
@@ -108,14 +100,10 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
108
100
|
}
|
|
109
101
|
|
|
110
102
|
if (signal?.aborted) {
|
|
111
|
-
return this.#buildResult(jobsToWatch
|
|
103
|
+
return this.#buildResult(jobsToWatch);
|
|
112
104
|
}
|
|
113
105
|
|
|
114
|
-
|
|
115
|
-
const stillRunning = jobsToWatch.filter(j => j.status === "running");
|
|
116
|
-
const timedOut = stillRunning.length === runningJobs.length;
|
|
117
|
-
|
|
118
|
-
return this.#buildResult(jobsToWatch, timedOut);
|
|
106
|
+
return this.#buildResult(jobsToWatch);
|
|
119
107
|
}
|
|
120
108
|
|
|
121
109
|
#buildResult(
|
|
@@ -128,7 +116,6 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
128
116
|
resultText?: string;
|
|
129
117
|
errorText?: string;
|
|
130
118
|
}[],
|
|
131
|
-
timedOut: boolean,
|
|
132
119
|
): AgentToolResult<AwaitToolDetails> {
|
|
133
120
|
const now = Date.now();
|
|
134
121
|
const jobResults: AwaitResult[] = jobs.map(j => ({
|
|
@@ -145,10 +132,6 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
145
132
|
const running = jobResults.filter(j => j.status === "running");
|
|
146
133
|
|
|
147
134
|
const lines: string[] = [];
|
|
148
|
-
if (timedOut) {
|
|
149
|
-
lines.push("Timed out waiting for jobs to complete.\n");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
135
|
if (completed.length > 0) {
|
|
153
136
|
lines.push(`## Completed (${completed.length})\n`);
|
|
154
137
|
for (const j of completed) {
|
|
@@ -173,7 +156,7 @@ export class AwaitTool implements AgentTool<typeof awaitSchema, AwaitToolDetails
|
|
|
173
156
|
|
|
174
157
|
return {
|
|
175
158
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
176
|
-
details: { jobs: jobResults
|
|
159
|
+
details: { jobs: jobResults },
|
|
177
160
|
};
|
|
178
161
|
}
|
|
179
162
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
1
2
|
import * as path from "node:path";
|
|
2
3
|
import type { Skill } from "../extensibility/skills";
|
|
4
|
+
import { type LocalProtocolOptions, resolveLocalUrlToPath } from "../internal-urls";
|
|
3
5
|
import { validateRelativePath } from "../internal-urls/skill-protocol";
|
|
4
6
|
import type { InternalResource } from "../internal-urls/types";
|
|
5
7
|
import { ToolError } from "./tool-errors";
|
|
@@ -9,9 +11,9 @@ const SKILL_URL_PATTERN = /'skill:\/\/[^'\s")`\\]+'|"skill:\/\/[^"\s')`\\]+"|ski
|
|
|
9
11
|
|
|
10
12
|
/** Regex to find supported internal URL tokens in command text. */
|
|
11
13
|
const INTERNAL_URL_PATTERN =
|
|
12
|
-
/'(?:skill|agent|artifact|plan|memory|rule):\/\/[^'\s")`\\]+'|"(?:skill|agent|artifact|plan|memory|rule):\/\/[^"\s')`\\]+"|(?:skill|agent|artifact|plan|memory|rule):\/\/[^\s'")`\\]+/g;
|
|
14
|
+
/'(?:skill|agent|artifact|plan|memory|rule|local):\/\/[^'\s")`\\]+'|"(?:skill|agent|artifact|plan|memory|rule|local):\/\/[^"\s')`\\]+"|(?:skill|agent|artifact|plan|memory|rule|local):\/\/[^\s'")`\\]+/g;
|
|
13
15
|
|
|
14
|
-
const SUPPORTED_INTERNAL_SCHEMES = ["skill", "agent", "artifact", "plan", "memory", "rule"] as const;
|
|
16
|
+
const SUPPORTED_INTERNAL_SCHEMES = ["skill", "agent", "artifact", "plan", "memory", "rule", "local"] as const;
|
|
15
17
|
|
|
16
18
|
type SupportedInternalScheme = (typeof SUPPORTED_INTERNAL_SCHEMES)[number];
|
|
17
19
|
|
|
@@ -24,6 +26,8 @@ export interface InternalUrlExpansionOptions {
|
|
|
24
26
|
skills: readonly Skill[];
|
|
25
27
|
noEscape?: boolean;
|
|
26
28
|
internalRouter?: InternalUrlResolver;
|
|
29
|
+
localOptions?: LocalProtocolOptions;
|
|
30
|
+
ensureLocalParentDirs?: boolean;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
/**
|
|
@@ -102,6 +106,8 @@ async function resolveInternalUrlToPath(
|
|
|
102
106
|
url: string,
|
|
103
107
|
skills: readonly Skill[],
|
|
104
108
|
internalRouter?: InternalUrlResolver,
|
|
109
|
+
localOptions?: LocalProtocolOptions,
|
|
110
|
+
ensureLocalParentDirs?: boolean,
|
|
105
111
|
): Promise<string> {
|
|
106
112
|
const scheme = extractScheme(url);
|
|
107
113
|
if (!scheme) {
|
|
@@ -112,6 +118,19 @@ async function resolveInternalUrlToPath(
|
|
|
112
118
|
return resolveSkillUrlToPath(url, skills);
|
|
113
119
|
}
|
|
114
120
|
|
|
121
|
+
if (scheme === "local") {
|
|
122
|
+
if (!localOptions) {
|
|
123
|
+
throw new ToolError(
|
|
124
|
+
"Cannot resolve local:// URL in bash command: local protocol options are unavailable for this session.",
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
const resolvedLocalPath = resolveLocalUrlToPath(url, localOptions);
|
|
128
|
+
if (ensureLocalParentDirs) {
|
|
129
|
+
await fs.mkdir(path.dirname(resolvedLocalPath), { recursive: true });
|
|
130
|
+
}
|
|
131
|
+
return resolvedLocalPath;
|
|
132
|
+
}
|
|
133
|
+
|
|
115
134
|
if (!internalRouter || !internalRouter.canHandle(url)) {
|
|
116
135
|
throw new ToolError(
|
|
117
136
|
`Cannot resolve ${scheme}:// URL in bash command: ${url}\n` +
|
|
@@ -169,7 +188,13 @@ export async function expandInternalUrls(command: string, options: InternalUrlEx
|
|
|
169
188
|
if (index === undefined) continue;
|
|
170
189
|
|
|
171
190
|
const url = unquoteToken(token);
|
|
172
|
-
const resolvedPath = await resolveInternalUrlToPath(
|
|
191
|
+
const resolvedPath = await resolveInternalUrlToPath(
|
|
192
|
+
url,
|
|
193
|
+
options.skills,
|
|
194
|
+
options.internalRouter,
|
|
195
|
+
options.localOptions,
|
|
196
|
+
options.ensureLocalParentDirs,
|
|
197
|
+
);
|
|
173
198
|
const replacement = options.noEscape ? resolvedPath : shellEscape(resolvedPath);
|
|
174
199
|
expanded = `${expanded.slice(0, index)}${replacement}${expanded.slice(index + token.length)}`;
|
|
175
200
|
}
|
package/src/tools/bash.ts
CHANGED
|
@@ -173,8 +173,12 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
173
173
|
const internalUrlOptions: InternalUrlExpansionOptions = {
|
|
174
174
|
skills: this.session.skills ?? [],
|
|
175
175
|
internalRouter: this.session.internalRouter,
|
|
176
|
+
localOptions: {
|
|
177
|
+
getArtifactsDir: this.session.getArtifactsDir,
|
|
178
|
+
getSessionId: this.session.getSessionId,
|
|
179
|
+
},
|
|
176
180
|
};
|
|
177
|
-
command = await expandInternalUrls(command, internalUrlOptions);
|
|
181
|
+
command = await expandInternalUrls(command, { ...internalUrlOptions, ensureLocalParentDirs: true });
|
|
178
182
|
|
|
179
183
|
// Resolve protocol URLs (skill://, agent://, etc.) in extracted cwd.
|
|
180
184
|
if (cwd?.includes("://")) {
|