Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ai/chatgpt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [1.2.2] - 2026-11-10

### Changed

- Merged quota observations and recovery scenarios into Usage Quota V2.
- Removed the separate Quota Insights feature registration while preserving stored observations.
- Added GitHub-like light and dark code palettes that follow explicit site themes.
- Expanded language labels, detection signatures and colored typographic badges.
- Scoped composer tools to a single toolbar after native mode controls.
- Bounded full-width content with border-box sizing and a small outer gutter.

### Fixed

- Known positive usage counts with unknown capacity are labelled Reported.
- Usage headers and detailed dialogs use the same quota-ledger summaries.
- Sidebar visibility restores original inline display styles.
- Nested width wrappers no longer accumulate gutters after navigation.

## [1.2.1] - 2026-11-10

### Added
Expand Down
9 changes: 6 additions & 3 deletions ai/chatgpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Updates arrive automatically. The script also checks on its own and offers to up

| Feature | What you get |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Usage Status | Remaining counts reported by ChatGPT, your plan, and low/empty alerts; totals and reset schedules are not inferred |
| Quota Insights | Persistent counter observations, observed capacity lower bounds, last net increase, and conditional recovery scenarios |
| Usage Quota V2 | Remaining counts reported by ChatGPT, your plan, and low/empty alerts; totals and reset schedules are not inferred |
| Code Blocks V2 | Language badges, syntax colours, line numbers, wrap, fold, download, indentation-safe copy |
| Message Splitter | Paste any amount of text; split into parts or attach as a file only when needed |
| Prompt Library | Your prompts plus community prompts, with a form for placeholders |
Expand Down Expand Up @@ -45,7 +44,7 @@ Updates arrive automatically. The script also checks on its own and offers to up

All of them can be changed from the settings dialog.

Usage Status shows reported remaining counts only; it does not invent totals or reset schedules. The `/wham/usage` endpoint is not displayed as the ordinary chat quota.
Usage Quota V2 shows reported remaining counts only; it does not invent totals or reset schedules. The `/wham/usage` endpoint is not displayed as the ordinary chat quota.

## Privacy

Expand Down Expand Up @@ -80,3 +79,7 @@ bun run build # minified userscript in dist/
## PDF reports

PDF export opens a print-ready preview with a contents list, readable sections, code panels and tables. Use Print / Save as PDF in the preview. See [PDF reports](docs/pdf-reports.md) for print settings and machine-reading limitations.

## Usage Quota V2

The header usage dialog combines reported allowances, capacity evidence and observation-based recovery scenarios. See [Usage Quota V2](docs/usage-quota-v2.md).
6 changes: 6 additions & 0 deletions ai/chatgpt/docs/code-blocks-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ Open Help and select Code blocks. The tour highlights the block and its toolbar.
## Verification

Copy a selection containing blank lines, tabs and nested indentation into a plain-text editor. Verify the result before using copied code in a project.

## Themes and language badges

Code panels follow the site's explicit light/dark theme, with a GitHub-like syntax palette. Language badges retain their language-associated colors. Badges are typographic representations, not official logo artwork.

Additional filename labels and conservative content signatures improve detection. New language labels may use an approximate syntax palette or plain text; the original source remains authoritative.
50 changes: 8 additions & 42 deletions ai/chatgpt/docs/quota-insights.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,14 @@
---
title: Quota insights
description: Capacity evidence, observed recovery and conditional forecasts.
section: Guides
order: 25
title: Quota Insights migration
description: Quota Insights is now part of Usage Quota V2.
section: Reference
order: 810
---

# Quota insights
# Quota Insights is now Usage Quota V2

Open Settings → Quota Insights → Open Quota Insights, or find it in the command palette.
The separate feature has been removed. Its observation ledger and saved history remain in use.

## What is recorded
Open the header usage dialog to see reported counts and recovery scenarios together.

The feature stores remaining counts, observation times, explicit API caps and reported reset timestamps. It does not store conversation text.

History is limited to 30 days and 2,000 observations per counter.

## Maximum allowance

An observed peak means capacity is at least that large. A plateau does not prove the maximum.

Full-recovery scenarios require an explicit API cap. A reported reset timestamp alone does not establish the refill amount.

