@oh-my-pi/pi-utils 14.5.13 → 14.6.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 +2 -2
  2. package/src/dirs.ts +20 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "14.5.13",
4
+ "version": "14.6.0",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/bun": "^1.3",
41
- "@oh-my-pi/pi-natives": "14.5.13"
41
+ "@oh-my-pi/pi-natives": "14.6.0"
42
42
  },
43
43
  "engines": {
44
44
  "bun": ">=1.3.7"
package/src/dirs.ts CHANGED
@@ -311,6 +311,26 @@ export function getStatsDbPath(): string {
311
311
  return dirs.rootSubdir("stats.db", "data");
312
312
  }
313
313
 
314
+ /** Get the autoresearch state directory (~/.omp/autoresearch). */
315
+ export function getAutoresearchDir(): string {
316
+ return dirs.rootSubdir("autoresearch", "state");
317
+ }
318
+
319
+ /** Get the per-project autoresearch state directory (~/.omp/autoresearch/<encoded-project>). */
320
+ export function getAutoresearchProjectDir(encodedProject: string): string {
321
+ return path.join(getAutoresearchDir(), encodedProject);
322
+ }
323
+
324
+ /** Get the per-project autoresearch SQLite database path (~/.omp/autoresearch/<encoded-project>.db). */
325
+ export function getAutoresearchDbPath(encodedProject: string): string {
326
+ return path.join(getAutoresearchDir(), `${encodedProject}.db`);
327
+ }
328
+
329
+ /** Get the per-run artifact directory (~/.omp/autoresearch/<encoded-project>/runs/<runId>). */
330
+ export function getAutoresearchRunDir(encodedProject: string, runId: number): string {
331
+ return path.join(getAutoresearchProjectDir(encodedProject), "runs", String(runId).padStart(4, "0"));
332
+ }
333
+
314
334
  // =============================================================================
315
335
  // Agent subdirectories (~/.omp/agent/*)
316
336
  // =============================================================================