{"_id":"@cogniselect/sdk","_rev":"8-b82d14130ea77d60c4acee6a275b85dc","name":"@cogniselect/sdk","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.0":{"name":"@cogniselect/sdk","version":"1.0.0","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.0","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"88424ae6c14b0f423456b662becf2ef141f3c075","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.0.tgz","fileCount":20,"integrity":"sha512-Zil1JqNUauzRqysneXY96ep3rlz/xwB3bliw0mPB+zdJssAyygKjT5m3fydXJFUO5ABzxGEAyniQAZxZap56og==","signatures":[{"sig":"MEQCIBXhtQydTF5CMaRHo9Wq2I4MC8GKZRzJXsN+qtisRAkiAiBt7AAbmNfMXfIPIO2LxwLCC5FsHQCV5ZEXIoyxv1hq/g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18047229},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"977d2447ff11c9a8e3b4e147ece83fd524658f39","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1747696498415_0.06926902626489984","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cogniselect/sdk","version":"1.0.1","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.1","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"0416ce79e897b3b470d6632460f9447358725ba4","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.1.tgz","fileCount":18,"integrity":"sha512-dCCMd/qV7Xr/Q8SuBAT70f94MVVehQycjMIP7gv6tz/SGgT/wwAUQlURHpzi42B9da9i8oyRvemb663rBpaftQ==","signatures":[{"sig":"MEQCIBDfDCEdq0ztePisDQmWsbYW4DqA0idwQDVJPYg7EP9SAiBDphc2FAt8d/2HjvxPhYkuWiF1igKHoydFANaoF07BAg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18048697},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"e13887b1fd096735a285373e6405d44183a4fd52","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.1_1747701223968_0.06927668590854363","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@cogniselect/sdk","version":"1.0.2","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.2","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"6a4cef8c10d7eb228f6bd59e241d7348f67fcbdc","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.2.tgz","fileCount":19,"integrity":"sha512-8eA/JsxuE5E8MRZTOKL1wfVeO/Mkm5LGzlW/eA2/wkh29UYt4kfdDaVBayjHSXHkxUn5XqZt6+mWouA0YA+Hnw==","signatures":[{"sig":"MEUCIQCtkQTCeoQtbsz4p+1i4ro6h0JKCAL0tiDjvUlVKDkf7AIgVJo24neSm8tGy+OWU0B4Jwl8qZ3851++nKDXQQikzYw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18079960},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"5216560f614c6b40b04eaf098cefa126853fb49b","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.2_1747703787462_0.40533448038847686","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@cogniselect/sdk","version":"1.0.3","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.3","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"775fa1324ce6fb0ef7e2b2c98148ecb27358e4ca","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.3.tgz","fileCount":19,"integrity":"sha512-PNCyePo37p3u2yGBnbXY7YsEeQGlpG8dslLr1zTwJtlO7WJFagK+idFvqgoy7/4gBGAf6GjXnuzt2T8uY9tLzA==","signatures":[{"sig":"MEQCIBRkelxJGQYLXL/JlxtByfH0amn1RTj+XnDNu0CLSqYCAiAePR+lAw2KJxameGCct4XHNZNzC6Er/w8H6ysbG6aPAQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18081417},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"6dd2d21dfc0780c6e789e2a5a292f9a1a154a0e2","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.3_1747731690595_0.6295155484131307","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@cogniselect/sdk","version":"1.0.5","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.5","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"099e440c7654263a23206a05d7ef4fa89507d1a2","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.5.tgz","fileCount":19,"integrity":"sha512-zViyGVa6gvzg4gpGuu3oXkLHO3Nhcm0xSfIUsCtaGLPq4THPiVfqCo8Q86oz7XViaBqTEUsqPtxlgI2MeAiFEQ==","signatures":[{"sig":"MEUCIQCLKk7iM1HzSRBZfYJ1dSPgv0fmlWukkBQTgO54k9a6BQIgYXxRAHaSvu7UraZoMTT8IHf8F1YhR+R2A9pVr87GatY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18090032},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"f7902801c9d844ce19dd40df6eb24e8e1f892b18","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.5_1747732818352_0.20670131569446548","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@cogniselect/sdk","version":"1.0.6","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.6","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"7d70eec3d6eb9cdec797ce234d157997e3c0c25f","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.6.tgz","fileCount":19,"integrity":"sha512-sAzcm/s7bwTO7jF+84HeasKW+FWU2M4bsB0Wv8NGYrnT2Sf+Kw0jARm5x5efoIbwcEB121+6QegvmOvvUzly+w==","signatures":[{"sig":"MEUCIQCi3MFrV95w9LoMJ/HI9Q+67z564hHVTwQicl3fHtcGKgIgIl4ZFQKeyk+pZzMThAlOnyKOJpOemZRDgR3gRsCAYKk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18092159},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"ed8063f355c216860f06989989647e25fcca2ae1","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.6_1747734044618_0.35960117508006517","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@cogniselect/sdk","version":"1.0.7","keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","_id":"@cogniselect/sdk@1.0.7","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"dist":{"shasum":"70ba99e680f5708c5dc840e5338c4afaed20cfc1","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.7.tgz","fileCount":19,"integrity":"sha512-IJffUkPqRHwA7EAs5Lt6+gr/ob0ufhwRQBqu2iGTTpV37TmeZSogGop1hzcApNDq/HXK55RqwzS7K+MjDgzmuQ==","signatures":[{"sig":"MEUCIH128FSL4ZLujpvnnNQBgfuzsmXSpt4cmsCB2sTJYOKwAiEA/Z3Oa6dLB0Yp+ygMTcV7skDO/Vqx5XFZfjl7rFMNOww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18092581},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.esm.js","module":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"gitHead":"c8967e2b51314587ac0c0a6957e14a5845cb9af5","scripts":{"build":"rollup -c"},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"jsdelivr":"dist/index.esm.js","_npmVersion":"10.8.2","description":"Browser SDK for CogniSelect – context-menu AI features","directories":{},"_nodeVersion":"20.19.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.0.0","typescript":"^5.0.0","rollup-plugin-typescript2":"^0.32.0","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.7_1747734976750_0.5206437128837234","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@cogniselect/sdk","version":"1.0.8","description":"Browser SDK for CogniSelect – context-menu AI features","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c"},"keywords":["ai","context-menu","sdk","browser","typescript"],"author":"","license":"Apache-2.0","dependencies":{"@mlc-ai/web-llm":"^0.2.79"},"devDependencies":{"@rollup/plugin-node-resolve":"^15.0.0","rollup":"^3.0.0","rollup-plugin-typescript2":"^0.32.0","typescript":"^5.0.0"},"unpkg":"dist/index.esm.js","jsdelivr":"dist/index.esm.js","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.js"}},"_id":"@cogniselect/sdk@1.0.8","gitHead":"8ee5c99b765db44bc0dda90bfa6edc7fec036805","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-fDY7e+a39Btqs7SWZYF7EGSL5j2vn/mTnf1pOOEyAOcHW/Y/g3JAIu3DDzhC0TtjTLMqQIwn/AjODUzqOpE+Yw==","shasum":"1bb248d5d872779e096b2f890f67c480246e3290","tarball":"https://registry.npmjs.org/@cogniselect/sdk/-/sdk-1.0.8.tgz","fileCount":19,"unpackedSize":18104650,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEks9yUiPK4MIhHsgW/lOeMErzIs1ra+1xGMuQ3mHokmAiAYLi/vPmLRGJXpWED5uAyogoVEvNRf7LkhTrqCLjOEBQ=="}]},"_npmUser":{"name":"axotion","email":"kamilfronczak@pm.me"},"directories":{},"maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.8_1747746679270_0.64927011966407"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-19T23:14:58.305Z","modified":"2025-05-20T13:11:19.708Z","1.0.0":"2025-05-19T23:14:58.709Z","1.0.1":"2025-05-20T00:33:44.246Z","1.0.2":"2025-05-20T01:16:27.749Z","1.0.3":"2025-05-20T09:01:30.883Z","1.0.5":"2025-05-20T09:20:18.663Z","1.0.6":"2025-05-20T09:40:44.869Z","1.0.7":"2025-05-20T09:56:17.069Z","1.0.8":"2025-05-20T13:11:19.517Z"},"license":"Apache-2.0","keywords":["ai","context-menu","sdk","browser","typescript"],"description":"Browser SDK for CogniSelect – context-menu AI features","maintainers":[{"name":"axotion","email":"kamilfronczak@pm.me"}],"readme":"# CogniSelect SDK\n\nBrowser SDK for CogniSelect – context-menu AI features.\n\n\n## Demo\n\nYou can try it out on [CogniSelect](https://cogniselect.com).\n\n## Features\n- **Contextual Actions**: Generate summaries, quizzes, and more based on selected text.\n- **Generate your own text on areas/inputs**: Create custom text generation actions.\n- **Prebuilt Models**: Use preconfigured models for various tasks.\n- **Customizable**: Add your own actions and models.\n- **Persistent Cache**: Store models in browser storage for faster access.\n- **Lightweight**: Minimal footprint, designed for in-browser use.\n- **Easy Integration**: Simple API for quick setup and customization.\n- **Cross-Browser Support**: Works on all modern browsers.\n- **Open Source**: Available under the Apache 2.0 License.\n- **Community Driven**: Contributions and feedback are welcome.\n\n## Installation\n\n### npm\n\nInstall via npm:\n\n```bash\nnpm install @cogniselect/sdk\n```\n\n### CDN\n\n#### ES Modules\n\nLoad as an ES module:\n\n```html\n<script type=\"module\">\n  import { CogniSelect } from 'https://cdn.jsdelivr.net/npm/@cogniselect/sdk/dist/index.esm.js';\n  // or unpkg:\n  // import { CogniSelect } from 'https://unpkg.com/@cogniselect/sdk/dist/index.esm.js';\n</script>\n```\n\n#### UMD Build\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@cogniselect/sdk/dist/index.umd.js\"></script>\n<script>\n  const { CogniSelect } = window;\n</script>\n```\n\n## Usage\n\nImport and initialize CogniSelect:\n\n```javascript\nimport { CogniSelect, prebuiltModelIds } from '@cogniselect/sdk';\n\nconst cogniselect = new CogniSelect({\n  model: prebuiltModelIds[0], // or 'gemma-2-2b-it-q4f16_1-MLC',\n  cacheStrategy: 'persistent', // Cache model in browser storage\n  actions: [\n    {\n      category: 'summarize',\n      description: 'Summarize the selected text',\n      prompt: 'Summarize the selected text: \"{text}\"',\n    },\n    {\n      category: 'quiz',\n      description: 'Generate a quiz based on the selected text',\n      prompt: 'Generate a quiz based on the selected text: \"{text}\", minimum 5 questions. Highlight the correct answers.',\n    },\n    // more actions...\n  ],\n  // optional: override default model list\n  // modelList: prebuiltModelIds,\n});\n\n// You have to attach the CogniSelect instance to a DOM element\ncogniselect.attachCogniSelectStatus('#model-indicator-container');\n```\n\n### Available Models\n\nUse the `prebuiltModelIds` array to see all supported models:\n\n```javascript\nimport { prebuiltModelIds } from '@cogniselect/sdk';\nconsole.log(prebuiltModelIds);\n```\n\n## Development\n\nBuild the project:\n\n```bash\nnpm run build\n```\n\n## Acknowledgements\n\nThis project would not be possible without the excellent work of [mlc-ai/web-llm](https://github.com/mlc-ai/web-llm), which provides the core in-browser LLM engine. We gratefully acknowledge their contribution.\n\n## License\n\nApache 2.0 License. See [LICENSE.md](LICENSE.md). ","readmeFilename":"README.md"}