Uh oh!
There was an error while loading. Please reload this page.
Share npm plugin build and publish scripts - #43
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Abhijeet Prasad (AbhiPrasad)
approved these changes
Sep 1, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
What this changes
OpenCode and Pi currently carry separate build and guarded-publish scripts whose behavior is identical apart from the agent name. That makes packaging fixes easy to apply to one npm integration but miss on the other.
This PR moves those two behaviors into shared, agent-validated scripts:
scripts/build-npm-plugin.shassembles either package, injects the shared daemon client, installs from the lockfile, builds, and removes build dependenciesscripts/publish-npm-plugin.shenforces the same npm tag allowlist and dry-run-only local publish policy for both packagesbuild.shandpublish.shbecomes a four-line dispatch wrapperThe result is one implementation of npm assembly and one implementation of publish safety, with a net reduction in shell code. Agent-specific validation and package contents remain separate.
This PR does not change marketplace distribution, release workflows, package manifests, runtime tracing, or daemon behavior.
Validation
bash -non both shared scripts and all four wrappersmake validate-opencode validate-piDRY_RUN=1 src/plugins/opencode/publish.shDRY_RUN=1 src/plugins/pi/publish.shgit diff --checkBoth packages build from frozen lockfiles, pass format/lint/type/tests, smoke-import, and complete package dry-runs.