pi-observational-memory-extension 0.1.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/LICENSE +21 -0
- package/README.md +100 -0
- package/extensions/index.ts +1400 -0
- package/package.json +29 -0
- package/scripts/validate.mjs +26 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-observational-memory-extension",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Mastra-style Observational Memory extension for Pi compaction and runtime context.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Nikita Nosov <20nik.nosov21@gmail.com>",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"keywords": ["pi-package", "pi", "pi-coding-agent", "observational-memory", "memory", "compaction"],
|
|
9
|
+
"files": ["extensions", "docs", "scripts", "README.md", "LICENSE", "CHANGELOG.md"],
|
|
10
|
+
"pi": { "extensions": ["./extensions"] },
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
13
|
+
"@earendil-works/pi-ai": "*",
|
|
14
|
+
"@earendil-works/pi-tui": "*"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@earendil-works/pi-coding-agent": "latest",
|
|
18
|
+
"@earendil-works/pi-ai": "latest",
|
|
19
|
+
"@earendil-works/pi-tui": "latest",
|
|
20
|
+
"@types/node": "^26.0.0",
|
|
21
|
+
"typescript": "latest"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"validate": "node scripts/validate.mjs",
|
|
26
|
+
"pack:check": "npm pack --dry-run",
|
|
27
|
+
"prepublishOnly": "npm run validate && npm run typecheck && npm run pack:check"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const root = path.resolve(new URL('..', import.meta.url).pathname);
|
|
5
|
+
const extensionsDir = path.join(root, 'extensions');
|
|
6
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
|
7
|
+
|
|
8
|
+
const errors = [];
|
|
9
|
+
|
|
10
|
+
function assert(condition, message) {
|
|
11
|
+
if (!condition) errors.push(message);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
assert(pkg.name === 'pi-observational-memory' || pkg.name === '@nik1t7n/pi-observational-memory' || pkg.name === 'pi-observational-memory-extension', 'package name must be valid');
|
|
15
|
+
assert(pkg.keywords?.includes('pi-package'), 'package must include pi-package keyword');
|
|
16
|
+
assert(pkg.pi?.extensions?.includes('./extensions'), 'package pi manifest must expose extensions');
|
|
17
|
+
|
|
18
|
+
const extFile = path.join(extensionsDir, 'index.ts');
|
|
19
|
+
assert(fs.existsSync(extFile), 'extensions/index.ts must exist');
|
|
20
|
+
|
|
21
|
+
if (errors.length) {
|
|
22
|
+
console.error(errors.map((e) => `- ${e}`).join('\n'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.log(`Validated extension index for ${pkg.name}@${pkg.version}`);
|