pi-mega-compact 0.4.11 → 0.4.12
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 +28 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,50 +111,45 @@ OpenAI-style contract and the `MEGACOMPACT_EMBEDDING_KEY` / `MEGACOMPACT_EMBEDDI
|
|
|
111
111
|
### Requirements
|
|
112
112
|
|
|
113
113
|
- **Node >= 18**
|
|
114
|
-
-
|
|
114
|
+
- install builds the **`better-sqlite3`** native module (one-time, local
|
|
115
115
|
compile). No network call and no API key are needed at runtime.
|
|
116
|
-
- A pi coding agent install
|
|
116
|
+
- A pi coding agent install with package support (`pi install` / `pi update
|
|
117
|
+
--extensions`). npm-installed packages are auto-discovered via the package's
|
|
118
|
+
`pi` manifest entry; local checkouts load from `~/.pi/agent/extensions/`.
|
|
117
119
|
|
|
118
120
|
### Install from npm (recommended)
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
npm
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
This places the package in `node_modules` and exposes the extension entry at
|
|
125
|
-
`node_modules/pi-mega-compact/extensions/mega-compact.ts`. Then point pi at it
|
|
126
|
-
(see "Register with pi" below).
|
|
127
|
-
|
|
128
|
-
### Register with pi
|
|
129
|
-
|
|
130
|
-
Add the extension to your pi config's `pi.extensions` list, pointing at the
|
|
131
|
-
installed entry (npm path or a symlink into pi's extensions dir — either works):
|
|
132
|
-
|
|
133
|
-
```jsonc
|
|
134
|
-
{
|
|
135
|
-
"pi": {
|
|
136
|
-
"extensions": ["pi-mega-compact/extensions/mega-compact.ts"]
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Or symlink the installed package into pi's extensions dir (the simplest path if
|
|
142
|
-
you run pi from the same machine):
|
|
122
|
+
pi installs extensions as **packages**. `pi install npm:<pkg>` writes an
|
|
123
|
+
`npm:` source into your pi config's `packages` array; pi then auto-discovers the
|
|
124
|
+
extension from the package's own `"pi": { "extensions": [...] }` manifest entry
|
|
125
|
+
— **no manual `settings.json` edit is needed**.
|
|
143
126
|
|
|
144
127
|
```bash
|
|
145
|
-
|
|
128
|
+
pi install npm:pi-mega-compact # first time: adds to packages + installs
|
|
129
|
+
pi update --extensions # thereafter: pulls the latest published version
|
|
146
130
|
```
|
|
147
131
|
|
|
148
|
-
|
|
149
|
-
|
|
132
|
+
`pi update --extensions` refreshes every `npm:` entry in `packages` (including on
|
|
133
|
+
other devices that share this config). The package ships both the TypeScript
|
|
134
|
+
source (which pi loads directly) and the compiled `dist/`, so nothing else needs
|
|
135
|
+
building.
|
|
136
|
+
|
|
137
|
+
> **Tip — keep the spec unpinned.** Use `npm:pi-mega-compact`, not
|
|
138
|
+
> `npm:pi-mega-compact@0.4.11`. Version-pinned specs are *skipped* by
|
|
139
|
+
> `pi update --extensions`, so a pin would freeze you on that release.
|
|
140
|
+
|
|
141
|
+
> **From a git checkout (development only).** To hack on the extension, clone and
|
|
142
|
+
> build locally, then symlink it into pi's extensions dir — but this bypasses the
|
|
143
|
+
> package manager, so it is NOT updated by `pi update --extensions`. Convert to the
|
|
144
|
+
> npm package (above) before shipping. The bundled `./install.sh` helper does the
|
|
145
|
+
> symlink + config edit (needs `jq`).
|
|
146
|
+
>
|
|
150
147
|
> ```bash
|
|
151
148
|
> git clone https://github.com/TheArchitectit/pi-mega-compact.git \
|
|
152
149
|
> ~/.pi/agent/extensions/pi-mega-compact
|
|
153
150
|
> cd ~/.pi/agent/extensions/pi-mega-compact
|
|
154
151
|
> npm install && npm run build
|
|
155
152
|
> ```
|
|
156
|
-
> The bundled `./install.sh` helper (`copy`) / `./install.sh -s` (`symlink`) does
|
|
157
|
-
> the same and also registers the path in pi's config (needs `jq`).
|
|
158
153
|
|
|
159
154
|
### Verify
|
|
160
155
|
|
|
@@ -166,17 +161,17 @@ npm run lint # tsc --noEmit + guardrails scan clean
|
|
|
166
161
|
### Uninstall
|
|
167
162
|
|
|
168
163
|
```bash
|
|
164
|
+
pi uninstall npm:pi-mega-compact # removes from settings.packages + the npm tree
|
|
165
|
+
# or, to keep the config entry but drop the package:
|
|
169
166
|
npm uninstall pi-mega-compact
|
|
170
167
|
```
|
|
171
168
|
|
|
172
|
-
If you symlinked it into pi's extensions dir, also remove that link:
|
|
169
|
+
If you symlinked it into pi's extensions dir (dev only), also remove that link:
|
|
173
170
|
|
|
174
171
|
```bash
|
|
175
172
|
rm -f ~/.pi/agent/extensions/pi-mega-compact
|
|
176
173
|
```
|
|
177
174
|
|
|
178
|
-
Then remove the path from pi's `pi.extensions` array.
|
|
179
|
-
|
|
180
175
|
---
|
|
181
176
|
|
|
182
177
|
## How to use it
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mega-compact",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD-2-Clause",
|