## Recovery calculations

Positive changes are observed net recovery. Additional spending between observations can hide refill.

The engine calculates an observed net recovery rate across comparable intervals. It excludes gaps longer than five minutes and intervals known to be cap-bound.

Rate scenarios require 30 minutes of comparable observations, at least three positive intervals and a recent observation.

## Forecasts

The panel can show conditional +1, +5, full recovery and recovery within a selected number of minutes.

These scenarios assume the observed net recovery rate continues and no additional units are spent. They are not guaranteed refill schedules or calibrated confidence intervals.

Rolling-window recovery and batch resets can behave differently. The existing Perplexity rolling estimator remains separate.

## Privacy and account changes

Saved observations are local to each userscript.

Perplexity uses its existing account/tier namespace. ChatGPT currently partitions by reported plan, not a verified account id. Do not mix accounts in the same userscript storage when evaluating its history.

## Tutorial

The Help menu includes a Quota insights walkthrough explaining observations, lower bounds and projections.
See [Usage Quota V2](usage-quota-v2.md).
40 changes: 40 additions & 0 deletions ai/chatgpt/docs/usage-quota-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Usage Quota V2
description: Reported counts, capacity evidence and recovery scenarios in one usage feature.
section: Guides
order: 25
---

# Usage Quota V2

Click the usage control in the header. The main usage dialog now contains the observation engine previously shown separately as Quota Insights.

## Reported counts and capacity

A known count is labelled Reported even when capacity is unknown.

API-reported capacity is shown separately from the observed maximum. An observed maximum is only a lower bound. It does not prove the account's maximum allowance.

## Recovery calculations

The dialog shows the last observed net increase, comparable sampling time, net recovery, net spending and conditional recovery scenarios.

You can choose a recovery horizon. When sufficient observations exist, the same engine supplies +1, +5, recovery within that horizon and full-recovery scenarios.

Full recovery requires an explicit API capacity. A reset timestamp alone does not establish the refill amount.

## Interpretation

Rate scenarios assume no additional spending and an unchanged observed net recovery rate. They are not guarantees or calibrated confidence intervals.

Long gaps, hidden spending, cap changes and activity in other clients affect the calculation. Unknown results are not replaced with invented countdowns.

## Storage and account scope

Existing quota observations are preserved.

Perplexity reports are requested using its current account/tier namespace. ChatGPT currently partitions by reported plan rather than a verified account id. Avoid mixing ChatGPT accounts in the same userscript storage.

## Tutorial

