dsh-inline-code-copy
omdsh-dev/dsh-inline-code-copy
点击助手回复中的行内代码即可复制。
설치
dsh plugin --profile web add github:omdsh-dev/dsh-inline-code-copyREADME
Inline Code Copy
Click inline code in assistant replies to copy its text. A short pulse and a status message confirm the result. Links, buttons, fenced code blocks, modifier-clicks, and text selections keep their normal behavior.
Install
dsh plugin --profile web add @shellraining/dsh-inline-code-copy
web is the standalone Web profile. For the desktop application, use its plugin manager. Refresh the existing DSH page after installation and check that the plugin loaded.
Status messages use Chinese when the document language is zh or a zh-* locale, and English otherwise. If the document has no language, the browser language is used. There are no settings or stored preferences.
The plugin uses DSH design tokens and works without the Fluent theme. It does not bundle React or import another plugin's implementation. It recognizes assistant output through data-chat-flow-kind="assistant-step"; changes to this host attribute require a compatibility review. The package retains its existing Node >=20 runtime declaration; development requires Node >=24.9.0. No broader DSH compatibility guarantee is implied.
Develop
This repository builds independently with Node >=24.9.0 and pnpm 12.6.0. Direct dependencies are pinned, and the local lockfile owns dependency resolution. No monorepo checkout or sibling node_modules is needed.
pnpm install --frozen-lockfile
pnpm typecheck
pnpm build
pnpm pack
Strict TypeScript checks cover both src/ and the build tools. build.ts uses the repository-local Vite adapter in tools/ to generate index.js and client.js; do not edit those generated files. The browser entry registers with the DSH ModuleLoader rather than running as a standalone page.
Agents must not add or modify tests without explicit user permission. There is no test suite. Type checks, builds, and archive inspection do not replace verification inside DSH.
Before publishing
- Confirm the target repository and register its primary maintainer with
omdsh-dev. The repository URLs in package metadata describe the intended destination, not proof that migration is complete. - Review the package name, release version, license, host compatibility, and both READMEs. Do not try to republish an existing npm version.
- Run the commands above, inspect the tarball, and confirm it contains the host/client entries, patch, icon, both locale files, license, and both READMEs.
- In an actual DSH profile, verify Chinese/English success and failure messages, links and buttons inside code, selection, fenced code exclusion, reduced motion, theme variants, plugin enable/disable, and a pending clipboard operation finishing after disable. Do not change a user's profile without permission.
- Keep committed bundles consistent with the build. CI runs type checking, builds, checks bundle drift, and inspects a packed archive.
- Configure npm trusted publishing for
omdsh-dev/dsh-inline-code-copyand.github/workflows/release.yml, preserving the existing npm package identity and ownership. Repository migration requires rebinding the publisher. Do not add npm tokens. - Publishing is manual only: the release workflow accepts
workflow_dispatchonmain, requires an explicitversioninput matchingpackage.json, and uses OIDC with provenance. Pushes tomainand tags never publish automatically. Trigger it only after an authorized version change and review.
License
MIT, copyright 2026 shellRaining. See LICENSE.