Commit Graph
7585 Commits
Author SHA1 Message Date
Daniel Salazar 327eef2d32 feat(apps): puter.apps.get() accepts a URL (#4686)
A string containing :// is looked up as a URL instead of a name. The
puter-apps driver's read takes id.url and resolves it through
appUidFromOrigin, so it returns the same app a page on that origin acts
as.
2026-11-17 21:24:41 -07:00
Daniel Salazar 6b7541d0b6 fix: AuthMe relay names, write size caps, worker teardown on uninstall, and fewer share, cache and whoami round trips (#4683)
* fix(auth): AuthMe reads forwards_to only from configured relays and never redirects onto the GUI

The authorization dialog names the host in `forwards_to` only when the
redirect's origin is listed in the new `authmeRelayOrigins` config, rather
than for any host under the deployment domain. An AuthMe request whose
redirect lands on the GUI's own origin is refused before the dialog opens,
since GUI pages pass their query on to whatever they launch.

* fix(fs): hold direct writes to their declared size or the owner's free storage

Writes that stream straight onto a file's object (`/fs/write`,
`/fs/batchWrite`, WebDAV PUT and signed `/writeFile`) now cap the body
before it is stored:

- A stream that declares a size fails with 400 once more bytes arrive than
  it declared, and the upload is aborted.
- A stream that declares 0 (a chunked WebDAV PUT, `/writeFile`, a multipart
  part sent with size 0) is capped at the owner's free storage and fails with
  413 past it. Parts of one batch share that allowance.
- A body of known length that is longer than declared is checked against
  the owner's free storage before the upload instead of after.

A refused overwrite leaves the stored file and its recorded size unchanged.
A new file whose write fails after its upload has its object deleted. The
last chunk of a capped stream is held until the body ends, so the store
never completes an upload that later turns out too long, and a PutObject is
aborted when its streamed body fails.

* fix(workers): uninstalling an app takes down its workers in the account

The workers an app runs in a user's account, and those bound to apps it
created there, are deleted when the user uninstalls it: script, sessions and
row. A redeploy of any kind (hot reload, unsuspension, an edge redeploy of an
evicted script) reads the row's app, so with the row gone none of them can
mint a token for the uninstalled app again. A worker bound to an app the user
owns is kept. When the edge can't delete the script, the row is still
removed and the script delete is retried in the background.

* perf(share): withdraw a share's access modes in one revoke

Withdrawing a share revoked each of the five access modes on its own, every
one a delete, a primary re-read and a cache bump in series. It now uses the
batch revoke: one delete, one re-read and one bump, with each removed
permission still audited and announced. A file's withdrawal also skips the
subtree scan for re-shares managed below it, since a file has nothing below
it. Adds a benchmark scenario for withdrawing a file share.

* perf(puter-js): an update to a file drops only that file from the FS cache

`item.updated` for a file now removes its cached entry and its folder's
listing, including an entry still cached under the file's old path, since
a rename arrives as an update naming only the new path. An update to a
directory still clears the whole cache. Before, any file overwrite cleared
the whole cache, and the desktop then re-read its warm folders.

* perf(puter-js): the desktop handing back its own token reads the user once

In the GUI environment, `setAuthToken` with the token it already holds no
longer re-reads `/whoami` when the user was read with that token and API
origin, or a read is still in flight; `puter.os.user()` there keeps what it
reads as `puter.whoami`. The auth-state change and its cache check still
run. The desktop merges the user it stores into `puter.whoami` when the token
is unchanged, so an account saved under a new username shows up there.
Other environments behave as before.
2026-11-17 20:56:45 -07:00
Nariman Jelveh 68ee2b0b8b feat(gui): show thumbnails for uploaded HEIC photos and audio cover art (#4684)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* feat(gui): show the cover art of uploaded audio files as their thumbnail

On upload, the desktop finds the cover an MP3, FLAC, M4A or M4B file
keeps with its tags and passes it to the image thumbnail generator: an
ID3v2 picture frame (versions 2.2 to 2.4), a FLAC picture block, or an
MP4 `covr` atom. The picture marked as the front cover is preferred.

Only the tags are read. The reader steps over other frames, blocks and
the audio by their stated sizes, within 1 MiB of reads, and the cover is
a slice of the file that is not read until it is decoded. Its type comes
from its own first bytes. A file with no cover keeps its file icon.

An album is many files that each hold the same cover, so an upload finds
and scales one cover before it opens the next file, with 5 seconds for
all of them. The budgets are published with the others.

* feat(gui): show thumbnails for uploaded HEIC photos

Safari decodes HEIC and HEIF photos itself, so the image thumbnail
generator is given the file first. In other browsers the desktop reads
the photo's index, takes the small copy of the photo that phones store
beside it, or else the photo's own picture or grid of tiles, and hands
the coded data to the browser's VideoDecoder, which uses the HEVC
decoder the device has. The frames are drawn onto a small canvas, turned
and mirrored as the photo's properties say.

No decoder is shipped and nothing is decoded in script. Whether the
device can decode the photo is asked before any of it is read, so a
browser or device with no HEVC decoder costs one small read and the
photo keeps its file icon.

An upload decodes one photo at a time, with 10 seconds for all of them
and 2 for each. The budgets are published with the others. The walk
over a file's boxes that the audio reader had moves to isobmff.js, which
both readers use.
2026-11-17 19:32:18 -07:00
Nariman Jelveh 90d83ed0a3 feat(gui): show thumbnails for uploaded Office documents, Illustrator files, videos and scanned PDFs (#4682)
* feat(gui): show thumbnails for uploaded Word documents

On upload, the desktop makes a first-page thumbnail for DOCX and DOC
files and passes it to the image thumbnail generator, as it does for a
PSD's preview. Templates and macro-enabled documents (.dotx, .docm,
.dotm, .dot) work the same way.

A DOCX that stores a first-page JPEG uses it. Otherwise the desktop
reads the main part up to the first page break and draws the page on a
small canvas: paragraphs with the size, weight, color, alignment, indent
and spacing their styles and direct formatting give them, table cells
side by side, and pictures at their stated size. Fonts, headers,
footers, borders and floating positions are not drawn.

A DOC is read through its compound file's sector chains to its text,
which is drawn alone; the format's binary formatting is not read.

Only the parts needed are read, within published budgets: 4 MiB of
container data, 1 MiB of XML per part, 16,384 characters of text, and
four pictures. An upload reads its Word documents one at a time and
stops starting new ones 5 seconds after the first. Encrypted documents
and documents with a blank first page keep their file icon.

The buffered file reader moves out of psd.js so the three parsers share
it.

* feat(gui): show thumbnails for uploaded spreadsheets and videos

Spreadsheets: an XLSX that stores a first-page JPEG uses it. Otherwise
the desktop reads the first visible worksheet and draws the 480 points
at its top-left corner: gridlines, column widths and row heights, each
cell's fill, and each cell's text in its font size, weight, color and
alignment, with colors resolved through the workbook's theme. Numbers
are drawn as stored; number formats, merged cells, borders, charts and
pictures are not drawn. Templates and macro-enabled workbooks (.xlsm,
.xltx, .xltm) work the same way.

Videos: an MP4, MOV, M4V or WebM file is loaded into a detached video
element, which seeks a tenth of the way in, at most 10 seconds, and the
frame is drawn to a small canvas. The browser's player reads only the
parts of the file it needs. A video the browser can't play keeps its
file icon.

Both go to the image thumbnail generator like the other formats. An
upload reads its Office documents one at a time and loads its videos one
at a time, each kind under its own 5 second preparation deadline; a
video gets 4 seconds. The budgets are published with the others.

The ZIP and XML reading that DOCX and XLSX share moves from docx.js to
ooxml.js, and the budgets they share are renamed from WORD_ to OFFICE_.

* fix(gui): take a video's thumbnail frame only once the browser can paint it

WebKit reports a seek as done before the frame it landed on can be
drawn, so every MP4 and MOV uploaded from Safari got a black thumbnail.
The reader now checks that the player has a frame when the seek ends,
and otherwise waits for the next frame the player presents after it.
Chromium has the frame at that point and presents no later one, so it
still draws right away.

* fix(gui): preload a video so Safari seeks to its thumbnail frame at once

With only the metadata preloaded, WebKit holds each seek back for a
second, so a video took over a second to thumbnail in Safari and an
upload of a few videos ran into its preparation deadline. Preloading the
video itself brings that to under 100 ms. Chromium takes 10 to 20 ms
longer per video than before.

* fix(gui): hold thumbnail preparation to its published deadline

The deadline an upload gives its Office documents, and the one it gives
its videos, was only checked when a file's turn came. A video that
started just before it could run for its own 4 seconds more, and a
document whose read never came back held the upload with no limit, so an
upload could wait about 9 seconds where 5 are published.

The queue now gives up on the file in progress when the deadline passes,
as the PDF path does: the upload stops waiting, the video is released,
and the readers are told to stop through their abort signal.

* test(gui): cover a failing reader and a cancelled upload in the Office queue

The test that claimed both passed without reaching either: its failing
document made the reader return nothing instead of throwing, and its
cancelled one was turned away before the queue. Two tests replace it,
one with a document whose main part can't be inflated ahead of a good
one, and one that cancels while documents are still queued.

* fix(gui): bound the compressed data read from an Office archive entry

Reading an entry stopped once it had inflated to its budget, so the
amount of compressed data read still depended on the entry. The input is
now cut off a little past the budget as well, and data that ends at the
cut is treated as the end of the entry. The work done for an entry is
bounded whatever its compressed size.

* fix(gui): read spreadsheets whose elements carry a namespace prefix

Writers built on the Open XML SDK put every spreadsheet element under a
prefix such as x:, and some give the sheet's relationship id a prefix
other than r:. The reader matched bare names, so those workbooks got no
thumbnail. It now compares element names without their prefix, and
finds the relationship id as the sheet's one prefixed attribute.

* fix(gui): keep the default width of a spreadsheet column that states none

A column definition can carry only a style. The reader took its missing
width for zero, which drew the column, and every column after it in the
same definition, a few points wide.

* fix(gui): leave a spreadsheet's shared-string cell with no value empty

A cell marked as a shared string with nothing in it was read as position
zero, so it showed the workbook's first string.

* fix(gui): find a spreadsheet's strings, styles and theme where the workbook says

The reader looked for these parts under their usual names. A workbook
that names them otherwise, such as SharedStrings.xml with a capital,
lost the text of every shared-string cell and all its formatting. The
parts are now taken from the workbook's relationships, with the usual
names as the fallback.

* fix(gui): draw spreadsheet colors given as positions in the standard palette

Workbooks converted from the older format state their fills and font
colors as positions in a fixed palette of 64 colors. The reader resolved
only direct and theme colors, so those fills were not drawn and their
text came out black.

* fix(gui): lay a right-to-left spreadsheet out from the right edge

A sheet set to run right to left has column A at the right, as sheets in
Arabic, Persian and Hebrew usually do. The thumbnail drew every sheet
left to right, so those came out mirrored. Columns, fills and gridlines
are now counted from the right edge for such a sheet, its text starts at
the right of its cell, and long text runs on toward the left.

* fix(gui): hide a DOC field's instruction when it holds another field

A field's instruction can contain a field of its own, as a mail merge
condition does. The instruction was removed up to the inner field only,
so the rest of it was drawn as text. Fields are now followed as they
nest, and text is drawn when it is in no field's instruction.

* docs(gui): describe the WebKit video handling and the spreadsheet layout rules

The thumbnail service's README now says why a video is preloaded in
full and drawn only once the player has a frame, that a deadline also
ends the file in progress, and that sheets can run right to left and
take colors from the standard palette.

* fix(gui): find a DOCX's page size in one pass over its section properties

The page size and margins were looked up with patterns that could scan
the section properties again from every tag in them. Each lookup now
searches for the tag and for its end once, so it takes time in
proportion to the size of the part.

* fix(gui): use the format's own size limit for a DOC's small streams

Which streams count as small, and are read whole from the mini stream,
was taken from the file's header. The format fixes that limit at 4096
bytes, which is now what the reader uses, so a stream read whole is
never larger than that.

* fix(gui): walk each sector chain of a DOC once

Every read of a stream followed its chain of sectors again from the
start. A document whose text is in many pieces far into a long stream
spent its read budget on that and lost its text after the first hundred
or so pieces, and the work grew with the number of pieces times the
length of the chain.

A chain is now kept as far as it has been walked and continued from
there.

* fix(gui): bound a DOCX picture by its pixels and decode it at page size

A picture's limit was on its file size alone, and each one was decoded
in full and kept until the page was drawn, so the memory used depended
on the pixel size the image stated.

The reader now takes the pixel size from the image's header, skips a
picture over 16,777,216 pixels or of a size it can't tell, and has the
browser scale a large one down to the page's size as it decodes it. The
limit is published with the others.

* fix(gui): apply the DOCX text budget inside a single piece of text

The 16,384 character budget was checked after each piece of text was
added, and one piece can be nearly the whole part. A piece is now cut at
the budget, and a word that has to break between characters is measured
only as far as the page goes, so the layout work is bounded by the
budget.

* fix(gui): measure DOCX text in its own run's font

The font was set once per run, and drawing a finished line left the font
of that line's last word in place. Text measured after a line break, or
after a wrap, in a run of another size was spaced and wrapped for the
wrong size: small text after a title was spread out, and large text
after a note overlapped. The font is now set before each measurement.

* fix(gui): end a DOCX's first page where a section or a style starts a new one

The first page ended only at a page break, at the place Word last broke
the page, or at a paragraph set to start a page. A document saved
without Word's page marks ran its second section, or a chapter whose
style starts a page, onto the first page's thumbnail.

The page now also ends after the last paragraph of a section when the
next section starts on a new page, and before a paragraph whose style
asks for a page break. A section that continues on the same page does
not end it.

* fix(gui): leave unknown character references in Office text as written

A reference was looked up by name in a plain object, so a name such as
constructor found a built-in function and drew its source text. Only the
five names XML defines are replaced now.

* fix(gui): keep the DOCX text that follows a text box in the same run

A text box sits inside a run and holds runs of its own. The first of
those ended the run around it, so whatever text that run had after the
text box was dropped. Runs now nest, and the outer one goes on when the
inner ones are done.

* fix(gui): do not indent a DOCX paragraph taken out of its list

A paragraph with list number zero is not a list item: that is how a
document removes one paragraph from the list its style belongs to. It
was indented like the items around it.

* fix(gui): leave hidden text out of a DOCX thumbnail

Text marked as hidden, in a run or through a style, is not shown on the
page, and was drawn on the thumbnail.

* test(gui): make the Office archive budget tests fail when a budget is removed

The test for an entry that inflates to more than it states checked only
the size of the result, which is cut to the budget either way. It now
counts what was pulled out of the inflater. A new test covers the read
budget with an archive whose directory is larger than it.

* feat(gui): thumbnail PDFs whose pages hold images of up to 16 megapixels

A PDF with an image over 4,194,304 pixels got no thumbnail, which left
out every page scanned at 300 dpi and every phone photo saved as a PDF.
The limit on an embedded image is now 16,777,216 pixels, separate from
the canvas budget, which stays where it was: PDF.js decodes the larger
image and scales it down to the canvas budget to draw it.

Such a PDF takes 0.55 to 0.8 seconds and a few hundred megabytes in its
disposable worker, measured in Chromium and WebKit with an 8.4 megapixel
scan and a 12 megapixel photo. Larger images are still turned away
before they are decoded. The published limits are updated.

* fix(gui): show a document's type icon in the Files tab's list rows

A list row draws its icon at 18 pixels. A thumbnail of a PDF, a Word
document or a spreadsheet is a picture of a page, which at that size is
a near-blank white square, so those rows lost the icon that tells them
apart. List rows now show the type icon for such a file, and the grid
views keep showing its thumbnail. Images, videos and PSDs keep their
thumbnails in every view.

The names that make a file a document move to one module, shared by the
thumbnail generator and the icon helper.

* feat(gui): show thumbnails for uploaded Illustrator files

Illustrator saves a PDF of the artwork at the start of its files unless
told not to. An .ai file that starts as a PDF does now goes to the PDF
thumbnail renderer, within the same budgets. One saved without it starts
as PostScript and keeps its file icon, and the renderer is not loaded
for it.

An Illustrator thumbnail is artwork, so the Files tab shows it in list
rows too, as it does an image's.

* refactor(gui): share picture, theme and paragraph code between the Office readers

Decoding a picture stored in an archive, reading a theme's colors by
name and laying out a paragraph move to where a second reader can use
them: the first two from the DOCX and XLSX readers into ooxml.js, the
third out of the page painter's closure. A relationship target that
climbs out of its part's folder is resolved, and a paragraph can carry a
marker to draw before its first line. What the existing readers draw is
unchanged.

* feat(gui): show thumbnails for uploaded PowerPoint presentations

A PPTX that stores a first-slide JPEG, as PowerPoint does by default,
uses it. Otherwise the desktop finds the first slide the presentation
lists, the layout it builds on, that layout's master and the master's
theme, and draws the slide: its background, what the master and layout
add to every slide, each shape's fill and text, and each picture.

A placeholder that states no position takes its layout's or its
master's, and its text takes its size, weight, color, alignment, indent
and list marker from the same chain, down to the master's text styles.
Theme colors go through the master's map of names, so a dark deck draws
dark, and groups place their shapes through their own space. Gradients
are drawn as their first color; lines, tables, charts, rotation and
shapes other than boxes and ellipses are not drawn.

Slide shows, templates and their macro-enabled forms work the same way.
Presentations share the Office queue and its 5 second deadline, and the
new budgets are published with the others: 256 shapes and 4,096
characters from each of the slide, its layout and its master, and 8
pictures. In the Files tab's list rows a presentation shows its type
icon, as other documents do.
2026-11-17 18:55:03 -07:00
Nariman Jelveh 84e71703f6 fix(gui): show thumbnails for PSD files saved without a preview
Editors other than Photoshop often save a PSD with no embedded preview,
so those uploads kept their file icon. When a document has no usable
preview, the desktop now scales down the merged image stored after the
layers and passes it to the image thumbnail generator. PSB files work
the same way.

Only the rows the scaled image samples are read, so the cost follows
the document's width rather than its size, within a 16 MiB read budget.
Raw and RLE-compressed images are supported for RGB and grayscale
documents at 8 or 16 bits per channel, and transparency is flattened
onto white. Other documents keep their file icon.
2026-11-17 16:13:07 -07:00
Nariman Jelveh 25e73898cf feat(gui): show thumbnails for uploaded PSD files (#4680)
Photoshop stores a small JPEG preview in a PSD's image resources. On
upload, the desktop reads that preview and passes it to the image
thumbnail generator, which scales it like any other image. PSB files
work the same way.

Only the resource headers are read, so the cost does not grow with the
document: finding the preview takes at most 1 MiB of reads, and needs
no worker or extra assets. A document saved without a preview keeps its
file icon.

The thumbnail service folder is renamed from pdfThumbnails to
uploadThumbnails now that it handles two formats. The built asset path
(/dist/pdf-thumbnails/) is unchanged.
2026-11-17 15:53:42 -07:00
Daniel Salazar 5d2eaeb981 fix: billing holds that follow what AI calls cost, reserved godmode hosts, contained upload paths (#4671)
* fix(replicate): send input images as the bytes measured for billing

Each input image is fetched once, measured, and passed to Replicate as those bytes, which the client uploads to Replicate's file store. An input that can't be read as an image is refused with 400 instead of being billed as one megapixel.

* fix(ocr): hold the page limit for a PDF whose pages can't be counted

When the balance can't cover the page limit, the call holds the size-based estimate and asks Mistral for only that many leading pages. A pages selection still holds only the selected pages.

* fix(tts): bill gpt-4o-mini-tts by the tokens OpenAI reports

The model is streamed as server-sent events, decoded back into the audio stream callers get, and charged the input and audio tokens from the final event. The per-character rate on the text and instructions is the hold, and is charged when no usage arrives.

* fix(realtime): response holds include the conversation so far

Each response holds the fixed budget plus every token the previous response read and wrote, priced as uncached audio input. An unreported response is billed the same amount.

* fix(apps): reserve godmode app hosts and the puter.* launch params

apps.create and apps.update refuse an index_url on the host of a godmode app. The desktop drops puter.* params already in an index_url before adding its own. Dev Center inserts the payout email as text.

* fix(puter-js): fs.upload refuses paths outside the destination folder

A file or folder whose path resolves outside the destination, such as through .. segments, rejects the upload with invalid_upload_path before anything is written.

* docs: changelog and quota entries for the billing and upload changes

* fix(tts): skip a [DONE] line in the speech event stream

Also adds a gpt-4o-mini-tts integration case that checks the streamed audio and the billed tokens.

* fix(ocr): a document whose pages can't be counted reads only what the balance covers

Counted PDFs hold their page count. Anything else that can't be counted, such as a DOCX or an encrypted PDF, holds the provider's page limit, or as many leading pages as the balance covers, and Mistral is asked for only those pages. Drops the size-based page guess. The changelog keeps only the developer-facing upload error.
2026-11-17 15:46:17 -07:00
Nariman Jelveh 7d046acdb9 fix(apps): stop suggesting draw as a built-in opener for images
Images now map to viewer alone. An app named draw is suggested for an
image only when it registers the extension, like any other app.
2026-11-17 14:59:45 -07:00
Daniel Salazar 25ba1de867 fix(ai): a chat request the balance would cut short asks top-up listeners first (#4679)
The chat credit gate emitted metering.out-of-credits only when the
balance couldn't pay for the prompt. A balance that covered the prompt
but not the reply capped max_tokens and flagged the response
usage_limited, so the caller saw a funds prompt while no listener was
asked to add credit.

The gate now asks when the balance is short of the prompt plus output
up to the request's limit, and reads the balance again if a listener
added credit.
2026-11-17 14:15:08 -07:00
Nariman Jelveh 245254ce0c fix(gui): make Open With a one-time choice with an explicit default (#4677)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* fix(gui): make Open With a one-time choice with an explicit default

Choosing an app under Open With opens the file in it and nothing else; it
no longer asks to make that app the default for the file type. A new
"Always Open .<ext> Files With" submenu lists the suggested apps with the
current default checked and saves the one picked.

Open With lists the default app first, then the rest in the server's
order. Third-party apps for an extension come back in registration order
instead of whatever order the database returned.

The desktop item menu and the dashboard menu now build Open With from one
helper instead of two copies. The dashboard's touch menu renders checked
items. Files without an extension no longer take a default, since one was
never loaded back after a reload.

* fix(gui): close every parent menu when an item in a nested submenu is chosen

Choosing an item in a submenu of a submenu closed that submenu and its
parent, and left the root context menu open. The menu now closes with
every menu above it.

* fix(gui): close a nested submenu together with the submenu it belongs to

Moving the pointer from a third-level menu back to the root menu removed
the second-level menu and left the third on screen until the next click.
A context menu now removes its own submenus when it is removed.

* fix(gui): keep keyboard selection in the submenu being opened

Pressing the right arrow or Enter on a submenu row highlighted the first
row of the first submenu on screen. In a submenu of a submenu that is a
row of the menu the key was pressed in, so two rows ended up highlighted.
The selection now goes to the submenu that row opens.

* fix(gui): make the touch menu's checkmark visible in dark mode

The checkmark of a checked item took the button's default text color, so
it was black on the dark sheet. It now uses the same color as the label.

* fix(gui): show an extension with special characters correctly in Open With

The desktop menu encodes the label of a row that has a submenu, and the
touch menu renders it as HTML, so the already encoded "Always Open" label
read ".a&amp;b" on the desktop for a file named "x.a&b". Each menu now gets
the label in the form it expects.

* fix(gui): treat a file name that ends in a dot as having no extension

A file named "notes." was offered "Always Open . Files With". It takes no
default app, like any other file without an extension.

* fix(gui): don't offer a default app for a folder

A folder whose name ends in an extension, such as "three.js", was offered
"Always Open .js Files With", and its Open With list was ordered by the
default app for that extension. A folder opens as a folder, so its list
keeps the server's order and has no default to set.

* fix(gui): keep a context menu label clear of its submenu arrow

When a row with a submenu was the widest row of its menu, as "Always Open
.ext Files With" is, its label ran right up to the arrow. The label now
keeps a 12px gap; menus wider than their submenu rows look the same.

* fix(gui): keep a nested submenu off the root menu near the right edge

When a menu opened close to the right edge, such as from a row's more
button, its submenu opened to the left and that submenu's own submenu
opened back to the right, on top of the root menu. A nested submenu now
continues to the left when its parent opened there and it fits, and the
pointer's path to it is judged from the side it opened on.

* test(puter-js): cover context menus with a submenu inside a submenu

Two specs for puter.ui.contextMenu(): choosing an item three levels deep
closes the whole menu, and the inner submenu closes with the submenu it
belongs to.

* docs: add the nested context menu fix to the changelog
2026-11-17 11:59:07 -07:00
Filip Kujundžić b904eddc69 feat(ai): add GPT-6.2 Astra and Sol with API pricing (#4678) 2026-11-17 11:18:45 -07:00
dependabot[bot] 6b4e7cb28a chore(deps-dev): bump vite from 8.1.6 to 8.1.7 (#4675)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.1.6 to 8.1.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v8.1.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.1.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.1.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 10:19:48 -07:00
dependabot[bot] 74c5bb54a0 chore(deps): bump postal-mime from 4.2.0 to 4.2.1 (#4674)
Bumps [postal-mime](https://github.com/postalsys/postal-mime) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/postalsys/postal-mime/releases)
- [Changelog](https://github.com/postalsys/postal-mime/blob/master/CHANGELOG.md)
- [Commits](https://github.com/postalsys/postal-mime/compare/v4.2.0...v4.2.1)

---
updated-dependencies:
- dependency-name: postal-mime
  dependency-version: 4.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 10:19:34 -07:00
Reynaldi ChernandoandCopilot Autofix powered by AI 253f1f1b8c update changelog automation to prioritize impactful changes (#4676)
* update changelog automation to prioritize impactful changes

* Update changelog with recent changes and fixes

Added `puterId` to models, updated model names for Mistral Large 4, adjusted AI request limit behavior, improved `puter.ai.txt2img()` retry logic, and fixed messaging issues for desktop apps.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-17 20:47:16 +07:00
Reynaldi Chernando 777f048cab add changelog to docs (#4669)
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
* changelog

* refine

* rss
2026-11-17 09:13:19 +07:00
Filip Kujundžić 66668e819b Merge pull request #4667 from HeyPuter/fix/qwen4-max-pricing
fix(ai): add Qwen4-Max billing rates
2026-11-16 22:29:31 +01:00
Filip Kujundžić 13371a5b1b Merge pull request #4663 from HeyPuter/fix/standard-model-pricing
Use regular model prices instead of launch promotions
2026-11-16 22:29:20 +01:00
Filip Kujundžić 0005bf1803 Merge pull request #4661 from HeyPuter/refactor/aws-ai-providers
Group the AWS AI providers and share their price list parsing
2026-11-16 22:27:24 +01:00
404oops 7b35cbafa7 fix(ai): add Qwen4-Max billing rates 2026-11-16 22:19:47 +01:00
Nariman Jelveh 037ba9b214 refactor(gui): /action/change-username redirects to the dashboard's Account tab, and its desktop window is removed (#4665)
The desktop's change-username window was only reachable from
/action/change-username, which nothing links to. The dashboard's Account
tab has its own change-username dialog. Old links now redirect there.
2026-11-16 13:18:01 -07:00
Wei-Lun Li ae342c634e fix(tools): spawn npm through npmSpawnArgs in start --smtp (#4650)
npm start -- --smtp (and npm run start:smtp) still called run(npm, ...)
after the npm constant was replaced by npmSpawnArgs, so it stopped with
"npm is not defined" before building.
2026-11-16 12:14:04 -07:00
Juan Fernando CastroandDaniel Salazar b85c04d49a fix(redis): a command that gets no answer rejects after a timeout, and commands fail fast while Redis is stalled (#4656)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* fix(redis): a command that gets no answer rejects after the configured timeout

redis.commandTimeoutMs (default 2000) arms a per-command timer on the
cluster client, so a command sent to a node that never replies, or queued
while the cluster is not ready, rejects and the caller takes its error
path. Blocking commands and duplicate() clients are left without it.

* fix(broadcast): a failed pubsub publish or subscribe is logged, not left unhandled

With command timeouts, a stalled publish now rejects; the fan-out is
fire-and-forget, so the rejection is caught and logged. The sign-in relay
test pins that /login/set still reaches a subscribed /login/wait when
Redis never answers.

* fix(permissions): a scan cache read that Redis fails to serve counts as a miss

The scan then computes from the store, as the generation and per-check
cache reads already do, instead of failing the permission check.

* refactor(redis): isCommandTimeout names the rejection of a timed-out command

Callers that issue a write can recognise the timeout and queue its undo
on the same key. Also notes that a timed-out command is not withdrawn,
restores the console spies in the timeout tests, and drops formatting
churn in types.ts.

* fix(metering): an increment whose buffering timed out is counted once

On a timeout the write-through runs and the buffered copy is negated on
the same keys, so if the timed-out increment lands later the next flush
nets it out. incr and incrAux both do this.

* fix(rate-limit): a concurrency slot whose acquire timed out is removed

The ZREM goes to the same key behind the timed-out MULTI, so a slot that
lands late does not stay held until the orphan window.

* fix(uploads): leases whose take timed out are released

The release goes to the same keys behind the timed-out take, so leases
that land late do not count against the owner until their deadline.

* fix(redis-lock): a claim that timed out is released if it lands

The token-checked delete goes to the same key behind the timed-out SET
NX, so a late claim does not hold the lock for its full TTL.

* fix(broadcast): a rejected pubsub subscribe is retried with backoff

Retries start at 1s and cap at 30s, and stop once the service shuts down.

* refactor(redis): isCommandTimeout lives in its own module

Stores, the rate limiter and the lock helper recognise a timed-out
command without importing the client.

* fix(credit-holds): a hold whose take or reserve timed out is released

The release goes to the same key behind the timed-out script, so a hold
that lands late does not shrink the spendable budget for its TTL.

* fix(metering): a write-through answers without waiting on its undo

The undo's place in the queue is fixed when it is sent, so the request
no longer waits on it. When the undo itself times out, the warning says
the increment may be counted once more or not at all.

* fix(broadcast): a pubsub subscribe retry checks the client is still current

A retry that fires after shutdown no longer subscribes the closed client.

* feat(redis): after a timeout, commands fail fast until a probe gets a reply

For redis.failFastMs (default 5000) after a command times out, other
commands reject unsent with 'Redis unavailable', so a stall costs a
request one timeout instead of one per call. After each interval one
probe is sent; a reply, or the cluster becoming ready, ends it. Commands
sent through sendAsUndo, blocking commands, CLUSTER commands and
duplicate() clients are not held back. A pipeline is admitted or
rejected as a whole.

* fix(redis): undos of a timed-out command are sent while failing fast

The metering negation, slot ZREM, upload and credit-hold releases and
the lock's token-checked delete go through sendAsUndo, so they still
queue behind the original that may land. A command rejected unsent is
not a timeout, so it triggers no undo.

* test(auth): the sign-in relay completes within one command timeout under a stall

/login/set and /login/wait against a cluster whose node never answers
now finish in about one timeout, since calls after the first fail fast.

* style(redis): one-line comments, and types.ts keeps its existing formatting

* fix(redis): releases are sent while failing fast and not waited on

The lock release, concurrency-slot release, credit-hold release and
upload-lease release and settle go through sendAsUndo, so resources
taken before the breaker opened are freed rather than held for their
TTL. They are sent without awaiting; later commands on the same key
queue behind them. The KV and memory slot backends are still awaited.

* fix(redis): a retried pipeline is timed again, and only replies end failing fast

Pipeline commands whose error reply cleared their timer are re-armed when
the pipeline resends them after MOVED, ASK or a closed connection, and
the ASKING command it adds is always admitted. Only a reply, including an
error reply, counts as an answer: a closed connection or an ended cluster
no longer ends failing fast.

* fix(rate-limit): window take-backs are sent while failing fast, and a release never rejects

The ZREM or DECRBY that takes back a denied window charge goes through
sendAsUndo without being awaited, and the request is still denied. A slot
release that throws synchronously is logged, not rejected, and the
release() doc says when it settles.

* fix(broadcast): a publish failing fast warns once per stretch, not once per event

Warnings for publishes rejected with 'Redis unavailable' are skipped
until a publish succeeds again; other failures still warn every time.

* test(redis): timing bounds name their command timeout and leave CI headroom

The relay test sets a 1000 ms timeout and checks it finishes within one
timeout rather than two; the release timing bound is 250 ms.

* style(broadcast): shorter comment on the publish warning

* fix(metering): the cached base is dropped while failing fast, without waiting

forgetBase sends its DEL through sendAsUndo, so after a write-through it
still queues behind the timed-out increment and its undo instead of being
rejected unsent. incr no longer awaits it on the request path; the
MeteringService callers still do.

* fix(redis): a command rejected while failing fast is handled, so one nobody awaits can't end the process

* style(types): unrelated interfaces keep the formatting lint expects

* fix(cache): invalidations are sent while failing fast, so a write during a stall doesn't leave the old entry cached

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-16 09:20:13 -07:00
Juan Fernando CastroandDaniel Salazar d51fc36563 fix(user): account deletion marks memberships first, and a deleted issuer's grants count nowhere (#4655)
* fix(user): account deletion marks the account's group memberships before the row goes

The account's group reads go to the primary while its memberships cascade
away with the row, and its permission cache generation is bumped after the
delete. Both are best effort and never stop the deletion.

* test(user): format the account deletion tests

* fix(user): account deletion refreshes the readings of those it granted to

Before the row goes, members of the groups the account granted to are
read from the primary and marked; after it, they and the holders of its
user-to-user grants have their permission cache generations bumped.
Both reads are bounded and best effort.

* test(user): clear a mark a reused account id may carry before the issuer delete

* fix(user): account deletion bumps cache generations after the flat purges

* fix(permissions): a deleted issuer's user-to-user grants are listed from the primary

* refactor(permissions): keep the held-purge constants under their comment

* fix(permissions): a flat entry whose issuer account is gone grants nothing

* fix(permissions): flat entries whose issuer account is gone count nowhere and are deleted when found

Manage inheritance and share listings skip them as the flat check does,
through one store helper that also deletes them off the request path.

* docs(permissions): one-line note on the orphaned flat entry helper

* fix(permissions): an issuer missing from a replica batch is re-read from the primary before its entry is dropped

Only ids absent on the primary count as gone. Entries naming no usable
issuer are kept, and an orphaned entry is deleted only while it still
names the gone issuer. The helper hands back the issuers it read, and
the flat readers use the ref-keyed read.

* fix(permissions): missing issuers are re-read in one primary query; flat-entry tests wait on the background work

* fix(permissions): share listings pass the users they already read to the orphaned-entry check, so it reads no issuer twice

* fix(permissions): account deletion drops the cached grant rows of the holders it issued to, so a manage grant from it stops passing down

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-16 09:09:12 -07:00
Juan Fernando CastroandDaniel Salazar 768b52c10e refactor(push): push database and key names are written once, and the desktop reads its push record through puter.js (#4653)
* refactor(push): the database and key names are written once for the page and both workers

pushNames.js holds the puter-push database name, its stores, key prefixes
and the subscription-changed message. pushStore.js re-exports them.

push-sw.js and the GUI's sw.js are served as they are (push-sw.js also
from npm's src/), so neither can import the module. Each carries a block
generated from pushNames.js by tools/pushWorkerNames.mjs. The puter.js
webpack build and the GUI build fail while either block is stale, and a
test compares the names in both worker sources with the page module's.

* refactor(push): the desktop reads the confirmed endpoint and the mark through puter.js

puter.js now records the endpoint the server confirmed, and clears the
subscription-changed mark, inside the Puter GUI as on a website. Three
internal methods give the desktop what it kept itself: _webPushRecord()
reads both, _noteWebPushSynced() records an endpoint a status check
confirmed, and _dropRemovedWebPush() ends a removed subscription and
forgets its receipt and the mark.

webPushClient.js no longer opens the puter-push database or keeps its
own localStorage record. An endpoint an earlier build kept there is read
while puter.js has none, and removed once puter.js records one, so an
already synced browser keeps its status without registering again. With
a puter.js that lacks the methods, the client reads nothing from it and
keeps the old record.

* refactor(push): one-line comments on the push names and the record methods

* fix(push): the worker names check reads CRLF checkouts, lives in tools/ and runs in PR CI

The block helper moves to tools/pushNamesBlock.mjs, so it isn't part of
the published puter.js sources. It compares and rewrites on LF text and
writes back the file's own line endings. Both workers are pinned to LF
in .gitattributes. The puter.js tests run when the GUI's sw.js or its
build changes, and the GUI build checks sw.js before anything else.

* fix(push): the desktop keeps a removed browser off with a puter.js that has no push record

The desktop loads puter.js from its own URL, so it can run one without
_webPushRecord(). The client then uses pushStore.js's helpers itself: it
reads and clears the subscription-changed mark, ends a removed
subscription and forgets its receipt and the mark, clears the mark after
enable(), and keeps the confirmed endpoint in localStorage as before.

_noteWebPushSynced() resolves whether it recorded the endpoint, and the
localStorage endpoint is removed only after puter.js has it. A cached
status reads only the mark before answering. The accessors carry JSDoc
types.

* fix(push): the removed-elsewhere check also asks about the endpoint in localStorage

When loads alternate between puter.js versions, localStorage can hold a
newer confirmed endpoint than puter.js does. The background check now
asks about both, with the mark's old endpoint, before registering.

* fix(push): with an older puter.js the desktop also asks about the endpoint puter.js recorded

Once puter.js has recorded the confirmed endpoint, the desktop drops its
localStorage copy. A later load that runs an older puter.js then read
neither, so a browser that lost its subscription after being removed in
Puter could register again. The fallback now reads puter.js's record from
the store directly.

* refactor(puter-js): the push record reads use try/catch instead of .catch()

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-16 09:06:23 -07:00
Juan Fernando CastroandDaniel Salazar e7641676a2 feat(puter-js): enable() takes a background option, and the desktop's push sync uses it (#4634)
* feat(puter-js): enable() takes a background option that never prompts or opens sign-in

* fix(gui): background push sync calls enable({ background: true }) and shares puter.js's message name

* fix(puter-js): background enable() on a website needs the user's opt-in here and returns false outside web and gui

* fix(gui): push client reports unavailable push apart from permission and reads store names from puter.js

* fix(puter-js): notifications methods type-check when called on puter.notifications

* fix: background enable() stops when push is turned off meanwhile, sync reports unavailable push

* fix(puter-js): background enable() resolves false when pushes are turned off while it runs

* test: background enable() rejections use rejects matchers, not .catch()

* docs(puter-js): enable()'s background option gets its own section and lists its session errors

* fix(push): the desktop calls enable({ background: true }) only on a puter.js that takes it

An older puter.js ignores the option and runs the call as a click, which
replaces a browser removed in Puter and can open a sign-in. puter.js now
says it takes the option, and without that the desktop keeps the internal
background call it used before.

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-16 09:06:23 -07:00
404oops f4568a20c7 Use regular GPT-5.6 Sol token prices 2026-11-16 17:01:32 +01:00
Nariman JelvehandClaude Fable 5.2 c89daae557 docs: state the 200 MiB free filesystem quota (#4664)
The rate limits and quotas page gave the free quota as 100 MiB, the
checked-in storage_capacity default, where puter.com gives 200 MiB.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 08:56:42 -07:00
小卡塔克andDaniel Salazar cc48b25074 fix(net): make off() undo alias-registered handlers and emit drain (#4466)
* fix(net): make off() undo alias-registered handlers and emit drain

* fix(net): skip drain on a closing socket, document off() and drain timing

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-16 08:36:35 -07:00
404oops 24488dc483 Fund Gemini speech routing test reservations at regular rates 2026-11-16 14:45:06 +01:00
404oops 62cb99b8a8 Use regular Gemini model prices throughout launch promotions 2026-11-16 14:44:36 +01:00
404oopsandClaude Opus 5.5 b42c6f1448 Share the AWS price list parsing between Polly and Textract
Polly and Textract each carried their own copy of the AWS price list
fetch, region check, term checks and USD conversion. The AWS-specific
parts now live in providers/aws/priceList.ts and the exact USD to
microcent conversion in shared/catalogPrice.ts. Each service keeps only
which products it reads and which tier it bills from.

Polly's price list fetch now refuses redirects, as Textract's already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:34:44 +01:00
404oopsandClaude Opus 5.5 1276765a5c Move the Polly and Textract providers into providers/aws
Both are AWS services, so they share one vendor folder like every other
vendor: providers/aws/textToSpeech and providers/aws/ocr. Files move as
they are; only the four imports that point into them change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:34:37 +01:00
Filip Kujundžić 69009706b6 Merge pull request #4660 from HeyPuter/DS/textract-region-fallback
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
2026-11-16 09:57:07 +01:00
Daniel Salazar 214f189a1a fix(ai): Textract OCR sends a file's bytes to the configured region when its bucket's region has no Textract
Textract reads S3 objects only from a bucket in its own region, and AWS
doesn't run Textract in every region. A file whose bucket is in a region
without Textract is now sent as bytes to the configured Textract region and
billed at that region's rate.

The provider decides this before any Textract call, from the bucket region's
public price list: AWS publishes one for each region it runs Textract in and
answers 404 for the others. The price cache keeps that 404 as an answer for
its normal lifetime instead of retrying it as a failure, and the credit hold
for such a call is sized from the configured region's rate alone.

When the price list can't be loaded, an S3 read whose Textract hostname
doesn't resolve (ENOTFOUND) falls back to the bytes the same way. Any other
error from the bucket's region surfaces as before.
2026-11-16 01:27:57 -07:00
Neal Shah f9e25c2754 puterjs nodejs fixes (#4659)
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
2026-11-15 21:30:34 -05:00
Neal ShahandClaude Opus 5.5 237ff84cc5 feat(hosting): sites list their custom domains, and hosting.detach() removes them (#4651)
* feat(hosting): sites list their custom domains, attach names a moved domain's old site, and hosting.detach() removes domains

- puter-subdomains read/select return `custom_domains` ({ uuid, hostname,
  status }) per site, filled by a `site.customDomains` event listener. Only
  rows attached under the site's current owner count; the field is left out
  when the listener fails, so a failed lookup never reads as "no domains".
- The attach dialog's answer carries `previousSite` when the user moved the
  domain from another site, kept through a status check or switch to www.
- puter.hosting.detach(subdomain) opens the custom domain dialog in a
  remove-only mode (desktop message, frame, or popup) and resolves the
  domains the user removed, or []. Desktops advertise it as
  `custom-domains-detach`; older ones reject with not_supported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(workers): expect the sandbox-owner message create() throws now

create() rejects another user's sandbox app with "The sandbox app '…'
belongs to another user…" since the workers name-cap fix; the deploy test
still expected the old wording and failed on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:02:07 -05:00
Nariman Jelveh 1c67f93726 refactor(gui): blocked people and the 2FA dialogs open as dashboard dialogs instead of windows (#4658)
* refactor(gui): blocked people opens as a dashboard dialog instead of a window

* refactor(gui): enabling and disabling 2FA open as dashboard dialogs instead of windows

* fix(gui): blocked people ignores a block list that arrives out of order

A list answered after a newer one no longer replaces it, and a list
requested before the refuse-everyone switch was changed no longer sets
the switch back.

* fix(gui): an unblocked person leaves the blocked people list once the server confirms

The row no longer waits for the list to reload, so a reload that fails
doesn't leave it behind with a disabled Unblock button.

* fix(gui): the blocked people list stops reporting itself as loading when it fails to load

* fix(gui): typing into a filled 2FA setup code box replaces its digit

A box takes one digit, so a filled one ignored what was typed until it
was cleared by hand. Focusing a box now selects its digit.

* fix(gui): a 2FA setup code entered right after a refused one is kept

After a refused code, focus returns to the first box at once instead of
dropping to the page, and a code typed or pasted while the refused one
is still showing replaces it instead of being cleared with it.

* fix(gui): the 2FA setup Copy buttons say copied only when something was copied

Without clipboard access (a plain-HTTP origin, or a refused permission)
the secret and recovery-code buttons reported a copy that never
happened. They now fall back to selecting the text for the legacy copy,
through the helper the custom domain dialog already had, and stay as
they are when that fails too.

* fix(gui): blocked people gives keyboard focus back to the control that was used

The switch and the Block and Unblock buttons are disabled while their
request is out, which drops focus. It went to the card, so the next Tab
started over from the close button; it now returns to the control.

* fix(gui): the 2FA switch waits for a request still out when its dialog is closed

Closing the enable or disable dialog while its request was out reported
a failure at once, so the Security tab kept showing the old state after
the server made the change. The dialogs now report the server's answer.
2026-11-15 17:26:12 -07:00
Nariman Jelveh 222fadf432 refactor(gui): the emoji language is removed from the language list (#4657)
* refactor(gui): the emoji language is removed from the language list

An account that saved it renders in English.

* refactor(gui): translation keys no code reads are removed from every language

Covers keys English no longer defines as well. Keys built at runtime
(share link notes, permission lines, plan names) stay.

* revert(gui): the unused translation keys are restored in every language
2026-11-15 16:17:55 -07:00
jelveh 6539c09a55 feat(gui): usage details on the dashboard Usage tab are collapsible and start hidden 2026-11-15 16:00:46 -07:00
Daniel Salazar 7c6427b0e6 feat(auth): the authorization dialog and token label name where an MCP sign-in ends up (#4652)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
The MCP connector puts the host of the client's redirect URI on its own
callback URL (`forwards_to`) and completes a flow only when that exact value
comes back with it.

The authorization dialog reads that name off a redirect under the deployment's
own domain and leads with it, with the relay named beneath. A name given by any
other host, or by a page on the hosting domain, is ignored. The token minted for
the grant is labelled with both hosts, destination first.
2026-11-15 00:47:49 -07:00
Neal ShahandClaude Opus 5.5 e7bc94029c fix(workers): name length cap, sandbox app freed on delete, no app opens from workers (#4631)
- Worker names are capped at 50 characters, the most a `workers.puter.<name>`
  subdomain row holds. A longer name is a 400 before any token is minted,
  instead of a 500 from the insert. The publish dialog caps at 50 too.
- Deleting a worker deletes its `sandbox-<name>` app when nothing else runs
  as it, so the name can be reused by another user. A sandbox app owned by
  someone else rejects with `sandbox_not_owned` instead of a TypeError.
- POST /rao records nothing for a worker or events handler actor, and the
  worker runtimes' clients no longer ask.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:28:31 -05:00
Juan Fernando CastroandDaniel Salazar 9e102909d9 feat(puter-js): team members carry passwordPending for the owner (#4646)
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* feat(puter-js): team members carry passwordPending for the owner

* test(puter-js): team members' passwordPending in the teams API suite

* test(puter-js): passwordPending wording, non-boolean inputs, and the member view's account shape

* docs(puter-js): one-line passwordPending description

* docs(puter-js): listMembers description covers the owner's passwordPending

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-14 17:20:27 -07:00
Juan Fernando Castro 7e419e722f fix(puter-js): status() in the desktop reads off when the account has no device in this browser (#4633)
* fix(puter-js): status() in the desktop reads off when the account has no device in this browser

* refactor(puter-js): status() reads the device list through listDevices' request and a shared current-device rule
2026-11-14 17:20:22 -07:00
Juan Fernando Castro bd50fde0b1 feat(auth): end every session of several users in one batch (#4603)
AuthService.revokeAllSessionsForUserIds reads the listed users' sessions from the primary and cascades them together, 200 users at a time, and still announces each user's revocation on its own. revokeAllSessionsForUserId is its one-id case. SessionStore.getByUserIds is the batch reader, and getByUserId calls it.
2026-11-14 17:20:09 -07:00
Nariman Jelveh 490abccd6d fix(gui): password strength check counts any symbol, punctuation, or space as a special character
A password whose only special character was ~, a backtick, a space, or a
non-ASCII symbol such as € was rejected as having none.
2026-11-14 16:14:17 -07:00
Filip Kujundžić 9b64d44d5f Update CODEOWNERS file (#4645)
Pretty self-explanatory. Could broaden responsibility and review processes...
2026-11-14 14:04:13 -07:00
Daniel Salazar 9ca1acf634 Benchmarks that gate PRs on I/O regressions, wider test baseline, and npm run check (#4644)
* feat(bench): backend benchmarks that fail a PR for waterfalled or uncached I/O

A scenario runs a request against the in-memory backend and records every
SQL, key-value, Redis and object-storage round trip on a modeled clock, then
reports round trips per destination, serial stages and modeled latency.
tools/bench.mjs runs the scenarios on a base commit and on the head and fails
on a regression the pull request description does not accept; benchmarks.yaml
runs that on every pull request.

Also adds npm run check (lint, type check, related tests and the benchmark
comparison for the files a branch changed) and describes the distributed
deployment in AGENTS.md.

* test(bench): scenarios for fs, kv, auth, apps, permissions, sharing and hosted sites

* test(puter-js): count the SDK unit tests in the coverage report

Only the bundle the API runners load was instrumented, so the unit tests next
to the SDK source never counted. In coverage mode the vitest config now
instruments SDK source for them and writes one shard per test file.

* test(puter-js): unit tests for ui messaging, dialogs, components, uploads, peer and smaller modules

* test(backend): cover fs, permission, app, worker, sharing, broadcast and user edge cases

* fix(backend): fs write flags are stored as booleans, app stats weeks are ISO weeks

- A write's boolean flags reach the store only once read as booleans; any
  positive number reads as true.
- App open stats grouped by week use ISO 8601 weeks for both the buckets
  and their labels on every database engine, so the two agree across a
  year boundary.

* fix(puter-js): dialog token source, legacy upload cancel, submenu state, typed-array views

- The sign-in dialog takes the token only from the popup it opened, and
  stops listening when it leaves the page.
- Cancelling a legacy upload rejects with `upload_aborted` and no longer
  runs the `error` callback.
- A context menu's submenu stays in step with its parent when the parent
  item is pressed or the submenu closes itself.
- The FileReader polyfill reads a typed-array view through its own offset
  and length.

* ci(bench): benchmark a pull request as merged into its base

The comparison ran the branch's own head against the tip of the base
branch, so a branch behind its base was charged for (or credited with)
what the base gained since. The head side is now the merge commit and
the base side its first parent. Shards also get a 15 minute timeout.

* test(broadcast): shutdown drain tests send boot's own events first

Boot queues cache updates that flush 10 ms later. A test body that
started after that flush counted it as its own request, which failed
'bounds a hung flush in onServerShutdown' on a slow runner.
2026-11-14 13:57:03 -07:00
Daniel Salazar 679f577cd8 feat(ai): a declined Claude request reruns on a fallback chain, and its conversation stays on the model that answered (#4641)
* Rerun declined Claude requests on Anthropic's fallback model

A Claude model with safety classifiers can decline a request and end it with
stop_reason "refusal". Requests to the models that have server-side fallback
(Fable 5.2, 5.1 and 5, Opus 5.5 and 5, Sonnet 5.5) now carry
`fallbacks: "default"` and the server-side-fallback beta, so Anthropic reruns
a declined request on the model it recommends for that refusal and the caller
gets that model's answer in the same response.

- `refusalFallback: false` turns it off for a request. The Anthropic route
  takes the native `fallbacks` field instead: "default" or a list of models is
  the caller's own chain, null turns it off.
- The `fallback` content block is a `refusal_fallback` chunk in a stream and
  `refusalFallbacks` on a non-streaming result, where it is taken out of
  `message.content`. The Anthropic route writes it back as a native block and
  accepts it in replayed messages.
- `usageDetails.fallbackModel` names the model that answered.
- A final refusal is forwarded as before, without the fallback-credit fields
  of `stop_details`.
- A request Anthropic rejects over a fallback the caller did not ask for is
  sent again without it.

* Meter each Claude fallback attempt on the model that ran it

A request Anthropic reruns on a fallback model is several attempts, each
billed at its own model's rates. `usage.iterations` carries one entry per
attempt and the top-level counts describe only the attempt that answered.

- Every attempt is its own charge, priced at the rates of the model that ran
  it and recorded under that model's key: the answer from the top-level
  counts, each declined attempt from its iteration entry. Nothing is counted
  twice, and a fast request's attempts are priced at each model's fast rates.
- The reported `usage` keeps the answering attempt under the plain keys and
  adds a declined attempt's tokens under `declined_` keys. Like the advisor's,
  only their recorded cost prices them, and they are no part of the request's
  own prompt or output totals.
- A provider's `requestPricing` can name the models the upstream may rerun
  the request on. The credit gate then prices the prompt and the capped
  output once per model, each at its own rates and cost factor, for the
  affordability check, the output cap and the hold. Claude names the priciest
  target of default routing, or every model of a chain the caller named.

* Charge a declined Claude request only when Anthropic bills it

Anthropic bills a request its classifiers decline before any output only in
the bio, frontier_llm and reasoning_extraction categories; any other
category, or none, is not billed. A request declined after it produced
output is billed for its prompt and that output.

Metering follows the same rule for each attempt: the final refusal by its
`stop_details.category`, and an attempt that declined before a fallback by
the `trigger.category` of its `fallback` block. An attempt Anthropic does not
bill is recorded with its token counts at no cost. An attempt whose refusal
details are missing is charged as before.

* Estimate images inside tool results as attachments

The credit gate's prompt estimate read a `tool_result` as the text of its
serialized content, so a base64 image inside one counted as text, at many
times the tokens the image costs. An image or document block inside a tool
result is now estimated the way a top-level one is, from its payload size.
Text and other blocks in the result are counted as before.

* Name each Claude model's fallback chain, and keep a declined conversation on the model that answered

A request to a Claude model with fallback targets names them in order
(Opus 5, then Opus 4.8) instead of asking for default routing, which
leaves some refusal categories declined.

puter.js remembers the model that answered a declined turn and names it
on later turns of the same conversation, so they skip the declined
attempt. The backend runs such a request on that model and presents it
in the requested model's response format.

* Rerun a declined Claude request from the driver, one attempt at a time

A request a Claude model declines is now rerun by the chat driver on the
model's fallback models, instead of by Anthropic inside the same API call.
The request sent upstream is the same as before this branch: no `fallbacks`
field and no extra beta header.

Each rerun is a whole attempt of its own. It goes through the credit gate
against the balance left after the declined attempt, takes its own hold once
the declined attempt's hold is released, and is metered by the provider under
its own model. A request reserves one attempt at a time, as any other chat
request does. When the balance can't cover the rerun, or the rerun fails, the
response is the refusal.

A non-streamed request is rerun on any refusal. A streamed request is rerun
only when it was declined before any output, and the answer follows a
`refusal_fallback` chunk on the same stream. The response reports the model
that answered in `usageDetails.fallbackModel`, each switch in
`refusalFallbacks`, the declined attempts' tokens under `declined_` usage
keys, and the total charged in `usage.cost`. It keeps the requested model's
format.

A conversation pinned to a fallback model that declines continues down the
rest of the requested model's fallback models. The Anthropic route reads
`fallbacks: null` or `false` as an opt-out and ignores any other value.

Claude restores `puter_path` parts after a refusal, so a rerun uploads the
files again.
2026-11-14 13:04:39 -07:00
Daniel Salazar 04b9244913 feat(workers): a suspended account's workers stop serving until the suspension lifts (#4649)
Suspending an account already made its hosted sites answer 404, but its
deployed worker scripts kept running.

- On `user.suspended` the worker driver removes each of the owner's deployed
  scripts and keeps the rows. On `user.unsuspended` it deploys them again
  from their source files, without the per-worker notification. The local
  runtime needs no redeploy: it builds a worker from source on its next
  request.
- Hot reload skips a suspended owner, so a write by someone the source file
  is shared with does not bring the script back.
- The local worker runtime answers 404 for a suspended owner's worker
  instead of deploying it on demand.
2026-11-14 12:47:55 -07:00
Daniel Salazar bc456982e9 feat(metering): events for an actor's balance and for a refusal a listener can make good (#4643)
* feat(metering): report an actor's balance each time it is worked out

`metering.balance` carries what an actor on a metered plan has left to
spend and the plan it was worked out under. It is emitted when usage
settles and when a credit gate re-reads the balance, so an extension can
act on a low balance without reading it itself.

The balance a settling batch reports now counts the purchased credit
that batch drew, so the credit gate and the exhausted notice follow the
batch that spends the last of it instead of the one after. A batch that
settles right after a credits change still reports the credit as read,
since that read may predate the change.

`MeteringService.isUnmetered` is public, for callers that need to tell a
plan with nothing to run out of from one that has run out.

* feat(metering): let a listener top an actor up at the moment of refusal

`metering.out-of-credits` is emitted, and waited on, when an actor is
about to be refused for lack of credit. A listener that adds credit sets
`refilled`, and the refused work is tried once more instead of failing.

It is asked from the three places a refusal is decided: the credit gate
on routes, the shared credit reservation the AI drivers use, and the
chat driver's own gate. Each tries again once, after the listener
answers, and refuses as before when nothing was added.

* fix(metering): count a flush's write once in a read with no cached base

An increment for a counter with no cached base read the store after its
buffer snapshot with nothing ordering the two, so a flush landing in
between was counted from both, and that store read was then kept as the
base. It now reads the store the way other reads do, starting from the
increment's own snapshot.

A write that has reached the store but is not yet applied to the buffer
looks the same from the buffer as one still on its way. `kv.get` can now
answer with the last fence token a writer applied to a key, and a read
counts such a write's amounts from one side only. A read that sees a
write sent between its snapshots is retried.

A base is laid from a store read only if no write was out when it was
read and none has been sent since.
2026-11-14 12:43:02 -07:00