Open Help and choose Usage Quota V2. There is no separate Quota Insights module to enable.
2 changes: 1 addition & 1 deletion ai/chatgpt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nolly/ai-chatgpt",
"version": "1.2.1",
"version": "1.2.2",
"private": true,
"type": "module",
"license": "PolyForm-Strict-1.0.0",
Expand Down
43 changes: 17 additions & 26 deletions ai/chatgpt/src/features/usage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Tooltip, createButton, createDataRow, createDialog, createSection, ensureUiStyles, markUi, showToast, uiConfig } from '@nolly/ai'
import { Tooltip, createButton, createDataRow, createDialog, createQuotaPanel, ensureUiStyles, markUi, quotaSummary, showToast, uiConfig } from '@nolly/ai'
import type { QuotaPanel } from '@nolly/ai'
import { Feature, createElement, injectStyle } from '@nolly/core'
import type { MenuEntry, ScriptContext } from '@nolly/core'
import { placeTool } from '../header-tools'
Expand Down Expand Up @@ -34,12 +35,13 @@ const expired = (iso: string | null): boolean => {

export class UsageFeature extends Feature {
readonly id = 'usage-status'
readonly name = 'Usage Status'
readonly name = 'Usage Quota V2'
readonly description = 'Shows reported tool allowances without inventing a chat-message quota.'

private readonly pill = markUi(createElement('button', `${PILL_BUTTON_CLASS} bp-usage-pill bp-themed`))
private readonly label = createElement('span')
private readonly tooltip: Tooltip
private panel: QuotaPanel | null = null

constructor(context: ScriptContext) {
super(context)
Expand Down Expand Up @@ -101,6 +103,8 @@ export class UsageFeature extends Feature {
const entry = session.limit(this.primary)
const stale = entry ? expired(entry.resetAfter) : false
this.label.textContent = entry ? `${labelOf(entry.feature)} ${stale ? '—' : entry.remaining}` : 'Tool usage'
const report = session.getQuotaReports().find((item) => item.key === this.primary) ?? null
this.pill.title = quotaSummary(report)
this.pill.dataset['level'] = !entry || stale ? 'ok' : entry.remaining <= 0 ? 'empty' : entry.remaining <= LOW ? 'low' : 'ok'
this.tooltip.refresh()
}
Expand All @@ -127,29 +131,8 @@ export class UsageFeature extends Feature {
return list
}

private body(): HTMLElement[] {
const limits = createSection('Reported tool allowances')
limits.appendChild(this.rows())
const explanation = createElement('p', 'bp-hint', 'These are tool counters returned by ChatGPT, not a verified total chat-message allowance. Totals are not supplied. Counts refresh when ChatGPT returns new data; elapsed reset times do not imply a confirmed refill.')
const nodes = [limits, explanation]
if (session.maxFileMb !== null) {
const files = createSection('Reported attachment ceiling')
files.appendChild(createDataRow('General file ceiling', `${session.maxFileMb} MB`))
files.appendChild(createElement('p', 'bp-hint', 'File-type and account restrictions can be lower.'))
nodes.push(files)
}
if (session.usage) nodes.push(createElement('p', 'bp-hint', 'The separate /wham/usage window is excluded because it has not been established as the quota for this chat.'))
return nodes
}

private renderOpenDialog(): void {
const dialog = document.getElementById(this.dialogId)
if (!(dialog instanceof HTMLDialogElement) || !dialog.open) return
const body = dialog.querySelector<HTMLElement>('.bp-dialog-body')
if (!body) return
const top = body.scrollTop
body.replaceChildren(...this.body())
body.scrollTop = top
this.panel?.refresh()
}

private open(): void {
Expand All @@ -158,8 +141,16 @@ export class UsageFeature extends Feature {
existing.close()
return
}
const ui = createDialog({ id: this.dialogId, title: 'Usage', description: session.plan ? `Reported plan: ${session.plan}` : 'Plan not reported', width: 600 })
ui.body.append(...this.body())
const ui = createDialog({ id: this.dialogId, title: this.name, description: session.plan ? `Reported plan: ${session.plan}` : 'Plan not reported', width: 760 })
this.panel = createQuotaPanel(() => session.getQuotaReports())
const panel = this.panel
ui.body.appendChild(panel.element)
if (session.maxFileMb !== null) ui.body.appendChild(createDataRow('API-reported general attachment ceiling', `${session.maxFileMb} MB · type-specific restrictions may be lower`))
ui.body.appendChild(createElement('p', 'bp-hint', 'ChatGPT history is currently separated by reported plan, not a verified account id. Do not mix accounts in the same userscript storage. The unrelated /wham usage window is not treated as this chat’s quota.'))
ui.dialog.addEventListener('close', () => {
panel.destroy()
if (this.panel === panel) this.panel = null
}, { once: true })
ui.footer.append(createButton('Close', { primary: true, onClick: ui.close }))
ui.show()
}
Expand Down
2 changes: 0 additions & 2 deletions ai/chatgpt/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
UpdatesFeature,
configurePlatform,
configureUi,
QuotaInsightsFeature
} from '@nolly/ai'
import { App } from './app'
import { fileBudget } from './budget'
Expand Down Expand Up @@ -92,7 +91,6 @@ whenReady(() => {
.register((context) => new ExporterFeature(context))
.register((context) => new UpdatesFeature(context))
.register((context) => new UsageFeature(context))
.register((context) => new QuotaInsightsFeature(context))
.register((context) => new TutorialFeature(context))
.register((context) => new DiagnosticsFeature(context))
.start()
Expand Down
5 changes: 5 additions & 0 deletions ai/chatgpt/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { interpret } from './stream'
import type { ChatEvent } from './stream'
import { QuotaLedger } from '@nolly/ai'
import { storage } from './storage'
import type { QuotaReport } from '@nolly/ai'

export type SessionEvent = 'generation-start' | 'generation-end' | 'conversation' | 'model' | 'limits' | 'usage' | 'plan' | 'user-message'

Expand Down Expand Up @@ -55,6 +56,10 @@ export class ChatSession {
}
}

getQuotaReports(): QuotaReport[] {
return this.quotaLedger.reports(Date.now(), `chatgpt:${this.plan ?? 'unidentified'}`)
}

private emit(event: SessionEvent): void {
for (const listener of this.listeners) {
try {
Expand Down
4 changes: 2 additions & 2 deletions ai/chatgpt/src/tours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const codeBlocks: Tour = {
find('.bp-code-v2 .bp-code-actions')
),
info(
'Visual wrapping is not a source change',
'Wrapping hides the gutter to avoid misleading visual line numbers. Blank lines, tabs and indentation remain part of the source.'
'Themes and language detection',
'Code panels follow the site light/dark theme. Language-colored badges remain colored. Filename labels and conservative signatures identify more languages; highlighting remains approximate and never changes the source text.'
)
]
}
Expand Down
18 changes: 18 additions & 0 deletions ai/perplexity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to Better Perplexity are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).

## [1.2.2] - 2026-11-10

### Changed

- Merged quota observations and recovery scenarios into Usage Quota V2.
- Removed the separate Quota Insights feature registration while preserving stored observations.
- Added GitHub-like light and dark code palettes that follow explicit site themes.
- Expanded language labels, detection signatures and colored typographic badges.
- Scoped composer tools to a single toolbar after native mode controls.
- Bounded full-width content with border-box sizing and a small outer gutter.

### Fixed

- Known positive usage counts with unknown capacity are labelled Reported.
- Usage headers and detailed dialogs use the same quota-ledger summaries.
- Sidebar visibility restores original inline display styles.
- Nested width wrappers no longer accumulate gutters after navigation.

## [1.2.1] - 2026-11-10

### Added
Expand Down
5 changes: 4 additions & 1 deletion ai/perplexity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Updates arrive automatically. The script also checks on its own and offers to up
| Feature | What you get |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Usage status | Reported remaining counts per mode in the header, hover summary and details dialog; totals and reset schedules are not invented |
| Quota Insights | Persistent counter observations, observed capacity lower bounds, last net increase and conditional recovery scenarios |
| Code Blocks V2 | Language badges, syntax colours, line numbers, wrap, fold, download, indentation-safe selection copy |
| Big messages | Paste any amount of text; split into parts or attach as a file only when needed |
| Prompt library | Your prompts plus community prompts, with a form for placeholders |
Expand Down Expand Up @@ -88,3 +87,7 @@ Building needs the `core/` and `core/ai/` folders at the repository root. See [C
## PDF reports

PDF export opens a print-ready preview with a contents list, readable sections, code panels and tables. Use Print / Save as PDF in the preview. See [PDF reports](docs/pdf-reports.md) for print settings and machine-reading limitations.

## Usage Quota V2

The header usage dialog combines reported allowances, capacity evidence and observation-based recovery scenarios. See [Usage Quota V2](docs/usage-quota-v2.md).
6 changes: 6 additions & 0 deletions ai/perplexity/docs/code-blocks-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ Open Help and select Code blocks. The tour highlights the block and its toolbar.
## Verification

Copy a selection containing blank lines, tabs and nested indentation into a plain-text editor. Verify the result before using copied code in a project.

## Themes and language badges

Code panels follow the site's explicit light/dark theme, with a GitHub-like syntax palette. Language badges retain their language-associated colors. Badges are typographic representations, not official logo artwork.

Additional filename labels and conservative content signatures improve detection. New language labels may use an approximate syntax palette or plain text; the original source remains authoritative.
2 changes: 1 addition & 1 deletion ai/perplexity/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Click the **?** button in the header for guided tours. Each tour highlights real
Open the settings dialog (the sliders button). Every feature is a module with its own switch and its own settings. Disabled modules stay completely idle.

> [!NOTE]
> The header buttons attach to the usage badge. If you disable **Usage Status**, those buttons disappear, but every action is still in the command palette.
> The header buttons attach to the usage badge. If you disable **Usage Quota V2**, those buttons disappear, but every action is still in the command palette.
Loading
Loading