Commit Graph

280 Commits

Author SHA1 Message Date
can1357 7be29ab70f chore: bump version to 13.14.2 2026-03-21 17:34:47 +01:00
can1357 b89631541a chore: bump version to 13.14.1 2026-03-21 17:09:04 +01:00
can1357 32e6379fbe chore: bump version to 13.14.0 2026-03-20 23:53:34 +01:00
can1357 999d066d71 chore: bump version to 13.13.2 2026-03-18 23:21:20 +01:00
can1357 e58908615f chore: bump version to 13.13.1 2026-03-18 23:00:40 +01:00
can1357 964ee1bba8 chore: bump version to 13.13.0 2026-03-18 10:56:16 +01:00
can1357 88cb72b653 chore: bump version to 13.12.10 2026-03-17 19:42:38 +01:00
can1357 ca332be917 chore: bump version to 13.12.9 2026-03-17 16:50:20 +01:00
can1357 1b256ab151 chore: bump version to 13.12.8 2026-03-16 16:06:16 +01:00
can1357 78177af8bc feat(coding-agent): added symlink resolution and path alias handling for consistent directory behavior
- Added symlink and path alias resolution to session directory handling for consistent behavior across aliased home and temp directories.
- Improved status line path display to strip display roots using canonical path resolution, correctly handling symlink-equivalent directory aliases.
- Added support for quoted paths in grep, ast_grep, and find tools to properly handle directory names with spaces.
- Improved ast_grep error messaging when no matches found with parse errors to suggest narrowing path/glob or setting language.
- Extracted path utility functions (resolveEquivalentPath, normalizePathForComparison, pathIsWithin, relativePathWithinRoot) to shared utils package.
- Added comprehensive test coverage for symlink alias resolution in status line path rendering and session directory handling.
2026-03-16 15:24:18 +01:00
can1357 24ef2302ea chore: bump version to 13.12.7 2026-03-16 13:55:33 +01:00
can1357 53a46d94d8 chore: bump version to 13.12.6 2026-03-15 23:54:36 +01:00
can1357 26d874b372 chore: bump version to 13.12.5 2026-03-15 23:20:18 +01:00
can1357 3495c3d91a chore: bump version to 13.12.4 2026-03-15 18:41:15 +01:00
can1357 a2a07fbce0 chore: bump version to 13.12.3 2026-03-15 17:38:49 +01:00
can1357 99848563bb chore: bump version to 13.12.2 2026-03-15 17:29:51 +01:00
can1357 d469c2a96b chore: bump version to 13.12.1 2026-03-15 16:51:30 +01:00
汐 758acc6b53 fix(xdg): add darwin support (#412) 2026-03-14 16:04:07 +01:00
can1357 07e2dfbf0b chore: bump version to 13.12.0 2026-03-14 15:03:25 +01:00
can1357 ddaa15c66b chore: reformat 2026-03-14 15:03:07 +01:00
can1357 cd11c84bb8 refactor(utils): removed getTestAuthPath and improved XDG directory resolution
- Removed getTestAuthPath function and updated oauth test to construct path directly using getAgentDir and path.join.
- Refactored XDG directory resolution to validate paths exist before returning them, preventing invalid directory references.
- Extracted XDG resolution logic into a reusable resolveIf helper function for cleaner code.
2026-03-14 14:53:32 +01:00
汐 2ae1a042d8 feat(utils): full XDG Base Directory support for all path helpers (#407)
* feat(utils): full XDG Base Directory support for all path helpers

Implement XDG-first resolution across all omp path helpers, extend the
migration command to cover every data/state/cache location, and fix
five data-safety issues found in review.

dirs.ts:
- Add getXdgCachePath() helper ($XDG_CACHE_HOME/omp/<subpath>)
- Add isDefaultAgentDir() helper: XDG lookup is only valid when the
  resolved agentDir equals the process default (~/.omp/agent); custom
  profiles set via PI_CODING_AGENT_DIR or setAgentDir() are never
  silently redirected to the global XDG database
- Update 15 functions to XDG-first resolution:
    data:  getPluginsDir, getRemoteDir, getRemoteHostDir, getPythonEnvDir,
           getWorktreeBaseDir
    state: getReportsDir, getSshControlDir, getCrashLogPath, getDebugLogPath
    cache: getPuppeteerDir, getGpuCachePath, getNativesDir
- Guard XDG lookup with isDefaultAgentDir(agentDir ?? getAgentDir()) in
  all 9 agent-subdir helpers so that callers passing the global default
  agentDir still resolve to the migrated XDG location, while callers
  passing a non-default agentDir or running under a custom profile via
  setAgentDir() bypass XDG entirely
- Plugin-derived helpers delegate to getPluginsDir() and follow XDG
  resolution automatically

migrate-xdg.ts:
- Add getXdgCacheHome() helper
- Extend MigrationItem.category to include 'cache'
- Add 12 new migration entries: reports, plugins, remote, ssh-control,
  remote-host, python-env, puppeteer, wt, gpu_cache.json, natives,
  omp-crash.log, omp-debug.log
- Refuse to run when PI_CODING_AGENT_DIR points to a non-default
  profile: migration only makes sense for the default ~/.omp/agent tree
- copyDirectory returns skipped source paths (target existed, non-force)
- verifyIntegrity: remove size-mismatch early-return that masked stale
  targets as successful copies
- executeMigration: delete only entries that were actually copied;
  use rmdir on source dir so it is removed only when empty, preserving
  any skipped files for a subsequent --force run
- executeMigration: rename partial target to <target>.bak on integrity
  failure instead of deleting; preserves pre-existing user data while
  preventing getXdgDataPath from treating the partial tree as
  authoritative; source remains intact for re-copy on next run

test isolation:
- Set XDG_DATA_HOME/XDG_STATE_HOME to non-existent paths in
  memories-runtime.test.ts beforeEach/afterEach to prevent
  getXdgDataPath/getXdgStatePath from resolving to real user data

* fix(utils,coding-agent): fix XDG support issues

dirs.ts:
- Refactor path resolution into DirResolver class. XDG base dirs are
  resolved once at construction from env vars (Linux only, no
  existsSync). setAgentDir creates a fresh instance, naturally
  invalidating all cached paths and recomputing isDefaultProfile.
- getRootSubdir/agentSubdir accept optional XdgCategory parameter;
  when set, the XDG base replaces the config root. Every accessor
  is a one-liner delegate.
- Non-Linux platforms: XDG fields are null, zero overhead. No
  filesystem probing, no string comparisons on the hot path.
- Config-only subdirs (themes, tools, commands, prompts, modules)
  have no XDG category — they stay under the config root.
- Remove `import { env } from 'bun'`, use process.env consistently.
- Restore JSDoc comments to document actual defaults (~/.omp/...).

migrate-xdg.ts:
- Gate migrateToXdg on Linux — exits with clear error on other
  platforms.
- Fix data loss bug: verifyIntegrity now accepts a Set of skipped
  paths and skips verification for files that were intentionally not
  copied (pre-existing at target in non-force mode).
- Fix nested directory source deletion: recursive removeSourceEntries
  walks the tree and only deletes files not in the skipped set.
- Remove dead _sourcePath variable and unused force parameter from
  verifyIntegrity.
- Remove `import { env } from 'bun'`, use process.env consistently.

logger.ts:
- Revert JSDoc to document ~/.omp/logs/ as default.

oauth.ts:
- Replace direct getAgentSubdir call with getTestAuthPath().

CHANGELOG.md:
- Merge duplicate section headers under [Unreleased].
- Add missing blank line before [13.11.1].

---------

Co-authored-by: can1357 <me@can.ac>
2026-03-14 14:52:12 +01:00
can1357 6fc41a1599 chore: bump version to 13.11.1 2026-03-13 15:30:17 +01:00
can1357 7ab04f617e chore: bump version to 13.11.0 2026-03-12 17:38:11 +01:00
汐 af383e5618 fix(path): PI_CONFIG_DIR discovery (#358)
* fix(path): PI_CONFIG_DIR discovery

* refactor: centralize agent dir name into getConfigAgentDirName()

- Add getConfigAgentDirName() to utils/dirs.ts as single source of truth
- Replace duplicated "/agent" suffix construction in helpers.ts and config.ts
- Let biome format mcp/manager.ts canonically

---------

Co-authored-by: can1357 <me@can.ac>
2026-03-11 01:07:57 +01:00
can1357 61aa2c2bee chore: bump version to 13.10.1 2026-03-10 20:15:23 +01:00
can1357 535a828f9c chore: bump version to 13.10.0 2026-03-10 08:10:33 +01:00
can1357 2a56458fa9 chore: bump version to 13.9.16 2026-03-10 07:45:20 +01:00
can1357 dc90bb15c0 chore: bump version to 13.9.15 2026-03-10 05:51:27 +01:00
can1357 8fe602173b chore: bump version to 13.9.14 2026-03-10 04:24:07 +01:00
can1357 d30d55119c chore: bump version to 13.9.13 2026-03-10 04:10:50 +01:00
can1357 6eb5b3fc59 chore: bump version to 13.9.12 2026-03-09 16:15:02 +01:00
can1357 bd23578f55 chore: bump version to 13.9.11 2026-03-08 16:36:37 +01:00
can1357 0462d9b88c chore(deps): removed redundant tsconfig.build.json files across packages
- Deleted tsconfig.build.json and tsconfig.check.json files that only extended the base tsconfig.json without adding configuration.
- Updated check:ts script to remove the unused packages/stats/tsconfig.client.json reference.
2026-03-08 16:31:57 +01:00
can1357 710cd638d6 chore: bump version to 13.9.10 2026-03-08 16:24:59 +01:00
can1357 005401e82a refactor: extracted fetch mocking into reusable hookFetch utility
- Extracted fetch mocking logic into reusable `hookFetch()` utility function with middleware-style handler pattern.
- Replaced manual `globalThis.fetch` assignment and restoration across 10 test files with `hookFetch()` calls using `using` statement for automatic cleanup.
- Implemented Disposable pattern with Symbol.dispose for fetch hook resource management, eliminating try-finally blocks.
- Exported `hookFetch` from utils public API to enable consistent fetch mocking across packages.
2026-03-08 16:16:54 +01:00
can1357 15547f73c6 chore: bump version to 13.9.8 2026-03-08 08:16:18 +01:00
can1357 d91540a1fa chore: bump version to 13.9.7 2026-03-08 04:49:35 +01:00
can1357 c3d83c2003 chore: bump version to 13.9.6 2026-03-08 03:41:22 +01:00
can1357 069d27423d chore: bump version to 13.9.5 2026-03-08 01:45:46 +01:00
can1357 aac0156476 chore: bump version to 13.9.4 2026-03-08 00:06:35 +01:00
can1357 f06fec1a2b chore: bump version to 13.9.3 2026-03-07 22:28:35 +01:00
can1357 bbe984ed5f chore: bump version to 13.9.2 2026-03-05 02:03:54 +01:00
can1357 ed65cf1f3e chore: bump version to 13.9.1 2026-03-05 01:33:51 +01:00
can1357 1e6cff1700 chore: bump version to 13.9.0 2026-03-05 01:19:05 +01:00
can1357 b495ed5174 chore: bump version to 13.8.0 2026-03-04 23:00:59 +01:00
can1357 b31548dadb chore: bump version to 13.7.9 2026-03-04 20:09:13 +01:00
can1357 af1a71baa8 chore: bump version to 13.7.8 2026-03-04 20:01:10 +01:00
can1357 0e1fd4db42 chore: bump version to 13.7.7 2026-03-04 19:14:30 +01:00
can1357 a1382eb7e9 chore: bump version to 13.7.6 2026-03-04 17:02:47 +01:00