pi-memory 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/LICENSE +21 -0
- package/README.md +213 -0
- package/index.ts +1099 -0
- package/package.json +53 -0
- package/scripts/postinstall.cjs +44 -0
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-memory",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Pi coding agent extension for memory with qmd-powered semantic search across daily logs, long-term memory, and scratchpad",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"pi",
|
|
9
|
+
"pi-coding-agent",
|
|
10
|
+
"memory",
|
|
11
|
+
"search",
|
|
12
|
+
"qmd",
|
|
13
|
+
"scratchpad",
|
|
14
|
+
"daily-log"
|
|
15
|
+
],
|
|
16
|
+
"author": "jayzeng",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/jayzeng/pi-memory.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/jayzeng/pi-memory/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/jayzeng/pi-memory#readme",
|
|
26
|
+
"files": [
|
|
27
|
+
"index.ts",
|
|
28
|
+
"scripts",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"postinstall": "node scripts/postinstall.cjs",
|
|
37
|
+
"build": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"lint": "eslint . --ext .ts,.tsx",
|
|
39
|
+
"test": "npx tsx test/e2e.ts"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
43
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
44
|
+
"eslint": "^9.0.0",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"tsx": "^4.0.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@mariozechner/pi-coding-agent": ">=0.0.1",
|
|
50
|
+
"@mariozechner/pi-ai": ">=0.0.1",
|
|
51
|
+
"@sinclair/typebox": ">=0.34.0"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const { spawnSync } = require("node:child_process");
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
|
|
4
|
+
function hasQmd() {
|
|
5
|
+
const result = spawnSync("qmd", ["status"], {
|
|
6
|
+
stdio: "ignore",
|
|
7
|
+
shell: process.platform === "win32",
|
|
8
|
+
});
|
|
9
|
+
return result.status === 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function memoryDir() {
|
|
13
|
+
const home = process.env.HOME ?? process.env.USERPROFILE ?? "~";
|
|
14
|
+
return path.join(home, ".pi", "agent", "memory");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function configureGitHooks() {
|
|
18
|
+
const result = spawnSync("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
19
|
+
stdio: "ignore",
|
|
20
|
+
shell: process.platform === "win32",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
if (result.status !== 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
spawnSync("git", ["config", "core.hooksPath", ".githooks"], {
|
|
28
|
+
stdio: "ignore",
|
|
29
|
+
shell: process.platform === "win32",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
configureGitHooks();
|
|
34
|
+
|
|
35
|
+
if (!hasQmd()) {
|
|
36
|
+
const dir = memoryDir();
|
|
37
|
+
console.log("\npi-memory: qmd not found (required for `memory_search`).\n");
|
|
38
|
+
console.log("Install qmd (requires Bun):");
|
|
39
|
+
console.log(" bun install -g https://github.com/tobi/qmd");
|
|
40
|
+
console.log(" # ensure ~/.bun/bin is in your PATH\n");
|
|
41
|
+
console.log("Then set up the collection (one-time):");
|
|
42
|
+
console.log(` qmd collection add ${dir} --name pi-memory`);
|
|
43
|
+
console.log(" qmd embed\n");
|
|
44
|
+
}
|