@oh-my-pi/pi-utils 13.10.0 → 13.11.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/dirs.ts +11 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "13.10.0",
4
+ "version": "13.11.0",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
package/src/dirs.ts CHANGED
@@ -54,9 +54,19 @@ export function setProjectDir(dir: string): void {
54
54
  process.chdir(projectDir);
55
55
  }
56
56
 
57
+ /** Get the config directory name relative to home (e.g. ".omp" or PI_CONFIG_DIR override). */
58
+ export function getConfigDirName(): string {
59
+ return process.env.PI_CONFIG_DIR || CONFIG_DIR_NAME;
60
+ }
61
+
62
+ /** Get the config agent directory name relative to home (e.g. ".omp/agent" or PI_CONFIG_DIR + "/agent"). */
63
+ export function getConfigAgentDirName(): string {
64
+ return `${getConfigDirName()}/agent`;
65
+ }
66
+
57
67
  /** Get the config root directory (~/.omp). */
58
68
  export function getConfigRootDir(): string {
59
- return path.join(os.homedir(), process.env.PI_CONFIG_DIR || CONFIG_DIR_NAME);
69
+ return path.join(os.homedir(), getConfigDirName());
60
70
  }
61
71
 
62
72
  let agentDir = process.env.PI_CODING_AGENT_DIR || path.join(getConfigRootDir(), "agent");