@xynogen/pix-core 0.7.9 → 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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. 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.9",
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",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@xynogen/pix-runtime": "^0.15.1",
47
47
  "@xynogen/pix-data": "^0.5.6",
48
- "@xynogen/pix-pretty": "^1.33.0",
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",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Keep the prompt lean: only the core tools are declared up front. Every other
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
- // grep/find stay direct: pix-nudge steers bash cat/grep/find toward them, and a
14
- // tool_search round-trip for the most common lookups costs more than their schemas.
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
- "grep",
21
- "find",
19
+ "tool_search",
20
+ "codemode",
22
21
  ]);
23
- const TOOL_SEARCH = "tool_search";
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
- CORE_TOOLS.has(tool.name) || (tool.exposure ?? "direct") !== "direct"
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
- if (active.includes(TOOL_SEARCH)) return;
38
- if (!pi.getAllTools().some((t) => t.name === TOOL_SEARCH)) return;
39
- pi.setActiveTools([...active, TOOL_SEARCH]);
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
  }