refactor(deps): restructured codebase to use centralized pi-utils package

- Created new @oh-my-pi/pi-utils workspace package with shared utilities for logging, process management, stream handling, and temporary directory management.
- Migrated all packages to use centralized logger from @oh-my-pi/pi-utils instead of local winston implementations.
- Replaced custom process spawning and stream reading implementations with standardized cspawn and readLines utilities across all modules.
- Converted synchronous file operations and process spawning to async patterns using Bun shell syntax and fs/promises.
- Added streaming edit abort functionality with configurable setting to abort on patch preview failures.
- Updated test framework from vitest to bun:test across all test suites.
This commit is contained in:
can1357
2026-01-20 05:33:21 +01:00
parent 030b812624
commit b2c94bef1a
166 changed files with 3821 additions and 3215 deletions
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from "bun:test";
import { rmSync } from "node:fs";
import { createTempDirSync } from "@oh-my-pi/pi-utils";
import {
disposeAllKernelSessions,
executePythonWithKernel,
@@ -152,6 +153,7 @@ describe("warmPythonEnvironment", () => {
it("caches prelude docs on warmup", async () => {
const previousSkip = process.env.OMP_PYTHON_SKIP_CHECK;
process.env.OMP_PYTHON_SKIP_CHECK = "1";
using tempDir = createTempDirSync("@python-executor-");
const docs: PreludeHelper[] = [
{
name: "read",
@@ -168,7 +170,7 @@ describe("warmPythonEnvironment", () => {
};
const startSpy = vi.spyOn(PythonKernel, "start").mockResolvedValue(kernel as unknown as PythonKernel);
const result = await warmPythonEnvironment("/tmp/test", "session-1");
const result = await warmPythonEnvironment(tempDir.path, "session-1");
expect(result.ok).toBe(true);
expect(result.docs).toEqual(docs);