AI Core

Platform-agnostic building blocks for AI-chat userscripts such as Better Perplexity and Better ChatGPT. It sits on top of @nolly/core.

v0.2.5LibraryPolyForm-Strict-1.0.01 min read

Platform-agnostic building blocks for AI-chat userscripts such as Better Perplexity and Better ChatGPT. It sits on top of @nolly/core.

What you get#

  • A platform registry. configureUi and configurePlatform are called once at startup with the site's storage, logger, composer, generation detection, thread rule, prompt library URL, export source, tutorial, release information and optional hooks (editable filter, custom send, splitter defaults, upload guard, scroller, code block root).
  • Kits. Composer (find, write, send, attach) and generation (detect, wait for the answer), plus a prompt sender built on them.
  • Network helpers. A streaming response observer and an incremental Server-Sent Events parser.
  • A UI kit. Dialogs, toasts, tooltips, controls, icons, the settings dialog and the composer button.
  • Features that need only the registry: Enter as Newline, Draft Guard, Message Splitter, Prompt Library, Command Palette, Message Queue, Recall, Batch Runner, Selection Toolbar, Max Width, Code Block Pro, Context Packs, Exporter, Update Checker and Tutorial.

This is a library. It is bundled into each userscript and is not installed on its own.

New shared features must include a walkthrough in each platform's tutorial list and a guide in each platform's docs folder.

Adding a site#

  1. Create the folder with bun scripts/new-userscript.ts <slug> "<Name>" ai.
  2. Write the site's locators and a composer adapter.
  3. Call configureUi and configurePlatform, then register the features you want.
  4. Provide an export source for the exporter, tours for the tutorial, and a codeBlockRoot for Code Block Pro if you want them.
Edit this page on GitHub

Search documentation

Jump to any page or section.

AI Core
What you get
Adding a site
Changelog
[0.2.5] - 2026-11-12
[0.2.4] - 2026-11-11
[0.2.3] - 2026-11-10
Code wrapping and Answer Diff update
[0.2.2] - 2026-11-10
[0.2.2] - 2026-11-10
[0.2.1] - 2026-11-10
[0.2.0] - 2026-11-10
Export and reliability
Export and reliability
[0.1.0] - 2026-11-10
Better ChatGPT
Install
Features
Shortcuts
Privacy
Troubleshooting
Built on the shared packages
Development
License
PDF reports
Usage Quota V2
Answer Diff
Send When Ready
Getting started
Usage tracking
Usage Quota V2
Status colours
Next +1, +5 and Full
What Full means
Accuracy
Account scope
Exporting a conversation
PDF workflow
Context packs
Save an excerpt
Assemble a briefing
Use it on another platform
Privacy and limits
Guided tour
Answer diff
Compare revisions
Reuse a baseline
Privacy
Limits
Tutorial
Send when ready
Schedule a message
Safety
Limits
Code Blocks V2
Copying
Reading
Guided tour
Verification
Themes and language badges
Wrapping and folding in 1.2.4
Beautiful PDF reports
Save a report
Report layout
For AI reading
Limitations
Guided tour
Troubleshooting
Code and table fixes in 1.1.2
Quota Insights migration
Architecture
Changelog
[1.3.0] - 2026-11-12
[1.2.5] - 2026-11-11
Added
Changed
Fixed
[1.2.4] - 2026-11-10
Added
Fixed
Documentation
[1.2.2] - 2026-11-10
Changed
Fixed
[1.2.1] - 2026-11-10
Added
Fixed
[1.2.0] - 2026-11-10
Changed
Fixed
[1.1.2] - 2026-11-10
Fixed
[1.1.1] - 2026-11-10
Export and reliability
Export and reliability
Added
Fixed
Documentation
[1.1.0] - 2026-11-10
Added
Fixed
[1.0.0] - 2026-11-10
Better Perplexity
Install
Features
Shortcuts
Community prompts
Privacy
Troubleshooting
Built on the shared core
Development
License
PDF reports
Usage Quota V2
Answer Diff
Send When Ready
Getting started
Install
Take the tour
Where things are
Turn modules on and off
Usage tracking
What the badge shows
Which mode is shown
Refill estimates
Refill estimates
Estimates and uncertainty
When the numbers look wrong
Updates and alerts
Update checker
Refill alerts
Pace
Usage Quota V2
Status colours
Next +1, +5 and Full
What Full means
Accuracy
Account scope
Message queue
What it protects
The panel
How it sends
Limits
Troubleshooting
Recall
Find a message
Reuse the last message
What is kept
Privacy
Clear it
Long messages
The size meter
Big messages
Sending in parts
Attaching as a file
Accuracy
Prompts and batches
Prompt library
Placeholders
Community prompts
Batch Runner
Context packs
Save an excerpt
Assemble a briefing
Use it on another platform
Privacy and limits
Guided tour
Answer diff
Compare revisions
Reuse a baseline
Privacy
Limits
Tutorial
Send when ready
Schedule a message
Safety
Limits
Code Blocks V2
Copying
Reading
Guided tour
Verification
Themes and language badges
Wrapping and folding in 1.2.4
Code blocks and export
Code blocks
Exporting a thread
Citation styles
PDF workflow
Export failures
Beautiful PDF reports
Save a report
Report layout
For AI reading
Limitations
Guided tour
Shortcuts and settings
Default shortcuts
Enter as newline
Command palette
Selection toolbar
Layout
Architecture
@nolly/core
@nolly/ai
What stays in Better Perplexity
Compatibility
Building from source
Troubleshooting
A button is missing
Usage shows free-tier numbers
My draft disappeared
Export fails
Updates do not arrive
The build cannot find @nolly/core
Reporting a bug
Quota Insights migration
Changelog
[1.3.0] - 2026-11-12
[1.2.5] - 2026-11-11
Added
Changed
Fixed
[1.2.4] - 2026-11-10
Added
Fixed
Documentation
[1.2.2] - 2026-11-10
Changed
Fixed
[1.2.1] - 2026-11-10
Added
Fixed
[1.2.0] - 2026-11-10
Changed
Fixed
[1.1.2] - 2026-11-10
Fixed
[1.1.1] - 2026-11-10
Export and reliability
Export and reliability
Added
Fixed
Documentation
[1.1.0] - 2026-11-10
Changed
Fixed
[1.0.5] - 2026-11-09
Added
Changed
[1.0.5-hotfix.1] - 2026-11-09
Fixed
[1.0.4] - 2026-11-09
Changed
[1.0.3] - 2026-11-09
Fixed
Changed
[1.0.2] - 2026-11-09
Changed
[1.0.1] - 2026-11-09
Changed
Fixed
[1.0.0] - 2026-11-08
Added
Community prompts
Suggest a prompt
Userscript Core
What you get
Quick start
Getting started
Scaffold
A feature
Wire it up
Cleanup
API reference
Runtime
Feature
Utilities
Build
Build and release
Keeping scripts updated
Notifications
Changelog
[1.0.4] - 2026-11-12
[1.0.3] - 2026-11-10
Export and reliability
Export and reliability
1.0.2
Added
0.1.1
0.1.0