@oh-my-pi/pi-coding-agent 13.16.1 → 13.16.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/package.json +7 -7
- package/src/config/settings-schema.ts +7 -0
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/tool-execution.ts +2 -1
- package/src/prompts/tools/ast-edit.md +1 -1
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/tools/browser.ts +51 -2
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.16.
|
|
4
|
+
"version": "13.16.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",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@agentclientprotocol/sdk": "0.16.1",
|
|
44
44
|
"@mozilla/readability": "^0.6",
|
|
45
|
-
"@oh-my-pi/omp-stats": "13.16.
|
|
46
|
-
"@oh-my-pi/pi-agent-core": "13.16.
|
|
47
|
-
"@oh-my-pi/pi-ai": "13.16.
|
|
48
|
-
"@oh-my-pi/pi-natives": "13.16.
|
|
49
|
-
"@oh-my-pi/pi-tui": "13.16.
|
|
50
|
-
"@oh-my-pi/pi-utils": "13.16.
|
|
45
|
+
"@oh-my-pi/omp-stats": "13.16.2",
|
|
46
|
+
"@oh-my-pi/pi-agent-core": "13.16.2",
|
|
47
|
+
"@oh-my-pi/pi-ai": "13.16.2",
|
|
48
|
+
"@oh-my-pi/pi-natives": "13.16.2",
|
|
49
|
+
"@oh-my-pi/pi-tui": "13.16.2",
|
|
50
|
+
"@oh-my-pi/pi-utils": "13.16.2",
|
|
51
51
|
"@sinclair/typebox": "^0.34",
|
|
52
52
|
"@xterm/headless": "^6.0",
|
|
53
53
|
"ajv": "^8.18",
|
|
@@ -353,6 +353,13 @@ export const SETTINGS_SCHEMA = {
|
|
|
353
353
|
ui: { tab: "appearance", label: "Block Images", description: "Prevent images from being sent to LLM providers" },
|
|
354
354
|
},
|
|
355
355
|
|
|
356
|
+
"tui.maxInlineImageColumns": {
|
|
357
|
+
type: "number",
|
|
358
|
+
default: 100,
|
|
359
|
+
description:
|
|
360
|
+
"Maximum width in terminal columns for inline images (default 100). Set to 0 for unlimited (bounded only by terminal width).",
|
|
361
|
+
},
|
|
362
|
+
|
|
356
363
|
// Display rendering
|
|
357
364
|
"display.tabWidth": {
|
|
358
365
|
type: "number",
|
|
@@ -76,7 +76,7 @@ export class AssistantMessageComponent extends Container {
|
|
|
76
76
|
image.data,
|
|
77
77
|
image.mimeType,
|
|
78
78
|
{ fallbackColor: (text: string) => theme.fg("toolOutput", text) },
|
|
79
|
-
{ maxWidthCells:
|
|
79
|
+
{ maxWidthCells: settings.get("tui.maxInlineImageColumns") },
|
|
80
80
|
),
|
|
81
81
|
);
|
|
82
82
|
continue;
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type TUI,
|
|
15
15
|
} from "@oh-my-pi/pi-tui";
|
|
16
16
|
import { getProjectDir, logger } from "@oh-my-pi/pi-utils";
|
|
17
|
+
import { settings } from "../../config/settings";
|
|
17
18
|
import type { Theme } from "../../modes/theme/theme";
|
|
18
19
|
import { theme } from "../../modes/theme/theme";
|
|
19
20
|
import { computeEditDiff, computeHashlineDiff, computePatchDiff, type DiffError, type DiffResult } from "../../patch";
|
|
@@ -530,7 +531,7 @@ export class ToolExecutionComponent extends Container {
|
|
|
530
531
|
imageData,
|
|
531
532
|
imageMimeType,
|
|
532
533
|
{ fallbackColor: (s: string) => theme.fg("toolOutput", s) },
|
|
533
|
-
{ maxWidthCells:
|
|
534
|
+
{ maxWidthCells: settings.get("tui.maxInlineImageColumns") },
|
|
534
535
|
);
|
|
535
536
|
this.#imageComponents.push(imageComponent);
|
|
536
537
|
this.addChild(imageComponent);
|
|
@@ -2,7 +2,7 @@ Performs structural AST-aware rewrites via native ast-grep.
|
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
4
|
- Use for codemods and structural rewrites where plain text replace is unsafe
|
|
5
|
-
- Narrow scope with `path` before replacing (`path` accepts files, directories, glob patterns, or comma
|
|
5
|
+
- Narrow scope with `path` before replacing (`path` accepts files, directories, glob patterns, or comma-separated path lists; use `glob` for an additional filter relative to `path`)
|
|
6
6
|
- Default to language-scoped rewrites in mixed repositories: set `lang` and keep `path`/`glob` narrow
|
|
7
7
|
- Treat parse issues as a scoping or pattern-shape signal: tighten `path`/`lang`, or rewrite the pattern into valid syntax before retrying
|
|
8
8
|
- Metavariables captured in each rewrite pattern (`$A`, `$$$ARGS`) are substituted into that entry's rewrite template
|
|
@@ -2,7 +2,7 @@ Performs structural code search using AST matching via native ast-grep.
|
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
4
|
- Use this when syntax shape matters more than raw text (calls, declarations, specific language constructs)
|
|
5
|
-
- Prefer a precise `path` scope to keep results targeted and deterministic (`path` accepts files, directories, glob patterns, or comma
|
|
5
|
+
- Prefer a precise `path` scope to keep results targeted and deterministic (`path` accepts files, directories, glob patterns, or comma-separated path lists; use `glob` for an additional filter relative to `path`)
|
|
6
6
|
- Default to language-scoped search in mixed repositories: pair `path` + `glob` + explicit `lang` to avoid parse-noise from non-source files
|
|
7
7
|
- `pat` is required and must include at least one non-empty AST pattern; `lang` is optional (`lang` is inferred per file extension when omitted)
|
|
8
8
|
- Multiple patterns run in one native pass; results are merged and then `offset`/`limit` are applied to the combined match set
|
|
@@ -2,7 +2,7 @@ Finds files using fast pattern matching that works with any codebase size.
|
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
4
|
- Pattern includes the search path: `src/**/*.ts`, `lib/*.json`, `**/*.md`
|
|
5
|
-
- You may provide comma
|
|
5
|
+
- You may provide comma-separated path lists, for example `apps/,packages/,phases/`
|
|
6
6
|
- Simple patterns like `*.ts` automatically search recursively from cwd
|
|
7
7
|
- Includes hidden files by default (use `hidden: false` to exclude)
|
|
8
8
|
- You **SHOULD** perform multiple searches in parallel when potentially useful
|
|
@@ -2,7 +2,7 @@ Searches files using powerful regex matching.
|
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
4
|
- Supports full regex syntax (e.g., `log.*Error`, `function\\s+\\w+`); literal braces need escaping (`interface\\{\\}` for `interface{}` in Go)
|
|
5
|
-
- `path` may be a file, directory, glob path, or comma
|
|
5
|
+
- `path` may be a file, directory, glob path, or comma-separated path list; pair it with `glob` when you need an additional relative file filter
|
|
6
6
|
- Filter files with `glob` (e.g., `*.js`, `**/*.tsx`) or `type` (e.g., `js`, `py`, `rust`)
|
|
7
7
|
- Respects `.gitignore` by default; set `gitignore: false` to include ignored files
|
|
8
8
|
- For cross-line patterns like `struct \\{[\\s\\S]*?field`, set `multiline: true` if needed
|
package/src/tools/browser.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as fs from "node:fs
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
2
|
import * as os from "node:os";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { Readability } from "@mozilla/readability";
|
|
@@ -61,6 +61,54 @@ async function loadPuppeteer(): Promise<typeof Puppeteer> {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* On NixOS, Puppeteer's bundled Chromium is a dynamically-linked FHS binary and
|
|
66
|
+
* cannot run as-is. Detect the platform and resolve a system-installed Chromium
|
|
67
|
+
* so `puppeteer.launch()` can use it instead of the bundled one.
|
|
68
|
+
*
|
|
69
|
+
* Detection order:
|
|
70
|
+
* 1. `chromium` on PATH
|
|
71
|
+
* 2. `chromium-browser` on PATH
|
|
72
|
+
* 3. ~/.nix-profile/bin/chromium (user profile)
|
|
73
|
+
* 4. /run/current-system/sw/bin/chromium (system profile)
|
|
74
|
+
*
|
|
75
|
+
* Returns `undefined` on non-NixOS systems or when no binary is found, which
|
|
76
|
+
* causes Puppeteer to fall back to its default resolution.
|
|
77
|
+
*/
|
|
78
|
+
let _resolvedChromium: string | null | undefined; // undefined = unchecked; null = not found
|
|
79
|
+
function resolveSystemChromium(): string | undefined {
|
|
80
|
+
if (_resolvedChromium !== undefined) return _resolvedChromium ?? undefined;
|
|
81
|
+
try {
|
|
82
|
+
if (!fs.existsSync("/etc/NIXOS")) {
|
|
83
|
+
_resolvedChromium = null;
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
} catch {
|
|
87
|
+
_resolvedChromium = null;
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const candidates = [
|
|
91
|
+
Bun.which("chromium"),
|
|
92
|
+
Bun.which("chromium-browser"),
|
|
93
|
+
path.join(os.homedir(), ".nix-profile/bin/chromium"),
|
|
94
|
+
"/run/current-system/sw/bin/chromium",
|
|
95
|
+
];
|
|
96
|
+
for (const candidate of candidates) {
|
|
97
|
+
if (candidate) {
|
|
98
|
+
try {
|
|
99
|
+
if (fs.existsSync(candidate)) {
|
|
100
|
+
_resolvedChromium = candidate;
|
|
101
|
+
logger.debug("NixOS: using system Chromium", { path: candidate });
|
|
102
|
+
return candidate;
|
|
103
|
+
}
|
|
104
|
+
} catch {}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
_resolvedChromium = null;
|
|
108
|
+
logger.debug("NixOS detected but no Chromium binary found; Puppeteer may fail to launch");
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
64
112
|
const DEFAULT_VIEWPORT = { width: 1365, height: 768, deviceScaleFactor: 1.25 };
|
|
65
113
|
const STEALTH_IGNORE_DEFAULT_ARGS = [
|
|
66
114
|
"--disable-extensions",
|
|
@@ -548,6 +596,7 @@ export class BrowserTool implements AgentTool<typeof browserSchema, BrowserToolD
|
|
|
548
596
|
this.#browser = await puppeteer.launch({
|
|
549
597
|
headless: this.#currentHeadless,
|
|
550
598
|
defaultViewport: this.#currentHeadless ? initialViewport : null,
|
|
599
|
+
executablePath: resolveSystemChromium(),
|
|
551
600
|
args: launchArgs,
|
|
552
601
|
ignoreDefaultArgs: [...STEALTH_IGNORE_DEFAULT_ARGS],
|
|
553
602
|
});
|
|
@@ -1382,7 +1431,7 @@ export class BrowserTool implements AgentTool<typeof browserSchema, BrowserToolD
|
|
|
1382
1431
|
} else {
|
|
1383
1432
|
dest = path.join(os.tmpdir(), `omp-sshots-${Snowflake.next()}.png`);
|
|
1384
1433
|
}
|
|
1385
|
-
await fs.mkdir(path.dirname(dest), { recursive: true });
|
|
1434
|
+
await fs.promises.mkdir(path.dirname(dest), { recursive: true });
|
|
1386
1435
|
// Full-res buffer when saving to a user-defined location; resized (API copy) for temp-only.
|
|
1387
1436
|
const saveFullRes = !!(paramPath || screenshotDir);
|
|
1388
1437
|
const savedBuffer = saveFullRes ? buffer : resized.buffer;
|