pi-runline 0.14.0 → 0.15.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.
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
3
  import { Markdown, Text } from "@mariozechner/pi-tui";
3
4
  import { Type } from "@sinclair/typebox";
@@ -23,15 +24,21 @@ function filterByAllowlist<T extends { name?: string; plugin?: string }>(
23
24
  const runlineCache = new Map<string, Promise<Runline>>();
24
25
 
25
26
  async function getRunline(cwd: string): Promise<Runline> {
26
- let pending = runlineCache.get(cwd);
27
+ const runlineDir = findRunlineDir(cwd);
28
+ if (!runlineDir) {
29
+ throw new Error("No .runline/ found — run `runline init` first");
30
+ }
31
+
32
+ const projectDir = path.dirname(runlineDir);
33
+ let pending = runlineCache.get(projectDir);
27
34
  if (!pending) {
28
- pending = Runline.fromProject(cwd).then((rl) => {
29
- if (!rl) throw new Error("No .runline/ found — run `runline init` first");
35
+ pending = Runline.fromProject(projectDir).then((rl) => {
36
+ if (!rl) throw new Error("Failed to load the resolved .runline/ project");
30
37
  return rl;
31
38
  });
32
39
  // Drop failed loads so the next call retries instead of caching the error.
33
- pending.catch(() => runlineCache.delete(cwd));
34
- runlineCache.set(cwd, pending);
40
+ pending.catch(() => runlineCache.delete(projectDir));
41
+ runlineCache.set(projectDir, pending);
35
42
  }
36
43
  return pending;
37
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-runline",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Code mode for pi",
5
5
  "type": "commonjs",
6
6
  "keywords": [
@@ -22,7 +22,7 @@
22
22
  "lint:fix": "biome check --write extensions/"
23
23
  },
24
24
  "dependencies": {
25
- "runline": "^0.14.0"
25
+ "runline": "^0.15.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@mariozechner/pi-coding-agent": "*",