@xynogen/pix-core 0.7.8 → 0.7.10
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/package.json +4 -4
- package/src/defer-tools.ts +11 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"description": "Pi extension bundle \u2014 installs and activates all core pix-* extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/extension.ts",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xynogen/pix-runtime": "^0.15.
|
|
46
|
+
"@xynogen/pix-runtime": "^0.15.1",
|
|
47
47
|
"@xynogen/pix-data": "^0.5.6",
|
|
48
|
-
"@xynogen/pix-pretty": "^1.
|
|
48
|
+
"@xynogen/pix-pretty": "^1.33.1",
|
|
49
49
|
"@xynogen/pix-welcome": "^0.2.9",
|
|
50
50
|
"@xynogen/pix-footer": "^0.2.12",
|
|
51
51
|
"@xynogen/pix-diagnostics": "^0.4.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@xynogen/pix-models": "^0.4.3",
|
|
56
56
|
"@xynogen/pix-update": "^0.2.7",
|
|
57
57
|
"@xynogen/pix-commands": "^0.6.11",
|
|
58
|
-
"@xynogen/pix-nudge": "^0.3.
|
|
58
|
+
"@xynogen/pix-nudge": "^0.3.6",
|
|
59
59
|
"@xynogen/pix-read": "^0.4.6",
|
|
60
60
|
"@xynogen/pix-write": "^0.2.11",
|
|
61
61
|
"@xynogen/pix-edit": "^0.2.12",
|
package/src/defer-tools.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Keep the prompt lean: only the
|
|
2
|
+
* Keep the prompt lean: only the always-on tools are declared up front. Every other
|
|
3
3
|
* `direct` tool a bundled member registers becomes `deferred`, and `tool_search`
|
|
4
4
|
* is activated so the model can find and load them on demand.
|
|
5
5
|
*
|
|
@@ -10,32 +10,31 @@
|
|
|
10
10
|
|
|
11
11
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
12
|
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
export const CORE_TOOLS: ReadonlySet<string> = new Set([
|
|
13
|
+
// Always-on tools. Keep in sync with pix-toolbox `ALWAYS_ON_TOOLS`.
|
|
14
|
+
export const ALWAYS_ON_TOOLS: ReadonlySet<string> = new Set([
|
|
16
15
|
"read",
|
|
17
16
|
"bash",
|
|
18
17
|
"edit",
|
|
19
18
|
"write",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"tool_search",
|
|
20
|
+
"codemode",
|
|
22
21
|
]);
|
|
23
|
-
|
|
22
|
+
// Pi registers these inactive. Without them, deferred tools are unreachable.
|
|
23
|
+
const ACTIVATE_ON_START = ["tool_search", "codemode"];
|
|
24
24
|
|
|
25
25
|
export default function deferNonCoreTools(pi: ExtensionAPI): void {
|
|
26
26
|
const register = pi.registerTool.bind(pi);
|
|
27
27
|
pi.registerTool = (tool) =>
|
|
28
28
|
register(
|
|
29
|
-
|
|
29
|
+
ALWAYS_ON_TOOLS.has(tool.name) || (tool.exposure ?? "direct") !== "direct"
|
|
30
30
|
? tool
|
|
31
31
|
: { ...tool, exposure: "deferred" },
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
// Pi registers tool_search inactive. Without it, deferred tools are unreachable.
|
|
35
34
|
pi.on("session_start", () => {
|
|
36
35
|
const active = pi.getActiveTools();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
pi.setActiveTools([...active,
|
|
36
|
+
const registered = new Set(pi.getAllTools().map((t) => t.name));
|
|
37
|
+
const missing = ACTIVATE_ON_START.filter((n) => registered.has(n) && !active.includes(n));
|
|
38
|
+
if (missing.length) pi.setActiveTools([...active, ...missing]);
|
|
40
39
|
});
|
|
41
40
|
}
|