Skip to content
This repository was archived by the owner on Sep 8, 2026. It is now read-only.

Replace custom extensions with published Pi packages - #1

Merged
turisanapo merged 3 commits into
mainfrom
replace-extensions-with-packages
Jul 2, 2026
Merged

turisanapo merged 3 commits into
mainfrom
replace-extensions-with-packages

Conversation

@turisanapo

@turisanapo turisanapo commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replaces the two local extensions with their published package equivalents, installed project-locally and declared in .pi/settings.json (Pi restores missing packages automatically on startup):

  • manage-history.ts → @8monkey/pi-context-history — same four context-management features, plus new /compact-session, /add-user-message, and /add-assistant-message commands
  • register-mcp-tools.ts → pi-mcp-adapter — full MCP client with lazy lifecycles, OAuth, and a proxy tool; directTools: true keeps the current per-tool registration behavior

Also adds @8monkey/pi-session-gzip, which compresses closed session files on shutdown and provides /resume-compressed to reopen them.

🤖 Generated with Claude Code

Swap the local manage-history and register-mcp-tools extensions for
npm:@8monkey/pi-context-history and npm:pi-mcp-adapter, installed
project-locally and declared in .pi/settings.json so Pi restores them
automatically on startup.

- rename GATO_* env flags to the packages' PI_* equivalents
- move the summary prompt to .pi/prompts/compact.md (package override path)
- MCP servers now configured in .pi/mcp.json (adapter's project override)
- drop tsconfig, oxlint, and the typecheck/lint scripts — no local TS left
- unwrap hard-wrapped README paragraphs to one line each

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR migrates the Gato project from local .pi/extensions/ TypeScript files to installed Pi packages (@8monkey/pi-context-history, pi-mcp-adapter). It removes extension source files, TypeScript/lint tooling, renames GATO_* env vars to PI_*, adds new feature-flag toggles, and updates documentation, .gitignore, lefthook.yml, and package.json accordingly.

Changes

Pi package migration

Layer / File(s) Summary
Pi package configuration and environment variables
.pi/settings.json, .env.template, .gitignore
Adds packages list to settings.json, renames GATO_HISTORY_DAYS/GATO_SUMMARY_STALENESS_DAYS to PI_HISTORY_DAYS/PI_COMPACT_STALENESS_DAYS, adds PI_TRIM_HISTORY, PI_STRIP_TOOL_HISTORY, PI_COMPACT, PI_APPEND_MESSAGE toggles, and ignores .pi/npm.
Build/lint tooling and extension removal
package.json, lefthook.yml, tsconfig.json, .oxlintrc.json, .pi/extensions/*
Removes lint/typecheck scripts and TS/oxlint dependencies, simplifies pre-commit hook to formatting only, deletes tsconfig.json/.oxlintrc.json, and removes local extension implementations (filter-history.ts, generate-summary.ts, inject-system-prompt.ts, lib/helpers.ts, register-mcp-tools.ts).
Documentation updates
.claude/CLAUDE.md, README.md
Rewrites CLAUDE.md to describe the Pi-package architecture, installed packages, conventions, commands, and workflow; updates README's features, quick start, mcp.json example, configuration table, and customizing sections to reflect PI_* variables and package-driven behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing local custom extensions with published Pi packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch replace-extensions-with-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

turisanapo and others added 2 commits July 2, 2026 11:35
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Compresses closed session files on shutdown; /resume-compressed
restores and reopens them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.pi/settings.json (1)

7-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the Pi package specs in .pi/settings.json
The current bare npm: entries track the latest release on each fresh install; add explicit versions or semver ranges if you want reproducible restores.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.pi/settings.json around lines 7 - 8, The package specs in the settings
configuration are currently unpinned, so fresh installs can pull different
releases over time. Update the `packages` entries in `.pi/settings.json` to use
explicit versions or stable semver ranges for the Pi dependencies
(`@8monkey/pi-context-history` and `pi-mcp-adapter`) while keeping the existing
`steeringMode` setting unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.pi/settings.json:
- Around line 7-8: The package specs in the settings configuration are currently
unpinned, so fresh installs can pull different releases over time. Update the
`packages` entries in `.pi/settings.json` to use explicit versions or stable
semver ranges for the Pi dependencies (`@8monkey/pi-context-history` and
`pi-mcp-adapter`) while keeping the existing `steeringMode` setting unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17a98588-c4d5-4c57-a482-3b4be9ea84cd

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9c475 and f7050d1.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .claude/CLAUDE.md
  • .env.template
  • .gitignore
  • .oxlintrc.json
  • .pi/extensions/filter-history.ts
  • .pi/extensions/generate-summary.ts
  • .pi/extensions/inject-system-prompt.ts
  • .pi/extensions/lib/helpers.ts
  • .pi/extensions/register-mcp-tools.ts
  • .pi/prompts/compact.md
  • .pi/settings.json
  • README.md
  • lefthook.yml
  • package.json
  • tsconfig.json
💤 Files with no reviewable changes (8)
  • lefthook.yml
  • .pi/extensions/register-mcp-tools.ts
  • .pi/extensions/inject-system-prompt.ts
  • .oxlintrc.json
  • tsconfig.json
  • .pi/extensions/lib/helpers.ts
  • .pi/extensions/generate-summary.ts
  • .pi/extensions/filter-history.ts

@turisanapo
turisanapo merged commit 033e4eb into main Jul 2, 2026
1 check passed
@turisanapo
turisanapo deleted the replace-extensions-with-packages branch July 2, 2026 10:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant