diff --git a/AGENTS.md b/AGENTS.md index 71c97f447..923d4f74a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ This repo contains multiple packages, but **`packages/coding-agent/`** is the pr | `packages/tui` | Terminal UI library with differential rendering | | `packages/natives` | WASM bindings for native text/image/grep operations | | `packages/stats` | Local observability dashboard (`omp stats`) | -| `packages/pi-utils` | Shared utilities (logger, streams, temp files) | +| `packages/utils` | Shared utilities (logger, streams, temp files) | | `crates/pi-natives` | Rust WASM crate for performance-critical text/grep ops | ## Code Quality diff --git a/bun.lock b/bun.lock index b5ea65077..38835f492 100644 --- a/bun.lock +++ b/bun.lock @@ -110,18 +110,6 @@ "@types/node": "^25.0.10", }, }, - "packages/pi-utils": { - "name": "@oh-my-pi/pi-utils", - "version": "8.12.6", - "dependencies": { - "strip-ansi": "^7.1.2", - "winston": "^3.19.0", - "winston-daily-rotate-file": "^5.0.0", - }, - "devDependencies": { - "@types/node": "^25.0.10", - }, - }, "packages/react-edit-benchmark": { "name": "@oh-my-pi/react-edit-benchmark", "version": "0.0.1", @@ -175,6 +163,18 @@ "@xterm/xterm": "^6.0.0", }, }, + "packages/utils": { + "name": "@oh-my-pi/pi-utils", + "version": "8.12.6", + "dependencies": { + "strip-ansi": "^7.1.2", + "winston": "^3.19.0", + "winston-daily-rotate-file": "^5.0.0", + }, + "devDependencies": { + "@types/node": "^25.0.10", + }, + }, }, "packages": { "@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.71.2", "", { "dependencies": { "json-schema-to-ts": "^3.1.1" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-TGNDEUuEstk/DKu0/TflXAEt+p+p/WhTlFzEnoosvbaDU2LTjm42igSdlL0VijrKpWejtOKxX0b8A7uc+XiSAQ=="], @@ -309,7 +309,7 @@ "@oh-my-pi/pi-tui": ["@oh-my-pi/pi-tui@workspace:packages/tui"], - "@oh-my-pi/pi-utils": ["@oh-my-pi/pi-utils@workspace:packages/pi-utils"], + "@oh-my-pi/pi-utils": ["@oh-my-pi/pi-utils@workspace:packages/utils"], "@oh-my-pi/react-edit-benchmark": ["@oh-my-pi/react-edit-benchmark@workspace:packages/react-edit-benchmark"], diff --git a/packages/coding-agent/test/tools.test.ts b/packages/coding-agent/test/tools.test.ts index a15e802e7..043f935c5 100644 --- a/packages/coding-agent/test/tools.test.ts +++ b/packages/coding-agent/test/tools.test.ts @@ -152,7 +152,7 @@ describe("Coding Agent Tools", () => { expect(output).toContain("Line 1"); expect(output).toContain("Line 10"); expect(output).not.toContain("Line 11"); - expect(output).toContain("[90 more lines in file. Use offset=11 to continue]"); + expect(output).toContain("[Showing lines 1-10 of 100. Use offset=11 to continue]"); }); it("should handle offset + limit together", async () => { @@ -171,7 +171,7 @@ describe("Coding Agent Tools", () => { expect(output).toContain("Line 41"); expect(output).toContain("Line 60"); expect(output).not.toContain("Line 61"); - expect(output).toContain("[40 more lines in file. Use offset=61 to continue]"); + expect(output).toContain("[Showing lines 41-60 of 100. Use offset=61 to continue]"); }); it("should show error when offset is beyond file length", async () => { diff --git a/packages/pi-utils/package.json b/packages/utils/package.json similarity index 95% rename from packages/pi-utils/package.json rename to packages/utils/package.json index 516840a4e..c3c6e457a 100644 --- a/packages/pi-utils/package.json +++ b/packages/utils/package.json @@ -24,7 +24,7 @@ "repository": { "type": "git", "url": "git+https://github.com/can1357/oh-my-pi.git", - "directory": "packages/pi-utils" + "directory": "packages/utils" }, "dependencies": { "winston": "^3.19.0", diff --git a/packages/pi-utils/src/abortable.ts b/packages/utils/src/abortable.ts similarity index 100% rename from packages/pi-utils/src/abortable.ts rename to packages/utils/src/abortable.ts diff --git a/packages/pi-utils/src/color.ts b/packages/utils/src/color.ts similarity index 100% rename from packages/pi-utils/src/color.ts rename to packages/utils/src/color.ts diff --git a/packages/pi-utils/src/fs-error.ts b/packages/utils/src/fs-error.ts similarity index 100% rename from packages/pi-utils/src/fs-error.ts rename to packages/utils/src/fs-error.ts diff --git a/packages/pi-utils/src/glob.ts b/packages/utils/src/glob.ts similarity index 100% rename from packages/pi-utils/src/glob.ts rename to packages/utils/src/glob.ts diff --git a/packages/pi-utils/src/index.ts b/packages/utils/src/index.ts similarity index 100% rename from packages/pi-utils/src/index.ts rename to packages/utils/src/index.ts diff --git a/packages/pi-utils/src/logger.ts b/packages/utils/src/logger.ts similarity index 100% rename from packages/pi-utils/src/logger.ts rename to packages/utils/src/logger.ts diff --git a/packages/pi-utils/src/postmortem.ts b/packages/utils/src/postmortem.ts similarity index 100% rename from packages/pi-utils/src/postmortem.ts rename to packages/utils/src/postmortem.ts diff --git a/packages/pi-utils/src/ptree.ts b/packages/utils/src/ptree.ts similarity index 100% rename from packages/pi-utils/src/ptree.ts rename to packages/utils/src/ptree.ts diff --git a/packages/pi-utils/src/stream.ts b/packages/utils/src/stream.ts similarity index 100% rename from packages/pi-utils/src/stream.ts rename to packages/utils/src/stream.ts diff --git a/packages/pi-utils/src/temp.ts b/packages/utils/src/temp.ts similarity index 100% rename from packages/pi-utils/src/temp.ts rename to packages/utils/src/temp.ts diff --git a/packages/pi-utils/tsconfig.build.json b/packages/utils/tsconfig.build.json similarity index 100% rename from packages/pi-utils/tsconfig.build.json rename to packages/utils/tsconfig.build.json diff --git a/packages/pi-utils/tsconfig.json b/packages/utils/tsconfig.json similarity index 100% rename from packages/pi-utils/tsconfig.json rename to packages/utils/tsconfig.json diff --git a/packages/pi-utils/tsconfig.publish.json b/packages/utils/tsconfig.publish.json similarity index 100% rename from packages/pi-utils/tsconfig.publish.json rename to packages/utils/tsconfig.publish.json diff --git a/scripts/install-tests/tarball.dockerfile b/scripts/install-tests/tarball.dockerfile index de0359640..113da6ce1 100644 --- a/scripts/install-tests/tarball.dockerfile +++ b/scripts/install-tests/tarball.dockerfile @@ -63,7 +63,7 @@ RUN cat > /repo/scripts/publish-local.sh <<'SCRIPT' set -e REGISTRY="http://localhost:4873" -PACKAGES=(pi-utils ai agent tui stats coding-agent) +PACKAGES=(utils ai agent tui stats coding-agent) # Build version map from all package.json files declare -A VERSION_MAP diff --git a/tsconfig.base.json b/tsconfig.base.json index 2c8626d17..1f7b88c04 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -26,8 +26,8 @@ "@oh-my-pi/pi-ai/*": ["./packages/ai/src/*"], "@oh-my-pi/pi-agent-core": ["./packages/agent/src/index.ts"], "@oh-my-pi/pi-agent-core/*": ["./packages/agent/src/*"], - "@oh-my-pi/pi-utils": ["./packages/pi-utils/src/index.ts"], - "@oh-my-pi/pi-utils/*": ["./packages/pi-utils/src/*"], + "@oh-my-pi/pi-utils": ["./packages/utils/src/index.ts"], + "@oh-my-pi/pi-utils/*": ["./packages/utils/src/*"], "@oh-my-pi/pi-coding-agent": ["./packages/coding-agent/src/index.ts"], "@oh-my-pi/pi-coding-agent/hooks": ["./packages/coding-agent/src/extensibility/hooks/index.ts"], "@oh-my-pi/pi-coding-agent/*": ["./packages/coding-agent/src/*"],