steven-tey / novel

Notion-style WYSIWYG editor with AI-powered autocompletion.
https://novel.sh
Apache License 2.0
12.47k stars 1.03k forks source link

feat: add ai features example #297

Closed andrewdoro closed 6 months ago

andrewdoro commented 7 months ago

This PR adds docs example for the AI features,

I am still not sure if this should be a copy paste code or part of the plugins system.

One thing that is not yet complete, is the required prompt text for running commands. It would be really helpful if someone with more prompt experience can help there 🥹

Screenshot 2024-02-19 at 15 14 49

Things left:

closes #291

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
novel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 0:09am
socket-security[bot] commented 7 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@radix-ui/react-scroll-area@1.0.5 Transitive: environment +22 7.35 MB benoitgrelard
npm/@tiptap/core@2.2.2 Transitive: environment +42 5.88 MB _bdbch
npm/@tiptap/extension-color@2.2.2 Transitive: environment +44 5.92 MB _bdbch
npm/@tiptap/extension-highlight@2.2.2 Transitive: environment +43 5.91 MB _bdbch
npm/@tiptap/extension-horizontal-rule@2.2.2 Transitive: environment +43 5.91 MB _bdbch
npm/@tiptap/extension-image@2.2.2 Transitive: environment +43 5.9 MB _bdbch
npm/@tiptap/extension-link@2.2.2 Transitive: environment +44 6.26 MB _bdbch
npm/@tiptap/extension-task-item@2.2.2 Transitive: environment +43 5.94 MB _bdbch
npm/@tiptap/extension-task-list@2.2.2 Transitive: environment +43 5.9 MB _bdbch
npm/@tiptap/extension-text-style@2.2.2 Transitive: environment +43 5.9 MB _bdbch
npm/@tiptap/extension-underline@2.2.2 Transitive: environment +43 5.9 MB _bdbch
npm/@tiptap/pm@2.2.2 Transitive: environment +41 3.84 MB _bdbch
npm/@tiptap/react@2.2.2 Transitive: environment +52 14.7 MB _bdbch
npm/@tiptap/starter-kit@2.2.2 Transitive: environment +61 6.38 MB _bdbch
npm/@tiptap/suggestion@2.2.2 Transitive: environment +43 5.99 MB _bdbch
npm/@types/react@18.2.55 None +3 1.68 MB types
npm/@vercel/analytics@1.1.3 None +1 126 kB vercel-release-bot
npm/ai@2.2.35 environment, network Transitive: eval, filesystem, unsafe +58 57.5 MB npm_bot_vercel_labs
npm/autoprefixer@10.4.17 environment Transitive: filesystem, shell +13 3.06 MB ai
npm/jotai@2.6.4 Transitive: environment +7 2.43 MB daishi
npm/lucide-react@0.244.0 Transitive: environment +3 10.9 MB ericfennis
npm/next-themes@0.2.1 Transitive: environment, filesystem, network, shell, unsafe +19 95.2 MB paco
npm/next@14.1.0 environment, filesystem, network, shell, unsafe +18 95.2 MB vercel-release-bot
npm/openai@4.28.0 environment, network Transitive: filesystem +28 16.3 MB dschnurr-openai
npm/prettier-plugin-tailwindcss@0.3.0 Transitive: environment, filesystem, unsafe +1 13.7 MB thecrypticace
npm/sonner@0.7.4 Transitive: environment +5 5.18 MB emilkowalski
npm/tailwind-merge@1.14.0 environment 0 765 kB dcas
npm/tailwindcss-animate@1.0.7 Transitive: environment, filesystem, network, shell, unsafe +104 14.6 MB thejameskyle
npm/tailwindcss@3.4.1 environment, filesystem Transitive: network, shell, unsafe +103 14.6 MB adamwathan
npm/ts-pattern@5.0.6 None 0 404 kB gabrielvergnaud
npm/turbo@1.12.3 None 0 30.6 kB turbobot
npm/typescript@5.3.3 None 0 32 MB typescript-bot
npm/use-debounce@9.0.4 Transitive: environment +3 443 kB xnimorz

🚮 Removed packages: npm/@tiptap/core@2.2.4, npm/@tiptap/extension-color@2.2.4, npm/@tiptap/extension-highlight@2.2.4, npm/@tiptap/extension-horizontal-rule@2.2.4, npm/@tiptap/extension-image@2.2.4, npm/@tiptap/extension-link@2.2.4, npm/@tiptap/extension-task-item@2.2.4, npm/@tiptap/extension-task-list@2.2.4, npm/@tiptap/extension-text-style@2.2.4, npm/@tiptap/extension-underline@2.2.4, npm/@tiptap/pm@2.2.4, npm/@tiptap/react@2.2.4, npm/@tiptap/starter-kit@2.2.4, npm/@tiptap/suggestion@2.2.4, npm/@types/react@18.2.64, npm/@vercel/analytics@1.2.2, npm/ai@2.2.37, npm/autoprefixer@10.4.18, npm/jotai@2.7.0, npm/turbo@1.12.5, npm/typescript@5.4.2

View full report↗︎

trevorpfiz commented 6 months ago

@andrewdoro How can I help with the direct streaming example? Are the current changes sufficient to do this, or are there still some hurdles I should know about?

andrewdoro commented 6 months ago

@trevorpfiz direct streaming example is just how Novel was used before. After sending a prompt, directly insert the text in the editor. I've seen some people were asking for this. I don't think I'll add this case here, so if you want to help with that feel free to make a new PR. I'll remove the requirement from here.

Still missing right now is the docs for adding the AI stuff.

socket-security[bot] commented 6 months ago

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/next@14.1.0

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

andrewdoro commented 6 months ago

@SocketSecurity ignore npm/next@14.1.0