From 38f06284960753a0c2764531d6f0ee415a371ccb Mon Sep 17 00:00:00 2001 From: can1357 Date: Wed, 28 Jan 2026 17:15:57 +0100 Subject: [PATCH] chore: bump version to 8.12.2 --- bun.lock | 12 +-- packages/agent/package.json | 2 +- packages/ai/package.json | 2 +- packages/coding-agent/CHANGELOG.md | 2 + packages/coding-agent/package.json | 2 +- .../src/modes/components/hook-selector.ts | 15 +++- .../controllers/extension-ui-controller.ts | 2 + packages/pi-utils/package.json | 2 +- packages/pi-utils/src/glob.ts | 85 +++++++++---------- packages/stats/package.json | 2 +- packages/tui/package.json | 2 +- 11 files changed, 70 insertions(+), 58 deletions(-) diff --git a/bun.lock b/bun.lock index 1ad43cd0b..07aabcc4a 100644 --- a/bun.lock +++ b/bun.lock @@ -22,7 +22,7 @@ }, "packages/agent": { "name": "@oh-my-pi/pi-agent-core", - "version": "8.12.1", + "version": "8.12.2", "dependencies": { "@oh-my-pi/pi-ai": "workspace:*", "@oh-my-pi/pi-tui": "workspace:*", @@ -35,7 +35,7 @@ }, "packages/ai": { "name": "@oh-my-pi/pi-ai", - "version": "8.12.1", + "version": "8.12.2", "bin": { "pi-ai": "./src/cli.ts", }, @@ -65,7 +65,7 @@ }, "packages/coding-agent": { "name": "@oh-my-pi/pi-coding-agent", - "version": "8.12.1", + "version": "8.12.2", "bin": { "omp": "src/cli.ts", }, @@ -101,7 +101,7 @@ }, "packages/pi-utils": { "name": "@oh-my-pi/pi-utils", - "version": "8.12.1", + "version": "8.12.2", "dependencies": { "strip-ansi": "^7.1.2", "winston": "^3.19.0", @@ -131,7 +131,7 @@ }, "packages/stats": { "name": "@oh-my-pi/omp-stats", - "version": "8.12.1", + "version": "8.12.2", "bin": { "omp-stats": "./src/index.ts", }, @@ -151,7 +151,7 @@ }, "packages/tui": { "name": "@oh-my-pi/pi-tui", - "version": "8.12.1", + "version": "8.12.2", "dependencies": { "@types/mime-types": "^3.0.1", "chalk": "^5.6.2", diff --git a/packages/agent/package.json b/packages/agent/package.json index feff127fe..89a50fb3f 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/pi-agent-core", - "version": "8.12.1", + "version": "8.12.2", "description": "General-purpose agent with transport abstraction, state management, and attachment support", "type": "module", "main": "./src/index.ts", diff --git a/packages/ai/package.json b/packages/ai/package.json index c720dc85b..b52439cd6 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/pi-ai", - "version": "8.12.1", + "version": "8.12.2", "description": "Unified LLM API with automatic model discovery and provider configuration", "type": "module", "main": "./src/index.ts", diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 412950d17..f177d4d59 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [8.12.2] - 2026-01-28 + ### Changed - Replaced ripgrep-based file listing with fs.glob for project scans and find/read tooling diff --git a/packages/coding-agent/package.json b/packages/coding-agent/package.json index b67207059..19d74f08f 100644 --- a/packages/coding-agent/package.json +++ b/packages/coding-agent/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/pi-coding-agent", - "version": "8.12.1", + "version": "8.12.2", "description": "Coding agent CLI with read, bash, edit, write tools and session management", "type": "module", "ompConfig": { diff --git a/packages/coding-agent/src/modes/components/hook-selector.ts b/packages/coding-agent/src/modes/components/hook-selector.ts index 7cf645077..8c040a02f 100644 --- a/packages/coding-agent/src/modes/components/hook-selector.ts +++ b/packages/coding-agent/src/modes/components/hook-selector.ts @@ -12,6 +12,7 @@ export interface HookSelectorOptions { timeout?: number; initialIndex?: number; outline?: boolean; + maxVisible?: number; } class OutlinedList extends Container { @@ -37,6 +38,7 @@ class OutlinedList extends Container { export class HookSelectorComponent extends Container { private options: string[]; private selectedIndex: number; + private maxVisible: number; private listContainer: Container | undefined; private outlinedList: OutlinedList | undefined; private onSelectCallback: (option: string) => void; @@ -56,6 +58,7 @@ export class HookSelectorComponent extends Container { this.options = options; this.selectedIndex = Math.min(opts?.initialIndex ?? 0, options.length - 1); + this.maxVisible = Math.max(3, opts?.maxVisible ?? 12); this.onSelectCallback = onSelect; this.onCancelCallback = onCancel; this.baseTitle = title; @@ -101,13 +104,23 @@ export class HookSelectorComponent extends Container { private updateList(): void { const lines: string[] = []; - for (let i = 0; i < this.options.length; i++) { + const startIndex = Math.max( + 0, + Math.min(this.selectedIndex - Math.floor(this.maxVisible / 2), this.options.length - this.maxVisible), + ); + const endIndex = Math.min(startIndex + this.maxVisible, this.options.length); + + for (let i = startIndex; i < endIndex; i++) { const isSelected = i === this.selectedIndex; const text = isSelected ? theme.fg("accent", `${theme.nav.cursor} `) + theme.fg("accent", this.options[i]) : ` ${theme.fg("text", this.options[i])}`; lines.push(text); } + + if (startIndex > 0 || endIndex < this.options.length) { + lines.push(theme.fg("dim", ` (${this.selectedIndex + 1}/${this.options.length})`)); + } if (this.outlinedList) { this.outlinedList.setLines(lines); return; diff --git a/packages/coding-agent/src/modes/controllers/extension-ui-controller.ts b/packages/coding-agent/src/modes/controllers/extension-ui-controller.ts index e7b20cae7..7c5e1612c 100644 --- a/packages/coding-agent/src/modes/controllers/extension-ui-controller.ts +++ b/packages/coding-agent/src/modes/controllers/extension-ui-controller.ts @@ -504,6 +504,7 @@ export class ExtensionUiController { const { promise, resolve } = Promise.withResolvers(); this.hookSelectorOverlay?.hide(); this.hookSelectorOverlay = undefined; + const maxVisible = Math.max(4, Math.min(15, this.ctx.ui.terminal.rows - 12)); this.ctx.hookSelector = new HookSelectorComponent( title, options, @@ -520,6 +521,7 @@ export class ExtensionUiController { timeout: dialogOptions?.timeout, tui: this.ctx.ui, outline: dialogOptions?.outline, + maxVisible, }, ); this.hookSelectorOverlay = this.ctx.ui.showOverlay(this.ctx.hookSelector, this.dialogOverlayOptions); diff --git a/packages/pi-utils/package.json b/packages/pi-utils/package.json index 00c375a31..7c9ca3657 100644 --- a/packages/pi-utils/package.json +++ b/packages/pi-utils/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/pi-utils", - "version": "8.12.1", + "version": "8.12.2", "description": "Shared utilities for pi packages", "type": "module", "main": "./src/index.ts", diff --git a/packages/pi-utils/src/glob.ts b/packages/pi-utils/src/glob.ts index 92cc03513..1b95d7d00 100644 --- a/packages/pi-utils/src/glob.ts +++ b/packages/pi-utils/src/glob.ts @@ -1,6 +1,5 @@ -import type * as fsTypes from "node:fs"; -import * as fs from "node:fs/promises"; import * as path from "node:path"; +import { Glob } from "bun"; export interface GlobPathsOptions { /** Base directory for glob patterns. Defaults to process.cwd(). */ @@ -19,14 +18,6 @@ export interface GlobPathsOptions { gitignore?: boolean; } -function createGlobSignal(signal?: AbortSignal, timeoutMs?: number): AbortSignal | undefined { - const timeoutSignal = timeoutMs ? AbortSignal.timeout(timeoutMs) : undefined; - if (signal && timeoutSignal) { - return AbortSignal.any([signal, timeoutSignal]); - } - return signal ?? timeoutSignal; -} - /** Patterns always excluded (.git is never useful in glob results). */ const ALWAYS_IGNORED = ["**/.git", "**/.git/**"]; @@ -133,30 +124,6 @@ export async function loadGitignorePatterns(baseDir: string): Promise return patterns; } -function isAsyncIterable(value: unknown): value is AsyncIterable { - return typeof (value as { [Symbol.asyncIterator]?: unknown })?.[Symbol.asyncIterator] === "function"; -} - -async function collectGlobResults(result: unknown): Promise { - const resolved = await Promise.resolve(result); - if (!resolved) { - return []; - } - if (Array.isArray(resolved)) { - return resolved.filter((entry): entry is string => typeof entry === "string"); - } - if (isAsyncIterable(resolved)) { - const entries: string[] = []; - for await (const entry of resolved) { - if (typeof entry === "string") { - entries.push(entry); - } - } - return entries; - } - return []; -} - /** * Resolve filesystem paths matching glob patterns with optional exclude filters. * Returns paths relative to the provided cwd (or process.cwd()). @@ -177,17 +144,45 @@ export async function globPaths(patterns: string | string[], options: GlobPathsO effectiveExclude = [...effectiveExclude, ...gitignorePatterns]; } - const globOptions = { - cwd, - exclude: effectiveExclude, - signal: createGlobSignal(signal, timeoutMs), - dot, - nodir: onlyFiles, - } as fsTypes.GlobOptions; - - const result = fs.glob(patterns, globOptions); - const entries = await collectGlobResults(result); const base = cwd ?? process.cwd(); + const allResults: string[] = []; - return entries.map(entry => (path.isAbsolute(entry) ? path.relative(base, entry) : entry)); + // Combine timeout and abort signals + const timeoutSignal = timeoutMs ? AbortSignal.timeout(timeoutMs) : undefined; + const combinedSignal = + signal && timeoutSignal ? AbortSignal.any([signal, timeoutSignal]) : (signal ?? timeoutSignal); + + for (const pattern of patternArray) { + const glob = new Glob(pattern); + const scanOptions = { + cwd: base, + dot, + onlyFiles, + throwErrorOnBrokenSymlink: false, + }; + + for await (const entry of glob.scan(scanOptions)) { + if (combinedSignal?.aborted) { + const reason = combinedSignal.reason; + if (reason instanceof Error) throw reason; + throw new DOMException("Aborted", "AbortError"); + } + + // Check exclusion patterns + const normalized = entry.replace(/\\/g, "/"); + let excluded = false; + for (const excludePattern of effectiveExclude) { + const excludeGlob = new Glob(excludePattern); + if (excludeGlob.match(normalized)) { + excluded = true; + break; + } + } + if (!excluded) { + allResults.push(normalized); + } + } + } + + return allResults; } diff --git a/packages/stats/package.json b/packages/stats/package.json index 02fb10b3d..b993e482c 100644 --- a/packages/stats/package.json +++ b/packages/stats/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/omp-stats", - "version": "8.12.1", + "version": "8.12.2", "description": "Local observability dashboard for pi AI usage statistics", "type": "module", "main": "./src/index.ts", diff --git a/packages/tui/package.json b/packages/tui/package.json index b70fa23b8..cff5d4f8b 100644 --- a/packages/tui/package.json +++ b/packages/tui/package.json @@ -1,6 +1,6 @@ { "name": "@oh-my-pi/pi-tui", - "version": "8.12.1", + "version": "8.12.2", "description": "Terminal User Interface library with differential rendering for efficient text-based applications", "type": "module", "main": "./src/index.ts",