feat(pi): load whitelisted Pi extensions in managed runtime - #1955
Open
tim-korso wants to merge 1 commit into
Open
feat(pi): load whitelisted Pi extensions in managed runtime#1955tim-korso wants to merge 1 commit into
tim-korso wants to merge 1 commit into
Conversation
Add optional additionalExtensionPaths passthrough to createPromaManagedResourceLoaderOptions and the agent adapter. noExtensions stays true so ambient user/project settings discovery is still disabled; only explicitly provided local extension paths load (Pi resource-loader loads CLI/temporary paths even under noExtensions). Ref proma-ai#1954
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.
动机
Proma 的受管 Pi runtime 目前完全禁止加载 Pi 扩展(
noExtensions: true且从不传additionalExtensionPaths),用户无法在 Proma 里使用任何 Pi 扩展。典型案例:
pi-v4-anchor-all(DeepSeek trajectory anchor)必须作为 Pi extension 才能 hookbefore_provider_request/after_provider_response去改写 wire 载荷、限制工具集。MCP 只能暴露为普通工具,无法表达「请求改写 + 工具集限制」——所以 MCP 不是替代品。改动(最小)
createPromaManagedResourceLoaderOptions(options?):可选additionalExtensionPaths,只在非空时透传给 PiDefaultResourceLoader。pi-agent-adapter.ts:接收input.additionalExtensionPaths并透传。设计约束(保留原来的「受管 runtime 不被 ambient 污染」)
noExtensions: true保持:既不读~/.pi/agent/settings.json的用户包,也不读项目级.pi包。resource-loader在noExtensions下仍加载additionalExtensionPaths(走 CLI/temporary 通道),所以这个改动不会重新放开 ambient 发现。验证
bun run --filter='*' typecheck需在依赖安装齐全后跑(本仓库无 node_modules 时无法本地验证,改动仅是字段透传)。Closes #1954