Reviewed feature request issue for copyToClipboard export.
UnderstandExported copyToClipboard function in codebase.
EditUpdated changelog with new export entry.
EditAdded appropriate label to the issue.
EditCommitted and pushed changes to repository.
VerifyYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/issues/926
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
The user wants me to review a GitHub PR. Let me start by fetching the PR details.
>gh pr view 926 --repo badlogic/pi-mono --json title,body,comments,commits,files,author,state,labels,baseRefName,headRefName>gh pr diff 926 --repo badlogic/pi-monoIt seems that the URL is actually an issue, not a PR. Let me check if it's an issue instead.
The URL points to an issue, not a PR. Let me fetch it as an issue:
>gh issue view 926 --repo badlogic/pi-mono --json title,body,comments,labels,state,authorThis is an issue (feature request), not a PR. The user asked me to review a PR, but provided an issue URL. Let me clarify this with the user.
Issue #926 (not a PR): "Expose copyToClipboard"
This is a feature request issue by @mitsuhiko, not a pull request.
Summary:
copyToClipboard function so extensions can use itLet me check the current state of copyToClipboard in the codebase:
>rg -l "copyToClipboard" packages/coding-agent/>rg "export.*copyToClipboard|copyToClipboard.*export" packages/coding-agent/Good, so copyToClipboard exists in packages/coding-agent/src/utils/clipboard.ts. Let me check that file and also check what's currently exported from the package's index.ts.
Now I understand the situation:
copyToClipboard exists in packages/coding-agent/src/utils/clipboard.ts and is already exported from that filepackages/coding-agent/src/index.ts (the main entry point)This means extensions can't import it from the package's public API.
The issue requests that copyToClipboard be exposed in the public API so extensions can use it.
Since the user gave me an issue URL rather than a PR URL, they probably want me to summarize this issue. Let me provide that summary.
Issue #926: "Expose copyToClipboard"
This is a feature request (not a PR). Here's the analysis:
pkg:coding-agent)copyToClipboard from the public API so extensions can use itThe copyToClipboard function exists at:
packages/coding-agent/src/utils/clipboard.tspackages/coding-agent/src/index.tsThis means extensions cannot import it via:
import { copyToClipboard } from "@anthropic-ai/coding-agent";To implement this request:
Add export to packages/coding-agent/src/index.ts:
export { copyToClipboard } from "./utils/clipboard.js";Add changelog entry to packages/coding-agent/CHANGELOG.md:
### Added- Exposed `copyToClipboard` utility for extensions ([#926](https://github.com/badlogic/pi-mono/issues/926) by [@mitsuhiko](https://github.com/mitsuhiko))Consider documentation update in packages/coding-agent/docs/extensions.md if clipboard utilities should be documented for extension authors.
Would you like me to implement this feature request?
implement
The user wants me to implement the feature request from issue #926: expose copyToClipboard from the public API.
I need to:
copyToClipboardnpm run check to verifyLet me start by reading the necessary files.
Now I have all the information I need. Let me implement the feature:
copyToClipboard from packages/coding-agent/src/index.tsThe function is already exported from clipboard.ts, so I just need to re-export it from the main index.
Looking at the index.ts, there's a section for utilities at the end. I'll add the clipboard export there near the shell utilities.
Now I need to run npm run check to verify there are no errors.
>cd /Users/badlogic/workspaces/pi-mono && npm run check 2>&1All checks pass. Let me also add the pkg:coding-agent label to the issue as per the guidelines.
All checks pass. Let me add the appropriate label to the issue:
>gh issue edit 926 --repo badlogic/pi-mono --add-label "pkg:coding-agent"The implementation is complete. Let me summarize what was done.
Done. Implementation complete:
Changes made:
packages/coding-agent/src/index.ts - Added export:
export { copyToClipboard } from "./utils/clipboard.js";packages/coding-agent/CHANGELOG.md - Added entry under ### Added:
- Exposed `copyToClipboard` utility for extensions ([#926](https://github.com/badlogic/pi-mono/issues/926) by [@mitsuhiko](https://github.com/mitsuhiko))Issue #926 - Added pkg:coding-agent label
Extensions can now import and use the clipboard utility:
import { copyToClipboard } from "@mariozechner/pi-coding-agent";
copyToClipboard("text to copy");>git status>git diffcommit and push
The user wants me to commit and push the changes. I need to:
>cd /Users/badlogic/workspaces/pi-mono && git add packages/coding-agent/src/index.ts packages/coding-agent/CHANGELOG.md && git commit -m "feat(coding-agent): expose copyToClipboard for extensions
fixes #926" && git pushRemote has changes. I need to pull --rebase first, then push.
>cd /Users/badlogic/workspaces/pi-mono && git pull --rebase && git pushCommit and push completed. The issue #926 will be automatically closed because of the "fixes #926" in the commit message.
Committed and pushed. Issue #926 will be automatically closed.
import { copyToClipboard } from "@anthropic-ai/coding-agent";export { copyToClipboard } from "./utils/clipboard.js";### Added- Exposed `copyToClipboard` utility for extensions ([#926](https://github.com/badlogic/pi-mono/issues/926) by [@mitsuhiko](https://github.com/mitsuhiko))export { copyToClipboard } from "./utils/clipboard.js";- Exposed `copyToClipboard` utility for extensions ([#926](https://github.com/badlogic/pi-mono/issues/926) by [@mitsuhiko](https://github.com/mitsuhiko))import { copyToClipboard } from "@mariozechner/pi-coding-agent";
copyToClipboard("text to copy");