pi-skill-search 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -21,10 +21,12 @@ Result: **~97% token reduction** in skill-related system prompt content.
21
21
  npx pi install .
22
22
 
23
23
  # Or from npm (when published)
24
- npm install pi-skill-search
24
+ npx pi install pi-skill-search
25
25
  ```
26
26
 
27
- The `install.mjs` script automatically sets up the `skill-search` skill in `~/.pi/agent/skills/` so Pi can discover it.
27
+ After installation, the extension automatically:
28
+ 1. Sets up the `skill-search` skill in `~/.pi/agent/skills/` (via `postinstall` script)
29
+ 2. Registers the `skill-search` tool and category summary for all Pi sessions
28
30
 
29
31
  ## Quick Start
30
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-skill-search",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "On-demand skill search extension for Pi — replaces inject-all with search tool + category summary",
5
5
  "type": "module",
6
6
  "types": "index.ts",
@@ -21,6 +21,8 @@
21
21
  "@types/js-yaml": "^4.0.0"
22
22
  },
23
23
  "scripts": {
24
+ "install:skill": "node install.mjs",
25
+ "postinstall": "node install.mjs",
24
26
  "check": "biome check . && tsc --noEmit",
25
27
  "test": "tsx node_modules/vitest/dist/cli.js --run",
26
28
  "test:watch": "tsx node_modules/vitest/dist/cli.js",
package/src/scanner.ts CHANGED
@@ -81,9 +81,7 @@ export function scanSkillDirectory(dir: string): PiSkill[] {
81
81
  * 3. <global-npm>/pi-skill-search/data/ (global install + sibling data)
82
82
  */
83
83
  export function findCorpusPath(): string | undefined {
84
- const thisFile = path.dirname(
85
- new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1"),
86
- );
84
+ const thisFile = path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1"));
87
85
  const extRoot = path.basename(thisFile) === "src" ? path.dirname(thisFile) : thisFile;
88
86
 
89
87
  // 1. Check ext-root/data/
@@ -107,7 +105,7 @@ export function findCorpusPath(): string | undefined {
107
105
 
108
106
  // 3. Try global npm root
109
107
  try {
110
- const { execSync } = require("child_process");
108
+ const { execSync } = require("node:child_process");
111
109
  const globalRoot = execSync("npm root -g", { encoding: "utf-8" }).trim();
112
110
  for (const pkgName of ["pi-skill-search", "pss-corpus", "pss-data"]) {
113
111
  const globalPath = path.join(globalRoot, pkgName, "data");
@@ -126,8 +124,6 @@ export function findCorpusPath(): string | undefined {
126
124
  * Resolve extension root — thu muc chua index.ts cua extension.
127
125
  */
128
126
  export function resolveExtensionRoot(): string {
129
- const thisFile = path.dirname(
130
- new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1"),
131
- );
127
+ const thisFile = path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1"));
132
128
  return path.basename(thisFile) === "src" ? path.dirname(thisFile) : thisFile;
133
- }
129
+ }