feat(package-manager): add project package trust store#1
Closed
aliou wants to merge 6 commits into
Closed
Conversation
…nager Add optional trustStore dependency to DefaultResourceLoaderOptions and PackageManagerOptions. Both DefaultResourceLoader and DefaultPackageManager get a required private trustStore field typed as TrustStore, with fallback to FilesystemTrustStore(cwd, agentDir) when not provided. DefaultResourceLoader passes its trustStore to DefaultPackageManager so resource loading and package trust checks use the same cwd-scoped state. CLI and SDK paths rely on the fallback and need no changes.
Allow SDK callers to provide a custom TrustStore. Passed to DefaultResourceLoader when no custom resourceLoader is supplied. Custom resourceLoaders retain their own trust behavior.
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.
All implementation sessions: https://assets.aliou.me/share/traces/2026-06-04-pi-trust/index.html
Summary by GPT-5.5:
Summary
Adds project-scoped trust for remote package sources before project packages are installed or loaded.
Changed files include:
packages/coding-agent/src/core/trust-store.ts: defines trust abstractions and filesystem-backed trust storage foragentDir/trust.json.packages/coding-agent/src/core/package-manager.ts: filters project-scopednpm:andgit:packages by trust, reports skipped untrusted packages, and auto-trusts explicit project-local installs.packages/coding-agent/src/core/resource-loader.ts: forwards skipped-package warnings during startup resource loading.packages/coding-agent/src/cli/trust-selector.tsandpackages/coding-agent/src/modes/interactive/components/trust-selector.ts: addspi trustcandidate selection UI.packages/coding-agent/src/package-manager-cli.ts,packages/coding-agent/src/cli/args.ts,packages/coding-agent/src/main.ts: wires the trust command into the CLI.packages/coding-agent/src/core/sdk.tsandpackages/coding-agent/src/core/agent-session-services.ts: exposestrustStorethrough session service creation.packages/coding-agent/test/trust-store.test.tsand package manager tests: covers trust persistence and trust filtering behavior.Behavior
npm:andgit:package sources are checked.pi trustlets users trust or untrust current project package candidates.pi install -lauto-trusts the installed project package as explicit user intent.cwdand requires both exact source and immutable resolved identity to match.Validation
npm run checkpassed via pre-commit.