Repository navigation
feat: global extensions api - #146
Draft
maxy-shpfy wants to merge 1 commit into
Draft
maxy-shpfy wants to merge 1 commit into
maxy-shpfy wants to merge 1 commit into
Conversation
maxy-shpfy
force-pushed
the
maxy/feat--global-skills-and-extensions
branch
from
November 2, 2026 21:44
1b40e47 to
27533c7
Compare
maxy-shpfy
force-pushed
the
maxy/feat--global-skills-and-extensions
branch
from
November 3, 2026 03:10
27533c7 to
2a787dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a server-side registry of global extensions: Pi packages (extensions, skills, prompt templates) installed at runtime, persisted on the data volume, and applied to sessions that opt in.
"<marketplace>:<ref>"source string. Built-ins arenpm(searchable via the npm registry,keywords:pi-package),git, andfile(.tgz/.zip/ lone.tsupload). Adding a source takes oneExtensionMarketplaceclass plus oneregister()call.FileExtensionStoreunderEXTENSIONS_ROOT(defaultSESSIONS_ROOT/.extensions, so it uses the sessions PVC). Writes are staged and then atomically renamed into place.GlobalExtensionService.reconcile()runs before the server starts listening. It reinstalls anything missing from the volume. Failures are markederrorinstead of being fatal.resolvePackageResourcesfollows Pi's discovery rules. If notoolsare given,probeExtensionToolsloads the extension in an isolated subprocess and records exactly the tools it registers. If the probe can't run, the allowlist falls back to["*"]for code packages and[]for skills/prompts-only packages.globalExtensionspolicy ("all", an id list, or a locked{ only: [...] }) is overlaid by the session selection (sessions.extensions:"all","none", or ids) throughresolveExtensionSelection. A locked policy rejects overrides with409.PiAgentManagerfolds the resolvedspawnPlaninto--extension/--skill/--prompt-template, and unions the tools into--tools, the same way the memory plan is folded in./api/extensionsaddsGET /,GET /marketplaces,GET /marketplaces/:id/search?q=, and the admin-onlyPOST /,PATCH /:id,DELETE /:id.POST /api/sessionsalso acceptsextensions, andPUT /api/sessions/:id/extensionsis new.0027addssessions.extensions.openDbnow applies migrations with a resilient runner that tolerates benignalready exists/duplicate column nameerrors from regenerated migration files.docs/server/extensions-and-prompts.md(new "Global extensions" section) anddocs/config-bundle-format.md(theglobalExtensionsfield).Screenshots
N/A (backend only; UI ships in #147)
How to test
pnpm --filter @tangent/server test. New coverage includesglobalExtensionService, the marketplaces (file,npm,registry),packageResources,probeTools,selection,db/client, andsqliteSessionStore.curl -X POST /api/extensions -H 'content-type: application/json' -d '{"source":"npm:<pi-package>"}'. Then check thatGET /api/extensionslists it asreadywith detectedtools..zipor.tswith multipartPOST /api/extensions(filefield) and check that it installs.extensions: "all"and check that Prime is spawned with the extension's--extension/--skillflags and that its tools are in--tools.globalExtensions: { only: [...] }and check thatPUT /api/sessions/:id/extensionsreturns409.pkg/and check that it is reinstalled on boot.Notes
/api/extensionsare open. Writes require admin.npm/gitinstalls need network andnpmavailable in the server image.PI_EXTENSION_LOADER, thepibinary's package, or the pnpm store.Stack created with GitHub Stacks CLI • Give Feedback 💬