@pi-unipi/memory 0.1.0 → 0.1.1

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/index.ts +48 -0
  2. package/package.json +9 -4
package/index.ts CHANGED
@@ -14,6 +14,12 @@ import {
14
14
  emitEvent,
15
15
  getPackageVersion,
16
16
  } from "@unipi/core";
17
+
18
+ // Get info registry from global (avoids direct import issues with pi's extension loading)
19
+ function getInfoRegistry() {
20
+ const g = globalThis as any;
21
+ return g.__unipi_info_registry;
22
+ }
17
23
  import {
18
24
  MemoryStorage,
19
25
  getProjectName,
@@ -82,6 +88,48 @@ export default function (pi: ExtensionAPI) {
82
88
  ],
83
89
  });
84
90
 
91
+ // Register info group
92
+ const registry = getInfoRegistry();
93
+ if (registry) {
94
+ console.debug("[memory] Registering info group");
95
+ registry.registerGroup({
96
+ id: "memory",
97
+ name: "Memory",
98
+ icon: "🧠",
99
+ priority: 60,
100
+ config: {
101
+ showByDefault: true,
102
+ stats: [
103
+ { id: "projectCount", label: "Project Memories", show: true },
104
+ { id: "totalCount", label: "Total Memories", show: true },
105
+ { id: "projects", label: "Projects", show: true },
106
+ ],
107
+ },
108
+ dataProvider: async () => {
109
+ if (!projectStorage) {
110
+ return {
111
+ projectCount: { value: "0" },
112
+ totalCount: { value: "0" },
113
+ projects: { value: "none" },
114
+ };
115
+ }
116
+
117
+ const projectMemories = projectStorage.listAll();
118
+ const allMemories = listAllProjects();
119
+ const uniqueProjects = [...new Set(allMemories.map((m) => m.project))];
120
+
121
+ return {
122
+ projectCount: { value: String(projectMemories.length) },
123
+ totalCount: { value: String(allMemories.length) },
124
+ projects: {
125
+ value: uniqueProjects.length.toString(),
126
+ detail: uniqueProjects.slice(0, 5).join(", ") + (uniqueProjects.length > 5 ? ` +${uniqueProjects.length - 5} more` : ""),
127
+ },
128
+ };
129
+ },
130
+ });
131
+ }
132
+
85
133
  // Show memory status in UI
86
134
  if (ctx.hasUI) {
87
135
  const projectCount = projectStorage.listAll().length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/memory",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Persistent cross-session memory with vector search for Pi coding agent",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,8 +24,12 @@
24
24
  "sqlite-vec"
25
25
  ],
26
26
  "pi": {
27
- "extensions": ["index.ts"],
28
- "skills": ["skills"]
27
+ "extensions": [
28
+ "index.ts"
29
+ ],
30
+ "skills": [
31
+ "skills"
32
+ ]
29
33
  },
30
34
  "files": [
31
35
  "index.ts",
@@ -41,7 +45,8 @@
41
45
  "better-sqlite3": "^12.9.0",
42
46
  "sqlite-vec": "^0.1.9",
43
47
  "js-yaml": "^4.1.0",
44
- "@unipi/core": "*"
48
+ "@unipi/core": "*",
49
+ "@pi-unipi/info-screen": "*"
45
50
  },
46
51
  "peerDependencies": {
47
52
  "@mariozechner/pi-coding-agent": "*",