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

Migrate to pi v0.35.0 extensions API#4

Merged
zedrdave merged 1 commit intomainfrom
feature/extensions-api-migration
Jan 6, 2026
Merged

Migrate to pi v0.35.0 extensions API#4
zedrdave merged 1 commit intomainfrom
feature/extensions-api-migration

Conversation

@zedrdave
Copy link
Copy Markdown
Member

@zedrdave zedrdave commented Jan 6, 2026

Summary

Migrates @qualisero/pi-agent-scip to the new unified extensions API introduced in pi-coding-agent v0.35.0.

Breaking Changes

  • Requires pi-coding-agent >= 0.35.0
  • Installation path changed: ~/.pi/agent/tools/ → ~/.pi/agent/extensions/
  • Unified extension system replaces separate hooks and custom tools

Changes

Core Architecture

  • Merged hook.ts and tools.ts into extension.ts: Single unified extension using the new ExtensionAPI
  • Updated to ExtensionAPI: Replaces the old HookAPI + CustomToolFactory pattern
  • Tool registration: Tools now registered via pi.registerTool() instead of being exported
  • Context injection: Language detection and guidance injection via before_agent_start event handler

Implementation Details

  • Extension properly captures cwd from event context (not available on ExtensionAPI itself)
  • All 5 SCIP tools registered with full context access
  • Automatic index generation and staleness detection preserved
  • Language detection (Python + TypeScript/JavaScript) preserved

Package Updates

  • Version bumped to 0.3.0
  • Peer dependency: @mariozechner/pi-coding-agent >= 0.35.0
  • Dev dependency: @mariozechner/pi-coding-agent@^0.35.0
  • Removed ./hook export from package.json
  • Main export now points to unified extension

Documentation

  • README.md: New installation instructions, migration guide, updated requirements
  • PI_INSTRUCTIONS.md: Updated for extensions/, added migration instructions

Testing

All 59 tests pass.

Migration Path

For users upgrading from v0.2.x, see README.md section 7.

Related

  • pi-coding-agent v0.35.0 migration guide
  • Extensions documentation

BREAKING CHANGES:
- Requires pi-coding-agent >= 0.35.0
- Unified extension system replaces separate hooks/tools
- Installation path changed from tools/ to extensions/

Changes:
- Merged hook.ts and tools.ts into unified extension.ts
- Updated to ExtensionAPI interface (replaces HookAPI + CustomToolFactory)
- Tools now registered via pi.registerTool() instead of export
- Context injection via before_agent_start event handler
- Updated package.json:
  - Bump version to 0.3.0
  - Update peer dependency to >= 0.35.0
  - Remove hook export, keep only main extension export
  - Update dev dependency to pi-coding-agent@0.35.0
- Updated README.md:
  - New installation instructions for extensions/ directory
  - Added migration guide from v0.2.x
  - Updated requirements (pi >= 0.35.0)
- Updated PI_INSTRUCTIONS.md:
  - Changed instructions for extensions/ instead of tools/
  - Removed separate hook installation step
  - Added migration instructions from old setup

All tests pass. The extension provides the same functionality:
- Automatic language detection and context injection
- 5 SCIP tools: find_definition, find_references, list_symbols, search_symbols, project_tree
- Automatic index generation and staleness detection
@zedrdave zedrdave merged commit b5c2eef into main Jan 6, 2026
3 checks passed
@zedrdave zedrdave deleted the feature/extensions-api-migration branch January 6, 2026 10:53
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