@seangle/pi-remember 0.2.0 → 0.3.0
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/CHANGELOG.md +41 -9
- package/README.md +149 -223
- package/dist/command.js +56 -0
- package/dist/context.js +57 -0
- package/dist/index.js +124 -0
- package/dist/tools.js +552 -0
- package/package.json +23 -24
- package/command.ts +0 -36
- package/index.ts +0 -751
- package/inject.ts +0 -45
- package/migration.ts +0 -458
- package/notes.ts +0 -131
- package/search.ts +0 -250
- package/store.ts +0 -730
- package/summary.ts +0 -70
- package/workspace.ts +0 -158
package/package.json
CHANGED
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seangle/pi-remember",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Portable plain-file memory for the Pi coding agent: facts, notes, stable memo IDs, lexical search, and a session snapshot.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Esensats",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Esensats/
|
|
9
|
+
"url": "git+https://github.com/Esensats/agents-remember.git",
|
|
10
|
+
"directory": "packages/pi"
|
|
10
11
|
},
|
|
11
|
-
"homepage": "https://github.com/Esensats/
|
|
12
|
+
"homepage": "https://github.com/Esensats/agents-remember/tree/main/packages/pi#readme",
|
|
12
13
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/Esensats/
|
|
14
|
+
"url": "https://github.com/Esensats/agents-remember/issues"
|
|
14
15
|
},
|
|
15
16
|
"keywords": ["pi-package", "pi-extension", "memory", "persistent-memory"],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"pi": {
|
|
23
|
+
"extensions": [
|
|
24
|
+
"./dist/index.js"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
16
27
|
"files": [
|
|
17
|
-
"
|
|
18
|
-
"command.ts",
|
|
19
|
-
"inject.ts",
|
|
20
|
-
"migration.ts",
|
|
21
|
-
"notes.ts",
|
|
22
|
-
"search.ts",
|
|
23
|
-
"store.ts",
|
|
24
|
-
"summary.ts",
|
|
25
|
-
"workspace.ts",
|
|
28
|
+
"dist",
|
|
26
29
|
"README.md",
|
|
27
30
|
"CHANGELOG.md",
|
|
28
31
|
"LICENSE"
|
|
29
32
|
],
|
|
30
|
-
"
|
|
31
|
-
"
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@seangle/remember-core": "^0.1.0",
|
|
35
|
+
"@seangle/remember-migrators": "^0.1.0"
|
|
32
36
|
},
|
|
33
37
|
"peerDependencies": {
|
|
34
38
|
"@earendil-works/pi-ai": "*",
|
|
35
39
|
"@earendil-works/pi-coding-agent": "*",
|
|
36
|
-
"@earendil-works/pi-tui": "*",
|
|
37
40
|
"typebox": "*"
|
|
38
41
|
},
|
|
39
42
|
"engines": {
|
|
40
43
|
"node": ">=22.15.0"
|
|
41
44
|
},
|
|
42
|
-
"publishConfig": {
|
|
43
|
-
"access": "public",
|
|
44
|
-
"registry": "https://registry.npmjs.org/"
|
|
45
|
-
},
|
|
46
|
-
"type": "module",
|
|
47
45
|
"scripts": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
46
|
+
"prepack": "node ../../scripts/build.mjs",
|
|
47
|
+
"build": "node ../../scripts/build.mjs",
|
|
48
|
+
"test": "node --test test/*.test.ts"
|
|
50
49
|
}
|
|
51
50
|
}
|
package/command.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
|
|
3
|
-
export const MEMORY_UPDATE_PROMPT = `Please review durable memory in light of this conversation and update it only where needed. This is an incremental memory reminder, not a request to overhaul or rewrite the memory collection.
|
|
4
|
-
|
|
5
|
-
- Use the available conversation context (including any compaction summary) to identify durable knowledge that will help in future sessions: established decisions, preferences, hard-won lessons, and confirmed project/server setup or operational details. Save important knowledge you have not already saved.
|
|
6
|
-
- Read the current memory with memory_read and use memory_search for relevant topics; read related notes as needed before changing anything. The injected snapshot may be incomplete. Avoid duplicates and preserve unrelated or still-correct information. Do not scan or rewrite every note just for completeness.
|
|
7
|
-
- Correct or remove information only when this conversation provides evidence that it is outdated or wrong; age alone or not mentioning it is not evidence. Make the smallest targeted changes. Use memory_forget with a specific identifying string for obsolete facts or notes (deletions are recoverable), memory_write for one-line facts, and memory_store for new detailed notes. For memos with IDs, read by ID and use memory_update to edit the relevant file in place instead of forgetting/recreating facts or creating redundant replacement notes; preserve identity, description and unrelated content. Notes carry their own frontmatter; supply only the revised Markdown body, including any body heading worth keeping. Store migration is automatic; do not manually recreate an index.
|
|
8
|
-
- Default to local memory in the current workdir, including server-specific knowledge when working in a context directory such as ~/ctx/server-ABC. When the user requests memory in another workspace, use its root on each tool call, including reads and recovery; root is the workspace directory, not its .pi directory. Use memory_status to inspect a store before initialization, and memory_init only when you intend to create local memory in that existing directory; do not initialize a workspace merely to make a search succeed. Global memory is only for user/machine-wide facts, not particular servers, software, repos, or configs. Keep MEMORY.md for one-line facts only; put detailed knowledge in standalone notes with concise descriptions and chosen filename slugs. The date is prepended automatically; descriptions are injected from frontmatter, not duplicated in MEMORY.md.
|
|
9
|
-
- Do not store secrets, credentials, temporary task state, todos, or a transcript/session recap. Work from already available evidence; this command does not authorize remote access or imply that past remote-access permission carries into future sessions.
|
|
10
|
-
- If nothing useful needs changing, leave memory untouched. Briefly report what you added, corrected, or removed, or say that no updates were needed.`;
|
|
11
|
-
|
|
12
|
-
export function registerMemoryCommand(
|
|
13
|
-
pi: Pick<ExtensionAPI, "registerCommand" | "sendUserMessage">,
|
|
14
|
-
buildStatusText: () => Promise<string>,
|
|
15
|
-
): void {
|
|
16
|
-
pi.registerCommand("memory", {
|
|
17
|
-
description: "Show memory status, or /memory update to review and incrementally update memory",
|
|
18
|
-
getArgumentCompletions: (prefix) =>
|
|
19
|
-
"update".startsWith(prefix)
|
|
20
|
-
? [{ value: "update", label: "update", description: "Review this conversation and update memory only if needed" }]
|
|
21
|
-
: null,
|
|
22
|
-
handler: async (args, ctx) => {
|
|
23
|
-
const subcommand = args.trim();
|
|
24
|
-
if (subcommand === "update") {
|
|
25
|
-
// Start a normal turn when idle; otherwise wait for the ongoing work.
|
|
26
|
-
pi.sendUserMessage(MEMORY_UPDATE_PROMPT, { deliverAs: "followUp" });
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (subcommand) {
|
|
30
|
-
ctx.ui.notify("Usage: /memory (status) or /memory update", "warning");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
ctx.ui.notify(await buildStatusText(), "info");
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|