pi-lazy-extensions 0.1.1 → 0.1.3
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.
- package/config.ts +4 -2
- package/index.ts +2 -2
- package/package.json +9 -9
package/config.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
11
|
+
import { CONFIG_DIR_NAME } from "@earendil-works/pi-coding-agent";
|
|
11
12
|
import type { LazyExtensionConfig, LazyExtensionsManifest, LazyExtensionsState, LoadedExtensionState } from "./types.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -26,8 +27,9 @@ export function loadManifest(cwd: string, agentDir: string): { manifest: LazyExt
|
|
|
26
27
|
if (manifest) return { manifest, path: resolve(envPath) };
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
// Project
|
|
30
|
-
|
|
30
|
+
// Project "dot-pi" dir (uses CONFIG_DIR_NAME so rebranded pi distributions
|
|
31
|
+
// use their configured config dir name instead of hardcoded .pi)
|
|
32
|
+
const projectPi = join(cwd, CONFIG_DIR_NAME, "lazy-extensions.json");
|
|
31
33
|
if (existsSync(projectPi)) {
|
|
32
34
|
const manifest = parseManifest(projectPi);
|
|
33
35
|
if (manifest) return { manifest, path: projectPi };
|
package/index.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 3. The `ext` proxy tool lets the LLM discover and activate extensions
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type
|
|
13
|
+
import { getAgentDir, type ExtensionAPI, type ExtensionContext, type ToolInfo } from "@earendil-works/pi-coding-agent";
|
|
14
14
|
import { Type } from "typebox";
|
|
15
15
|
import { loadManifest, buildState, getEagerExtensions } from "./config.js";
|
|
16
16
|
import { activateExtension, clearAllTimers, touchExtension } from "./registry.js";
|
|
@@ -28,7 +28,7 @@ export default function lazyExtensions(pi: ExtensionAPI) {
|
|
|
28
28
|
let lifecycleGeneration = 0;
|
|
29
29
|
|
|
30
30
|
const getPiTools = (): ToolInfo[] => pi.getAllTools();
|
|
31
|
-
const agentDir =
|
|
31
|
+
const agentDir = getAgentDir();
|
|
32
32
|
|
|
33
33
|
// Check for tool name collision before registering the proxy tool.
|
|
34
34
|
// Pi uses "first registration wins" — if another extension already
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-lazy-extensions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Lazy-load pi extensions on demand via a ToolSearch-style proxy tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,13 +34,6 @@
|
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@earendil-works/pi-coding-agent": ">=0.74.0"
|
|
36
36
|
},
|
|
37
|
-
"scripts": {
|
|
38
|
-
"test": "vitest run",
|
|
39
|
-
"test:watch": "vitest",
|
|
40
|
-
"test:coverage": "vitest run --coverage",
|
|
41
|
-
"typecheck": "tsc --noEmit",
|
|
42
|
-
"lint:dead": "knip --no-gitignore"
|
|
43
|
-
},
|
|
44
37
|
"devDependencies": {
|
|
45
38
|
"@commitlint/cli": "21.0.1",
|
|
46
39
|
"@commitlint/config-conventional": "21.0.1",
|
|
@@ -55,5 +48,12 @@
|
|
|
55
48
|
"fast-xml-builder": "1.2.0",
|
|
56
49
|
"protobufjs": "8.4.0",
|
|
57
50
|
"ws": "8.20.1"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"test:watch": "vitest",
|
|
55
|
+
"test:coverage": "vitest run --coverage",
|
|
56
|
+
"typecheck": "tsc --noEmit",
|
|
57
|
+
"lint:dead": "knip --no-gitignore"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|