Skip to content

Commit 0bc1f4a

Browse files
Abiola BakareAbiola Bakare
authored andcommitted
fix: install reliability for pi install git:... flow
- Replace pi-memory-setup references with npm run setup (bin not globally linked after git install) - Remove unused @sinclair/typebox peerDependency - Add Pi coding agent prerequisite callout to README - Remove redundant npm install step in CI (postinstall was double-compiling) - Fix stale /usr/local/bin reference in C source comment - Fix Makefile install target to use ~/.pi/memory/ instead of /usr/local/bin - Remove npm install step from CONTRIBUTING.md (no deps exist) - Minor doc alignment across INSTALL.md, RELEASING.md, SKILL.md
1 parent 0d1e596 commit 0bc1f4a

12 files changed

Lines changed: 50 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ jobs:
2222
if: runner.os == 'Linux'
2323
run: sudo apt-get update && sudo apt-get install -y sqlite3 libsqlite3-dev
2424

25-
- name: Install deps
26-
run: npm install
27-
28-
- name: Build/setup
25+
- name: Build native binary
2926
run: npm run setup
3027

3128
- name: Doctor

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ Thanks for contributing to Pi-Memory.
1111
## Local dev
1212

1313
```bash
14-
npm install
1514
npm run setup
1615
npm run doctor
1716
npm run test:smoke
1817
```
1918

19+
> There are no npm dependencies to install — the core is compiled C and the extension runs inside Pi's runtime. `npm run setup` compiles the native binary.
20+
2021
## Repo structure
2122

2223
- `native/` — C source + makefile

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Pi-Memory (v2)
22

3+
> **Pi extension** — requires the [Pi coding agent](https://github.com/badlogic/pi-mono) (`@mariozechner/pi-coding-agent`).
4+
> Install Pi first, then add Pi-Memory as a package.
5+
36
Durable memory for Pi agents, built for **low-overhead reliability**:
47
- **C core** (`native/pi-memory.c`) for speed + minimal runtime surface
58
- **TypeScript extension** (`extensions/pi-memory-compact.ts`) for Pi lifecycle automation
@@ -21,7 +24,7 @@ That keeps startup fast, failure modes simple, and behavior predictable.
2124

2225
---
2326

24-
## Three-layer memory model (C + TS + DB + markdown bridge)
27+
## Three-layer memory model
2528

2629
Pi-Memory is designed as a layered system where each layer has a different job:
2730

docs/INSTALL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Install Guide
22

3+
## Platform support
4+
5+
- **macOS** and **Linux** are supported.
6+
- **Windows** is not currently supported (no native build target).
7+
38
## Prerequisites
49

510
- Pi installed (`pi` CLI)
611
- C compiler (`cc`/`clang`/`gcc`)
7-
- SQLite development headers (`sqlite3` + `libsqlite3-dev` on Linux)
12+
- SQLite development headers (`sqlite3` + `libsqlite3-dev` on Linux; included with Xcode CLI tools on macOS)
813

914
## Option A (recommended): single Pi command
1015

docs/RELEASING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
git tag vX.Y.Z
2222
git push origin main --tags
2323
```
24-
5. Publish to npm:
24+
5. (When npm publishing is live) Publish to npm:
2525
```bash
2626
npm publish --access public
2727
```
2828

29+
> npm/bun publish is planned but not currently live. For now, users install via `pi install git:github.com/SiliconState/Pi-Memory`.
30+
2931
## Post-release checks
3032

31-
- `pi install npm:@siliconstate/pi-memory@X.Y.Z`
33+
- `pi install git:github.com/SiliconState/Pi-Memory` (primary install path)
3234
- `~/.pi/memory/pi-memory --version`
3335
- verify extension hooks and ingest path in a real Pi session

extensions/pi-memory-compact.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,12 @@ export default function (pi: ExtensionAPI) {
574574

575575
const project = getProjectKey(ctx.cwd);
576576
try {
577-
await pi.exec(
578-
"pi-memory",
579-
[
580-
"state",
581-
project,
582-
"--summary",
583-
`Auto-compacting at ${Math.round(ratio * 100)}% context usage`,
584-
],
585-
{ timeout: 5000 }
586-
);
577+
await execPiMemory(pi, [
578+
"state",
579+
project,
580+
"--summary",
581+
`Auto-compacting at ${Math.round(ratio * 100)}% context usage`,
582+
], { timeout: 5000 });
587583
} catch {
588584
// Non-fatal
589585
}

native/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
# pi-memory build
22
#
33
# Build: make
4-
# Install: make install
4+
# Install: make install (installs to ~/.pi/memory/pi-memory)
55
# Clean: make clean
66

77
CC = cc
88
CFLAGS = -Wall -Wextra -Wpedantic -O2 -std=c11
99
LDFLAGS = -lsqlite3
1010
TARGET = pi-memory
1111
SRC = pi-memory.c
12-
INSTALL = /usr/local/bin
12+
INSTALL_DIR = $(HOME)/.pi/memory
1313

1414
$(TARGET): $(SRC)
1515
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LDFLAGS)
1616

1717
install: $(TARGET)
18-
cp $(TARGET) $(INSTALL)/$(TARGET)
19-
@echo "installed -> $(INSTALL)/$(TARGET)"
18+
mkdir -p $(INSTALL_DIR)
19+
cp $(TARGET) $(INSTALL_DIR)/$(TARGET)
20+
chmod +x $(INSTALL_DIR)/$(TARGET)
21+
@echo "installed -> $(INSTALL_DIR)/$(TARGET)"
2022

2123
uninstall:
22-
rm -f $(INSTALL)/$(TARGET)
23-
@echo "removed $(INSTALL)/$(TARGET)"
24+
rm -f $(INSTALL_DIR)/$(TARGET)
25+
@echo "removed $(INSTALL_DIR)/$(TARGET)"
2426

2527
clean:
2628
rm -f $(TARGET)

native/pi-memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Single binary. Works 6 months from now. Works 6 years from now.
1010
*
1111
* Build: make
12-
* Install: make install (copies to /usr/local/bin)
12+
* Install: make install (copies to ~/.pi/memory/pi-memory)
1313
*
1414
* Usage:
1515
* pi-memory log decision <title> --choice <str> [--context <str>]

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@
5353
],
5454
"peerDependencies": {
5555
"@mariozechner/pi-ai": "*",
56-
"@mariozechner/pi-coding-agent": "*",
57-
"@sinclair/typebox": "*"
56+
"@mariozechner/pi-coding-agent": "*"
5857
},
5958
"peerDependenciesMeta": {
6059
"@mariozechner/pi-ai": { "optional": true },
61-
"@mariozechner/pi-coding-agent": { "optional": true },
62-
"@sinclair/typebox": { "optional": true }
60+
"@mariozechner/pi-coding-agent": { "optional": true }
6361
},
6462
"pi": {
6563
"extensions": [

scripts/doctor.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ for (const c of checks) {
4949
}
5050

5151
if (failed.length) {
52-
console.log("\nRun: pi-memory-setup");
52+
console.log("\nRun: npm run setup");
53+
console.log("from the pi-memory package directory (typically ~/.pi/agent/git/github.com/SiliconState/Pi-Memory).");
5354
process.exit(1);
5455
}
5556

0 commit comments

Comments
 (0)