{"_id":"@promptshield/tiptap","_rev":"2-eeed42491c034e4f95ee411c5474b1a6","name":"@promptshield/tiptap","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@promptshield/tiptap","version":"0.0.1","keywords":["@promptshield/tiptap","turbo-forge"],"author":{"name":"Mayank Kumar Chaudhari","email":"https://mayankchaudhari.com"},"license":"MIT","_id":"@promptshield/tiptap@0.0.1","maintainers":[{"name":"mayank1513","email":"mayank.srmu@gmail.com"}],"homepage":"https://github.com/promptshield-io/promptshield/blob/main/packages/tiptap/README.md","bugs":{"url":"https://github.com/promptshield-io/promptshield/issues"},"dist":{"shasum":"5d3d11c8d132d83bf1219174db7ae5b8ae86dd69","tarball":"https://registry.npmjs.org/@promptshield/tiptap/-/tiptap-0.0.1.tgz","fileCount":10,"integrity":"sha512-YAVpedyWyVZ5emggaALSAbrjjHnmyc5EJ8FqyEcgDarGmDiWk0QbcfTBO21K6JFXaK+h6JTckbgviDtNSrtGVw==","signatures":[{"sig":"MEUCIHvqz2FA54tw/DqnDJBzcxRVmJhkI6zFspkOT26gRE4FAiEAwQebW8ZRJqKajoTqKAeHMDc/j+SQAyLKbgmaqJfiiKU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31523},"main":"./dist/index.js","_from":"file:promptshield-tiptap-0.0.1.tgz","forge":{"icon":"Shield","aliases":["@ghostbuster/tiptap"]},"types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./style.css":"./dist/style.css","./package.json":"./package.json"},"funding":[{"url":"https://github.com/sponsors/promptshield-io","type":"github"},{"url":"https://github.com/sponsors/mayank1513","type":"github"}],"private":false,"scripts":{"dev":"tsup --watch","build":"tsup && gzip -c dist/index.js | wc -c","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mayank1513","email":"mayank.srmu@gmail.com"},"_resolved":"/tmp/2e05f0f9f655c6f39cdd0b864b047cf0/promptshield-tiptap-0.0.1.tgz","_integrity":"sha512-YAVpedyWyVZ5emggaALSAbrjjHnmyc5EJ8FqyEcgDarGmDiWk0QbcfTBO21K6JFXaK+h6JTckbgviDtNSrtGVw==","repository":{"url":"git+https://github.com/promptshield-io/promptshield.git","type":"git","directory":"packages/tiptap"},"_npmVersion":"10.9.4","description":"<p className=\"flex gap-2\">   <a href=\"https://github.com/promptshield-io/promptshield/actions/workflows/ci.yml\" rel=\"noopener noreferrer\">     <img alt=\"CI\" src=\"https://github.com/promptshield-io/promptshield/actions/workflows/ci.yml/badge.svg\" />   </a>","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"@tiptap/pm":"^2.11.3","@tiptap/core":"^2.11.3","@promptshield/core":"^1.0.0","@promptshield/ignore":"^2.0.0","@promptshield/sanitizer":"^0.0.2"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"latest","typescript":"latest","@types/node":"latest","@tiptap/extension-text":"^3.20.0","@tiptap/extension-document":"^3.20.0","@tiptap/extension-paragraph":"^3.20.0"},"_npmOperationalInternal":{"tmp":"tmp/tiptap_0.0.1_1773059786583_0.2747733162421311","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@promptshield/tiptap","author":{"name":"Mayank Kumar Chaudhari","email":"https://mayankchaudhari.com"},"private":false,"version":"0.0.2","description":"Official Tiptap extension for PromptShield - Protect your editor from Prompt Injection and Trojan Source attacks in real-time.","license":"MIT","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./style.css":"./dist/style.css","./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/promptshield-io/promptshield.git","directory":"packages/tiptap"},"bugs":{"url":"https://github.com/promptshield-io/promptshield/issues"},"homepage":"https://github.com/promptshield-io/promptshield/blob/main/packages/tiptap/README.md","sideEffects":false,"devDependencies":{"@tiptap/core":"^2.0.0 || ^3.0.0","@tiptap/extension-document":"^2.0.0 || ^3.20.1","@tiptap/extension-paragraph":"^2.0.0 || ^3.20.1","@tiptap/extension-text":"^2.0.0 || ^3.20.1","@tiptap/pm":"^2.0.0 || ^3.0.0","@types/node":"latest","tsup":"latest","typescript":"latest"},"dependencies":{"@promptshield/core":"^1.0.0","@promptshield/ignore":"^2.0.0","@promptshield/sanitizer":"^1.0.0"},"peerDependencies":{"@tiptap/core":"^2.0.0 || ^3.0.0","@tiptap/pm":"^2.0.0 || ^3.0.0"},"forge":{"aliases":["@ghostbuster/tiptap"],"icon":"Shield","description":"Real-time Tiptap editor security."},"funding":[{"type":"github","url":"https://github.com/sponsors/promptshield-io"},{"type":"github","url":"https://github.com/sponsors/mayank1513"}],"keywords":["@promptshield/tiptap","tiptap-extension","prompt-injection","security","trojan-source","real-time-protection","turbo-forge"],"scripts":{"build":"tsup && gzip -c dist/index.js | wc -c","clean":"rm -rf dist","dev":"tsup --watch","typecheck":"tsc --noEmit"},"_id":"@promptshield/tiptap@0.0.2","_integrity":"sha512-iFR/ybjekcA2ywqWXCYB9Ar3VyfwYUvnp9uSwwhScWeJMdfZ0HS2ClvHY+NZiTt5d/iQkJT+2l9XYgg3Rx05Lg==","_resolved":"/tmp/570c47c3439b8fae04f6b2db6029b3f0/promptshield-tiptap-0.0.2.tgz","_from":"file:promptshield-tiptap-0.0.2.tgz","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-iFR/ybjekcA2ywqWXCYB9Ar3VyfwYUvnp9uSwwhScWeJMdfZ0HS2ClvHY+NZiTt5d/iQkJT+2l9XYgg3Rx05Lg==","shasum":"bd8707ae3cd6b672b5e78b61543cee13136917e1","tarball":"https://registry.npmjs.org/@promptshield/tiptap/-/tiptap-0.0.2.tgz","fileCount":10,"unpackedSize":33329,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICTYc5R3mGQ2AYyBoC0YZUHS+08iIT/Xn0uJbWxQTFunAiBNZpw2CV/iboeIhogfZCMe9WBTODlebX5mCHv1iWaxTg=="}]},"_npmUser":{"name":"mayank1513","email":"mayank.srmu@gmail.com"},"directories":{},"maintainers":[{"name":"mayank1513","email":"mayank.srmu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tiptap_0.0.2_1773067374642_0.6009369719978559"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-09T12:36:26.421Z","modified":"2026-03-09T14:42:54.989Z","0.0.1":"2026-03-09T12:36:26.725Z","0.0.2":"2026-03-09T14:42:54.802Z"},"bugs":{"url":"https://github.com/promptshield-io/promptshield/issues"},"author":{"name":"Mayank Kumar Chaudhari","email":"https://mayankchaudhari.com"},"license":"MIT","homepage":"https://github.com/promptshield-io/promptshield/blob/main/packages/tiptap/README.md","keywords":["@promptshield/tiptap","tiptap-extension","prompt-injection","security","trojan-source","real-time-protection","turbo-forge"],"repository":{"type":"git","url":"git+https://github.com/promptshield-io/promptshield.git","directory":"packages/tiptap"},"description":"Official Tiptap extension for PromptShield - Protect your editor from Prompt Injection and Trojan Source attacks in real-time.","maintainers":[{"name":"mayank1513","email":"mayank.srmu@gmail.com"}],"readme":"# @promptshield/tiptap <img src=\"https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png\" style=\"height: 40px\"/>\n\n<p className=\"flex gap-2\">\n  <a href=\"https://github.com/promptshield-io/promptshield/actions/workflows/ci.yml\" rel=\"noopener noreferrer\">\n    <img alt=\"CI\" src=\"https://github.com/promptshield-io/promptshield/actions/workflows/ci.yml/badge.svg\" />\n  </a>\n  <a href=\"https://codecov.io/gh/promptshield-io/promptshield/tree/main/packages/@promptshield/tiptap\" rel=\"noopener noreferrer\">\n    <img alt=\"codecov\" src=\"https://codecov.io/gh/promptshield-io/promptshield/graph/badge.svg?flag=@promptshield/tiptap\" />\n  </a> \n  <a href=\"https://npmjs.com/package/@promptshield/tiptap\" rel=\"noopener noreferrer\">\n    <img alt=\"npm version\" src=\"https://img.shields.io/npm/v/@promptshield/tiptap\" />\n  </a>\n  <a href=\"https://npmjs.com/package/@promptshield/tiptap\" rel=\"noopener noreferrer\">\n    <img alt=\"npm downloads\" src=\"https://img.shields.io/npm/d18m/@promptshield/tiptap\" />\n  </a>\n  <a href=\"https://npmjs.com/package/@promptshield/tiptap\" rel=\"noopener noreferrer\">\n    <img alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@promptshield/tiptap\" />\n  </a>\n  <img alt=\"license\" src=\"https://img.shields.io/npm/l/@promptshield/tiptap\" />\n</p>\n\n> **@promptshield/tiptap**: Official Tiptap extension for PromptShield. Protect your editor from Prompt Injection and Trojan Source attacks in real-time.\n\n---\n\n## ✨ Why @promptshield/tiptap?\n\n- **Real-time Threat Detection:** Scans text for Homoglyphs, Invisible Characters, Unicode Smuggling, and Trojan Source vulnerabilities as the user types.\n- **Built-in UI:** Provides out-of-the-box text decorations (wavy underlines) and hover tooltips for visual feedback.\n- **Quick Fixes:** Empowers users to automatically sanitize and fix detected threats programmatically directly within the editor.\n- **Ignore Directives:** Supports inline ignore directives (e.g. `// promptshield-ignore`), mirroring the VS Code extension natively.\n- **Debounced Scanning:** Optimized for performance even with documents up to 50k+ characters. No freezing on keystrokes.\n- **AI Co-editing Ready:** Ideal for AI text-completion editors, preventing invisible manipulation or \"jailbreak\" injections from pasting into sensitive LLM input forms.\n\n---\n\n## 📦 Installation\n\n```bash\n$ pnpm add @promptshield/tiptap\n```\n\n**_or_**\n\n```bash\n$ npm install @promptshield/tiptap\n```\n\n**_or_**\n\n```bash\n$ yarn add @promptshield/tiptap\n```\n\n\n## 🚀 Usage\n\n```typescript\nimport { Editor } from \"@tiptap/core\";\nimport Document from \"@tiptap/extension-document\";\nimport Paragraph from \"@tiptap/extension-paragraph\";\nimport Text from \"@tiptap/extension-text\";\nimport { PromptShield } from \"@promptshield/tiptap\";\n\n// Optionally inject basic styles for the decorations and tooltips\nimport \"@promptshield/tiptap/style.css\";\n\nconst editor = new Editor({\n  extensions: [\n    Document,\n    Paragraph,\n    Text,\n    PromptShield.configure({\n      // Configure options (defaults shown)\n      scanOnUpdate: true,      // Scan dynamically as content changes\n      scanOnPaste: true,       // Ensure pasted content is evaluated\n      debounceMs: 300,         // Debounce intervals to optimize performance\n      hoverUi: true,           // Toggle the tooltip UI\n      noInlineIgnore: false,   // Allow the use of inline ignore directives\n    }),\n  ],\n  content: \"<p>Hello World</p>\",\n});\n```\n\n### 🤖 AI Co-Editing & LLM Interfaces\n`@promptshield/tiptap` is incredibly suited for robust User-to-LLM interfaces. If you are building a chat interface or a co-pilot editor using TipTap:\n1. **Prevent Attack Propagation:** If an end-user maliciously pastes hidden ZWSP sequences or homoglyphs targeting the AI model. \n2. **Warn the User:** The immediate visual threat highlights enable the user to automatically rewrite or remove the hidden logic *before* clicking submit.\n3. **Seamlessly Fix:** Quick fix actions natively remove invisible characters or normalize strings locally.\n\n## License\n\nThis library is licensed under the MIT open-source license.\n\n<hr />\n\n<p align=\"center\">with 💖 by <a href=\"https://mayankchaudhari.com\" target=\"_blank\">Mayank Kumar Chaudhari</a></p>\n","readmeFilename":"README.md"}