Skip to content

[Feature]: Support user-global Pi extension installation #3344

Description

@hua03

Preflight

  • I searched existing issues, discussions, and contributor tasks for this request.
  • This request and its attachments contain no credentials or private/internal material.

Request origin

Observed need in a real workflow.

Problem or unmet outcome

The Pi host installer currently supports only a project-local extension target:

loopx slash-commands --install --surface pi --pi-project <project>

This writes:

<project>/.pi/extensions/loopx-goal.ts
<project>/.pi/extensions/pi-goal-loop-runtime.mjs

Pi also has a user-global extension discovery location, ~/.pi/agent/extensions/, which is the normal target when an extension should be available in every Pi project. LoopX has no managed install option for that scope today.

As a result, a user asking to "install LoopX for Pi" can reasonably expect a global Pi extension but receive a project-local installation instead. The manual workaround is to copy the adapter and runtime into ~/.pi/agent/extensions/loopx/, but that copy is outside LoopX's upgrade, ownership-marker, readback, and uninstall lifecycle.

Use case

  1. Install or update LoopX.
  2. Enable the LoopX Pi adapter once for the current user.
  3. Start Pi in different trusted projects.
  4. Use /loopx without installing duplicate adapter files into every repository.
  5. Upgrade or uninstall LoopX-managed global adapter files through the same CLI lifecycle.

Project bindings can continue to live under each current project's .loopx/pi/; only the Pi extension code needs user-global discovery.

Proposed outcome

Add an explicit user-global Pi installation scope while preserving the current project-local behavior for compatibility. The exact CLI spelling is open, for example:

loopx slash-commands --install --surface pi --pi-scope user
loopx slash-commands --uninstall --surface pi --pi-scope user

Observable behavior:

  • The user-global install writes a Pi-discoverable directory entry such as ~/.pi/agent/extensions/loopx/index.ts plus the sibling runtime module.
  • The project install remains available through --pi-project and keeps its existing behavior.
  • Install and upgrade replace only files carrying the LoopX managed marker.
  • Uninstall preserves modified or user-owned same-name files and fails closed, matching the current project installer policy.
  • Dry-run output identifies the selected scope and exact target paths.
  • loopx doctor or an equivalent readback reports whether the Pi adapter is absent, project-local, user-global, stale, or current.
  • Documentation distinguishes user-global extension code from project-local .loopx/pi/ binding state and notes the required Pi /reload or restart.

LoopX area

Host or runtime integration; build, packaging, and installer lifecycle.

Alternatives considered

  • Keep installing separately into every project's .pi/extensions/. This works but duplicates managed code and does not match a user-global installation request.
  • Manually copy the release files into ~/.pi/agent/extensions/loopx/. This loads successfully, but later loopx update does not refresh the copy and LoopX cannot safely uninstall or diagnose it.
  • Register a fixed release-snapshot path in Pi settings. This becomes stale when the active LoopX release pointer changes.

Scope and non-goals

In scope:

  • Managed user-global Pi adapter install, dry-run, upgrade/readback, and uninstall.
  • Clear scope selection and documentation.
  • Preservation of the current project-local install path.

Out of scope:

  • Moving project goal bindings or runtime state out of .loopx/pi/.
  • Granting repository, network, credential, or external-system authority.
  • Changing quota, continuation, or terminal-state semantics.

Contribution

  • I may be able to help validate this request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageNeeds maintainer triage or routing.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions