Commit Graph
508 Commits
Author SHA1 Message Date
Daniel Salazar 6b8af52077 feat(auth): sign-in pipeline, per-account wrong-password budget and idle session expiry (#4692)
Sign-in
- One sign-in path (SignInService) for password, 2FA, recovery code, signup
  and OIDC. It emits puter.signin.attempt (before the account lookup on
  POST /login), puter.signin.validate (before the session is created) and
  puter.signin. Listeners can refuse or require phone or card verification; a
  listener that throws is ignored.
- POST /login keeps a wrong-password budget per account across all networks,
  20 an hour and 50 a day. A browser that has signed in to the account before
  is not refused, and the budget belongs to the current password.
- An account unused for dormantSignInDays (default 180) confirms an
  unconfirmed email at sign-in, where the deployment can send mail.
- New account emails: sign-in from a new browser, sign-in attempts blocked,
  password reset completed.
- pwnedPasswords (off by default): a k-anonymity range lookup after a
  successful password sign-in, with a notice to the owner.
- requestSignalHeaders and requestSignalValue turn configured request headers
  into req.requestSignals and a puter.request.flagged event.

Sessions
- web and app sessions end after 180 days without activity; accounts with no
  password and no email keep 365 days. A missing expiry on web, app and asset
  rows no longer means no expiry, and ended rows are purged.
- The cookie a private hosted site sets from ?auth_token= is tied to the
  token's session row and carries a 7-day expiry.

Email confirmation codes
- A 6-digit code is valid for 60 minutes and has a wrong-code budget.

Mailbox ingress
- email.ingress.validate runs before a message is stored; a listener can refuse
  it or record a sender check. X-Puter-Sender-Auth is written by the server
  only. Header blocks over 256 KiB are refused.

GUI
- Login sends the device fingerprint, can show the captcha widget
  (gui_params.turnstileLogin), offers a password reset when sign-in is locked,
  and runs pending verification windows after a popup sign-in or signup.
2026-11-18 23:02:16 -07:00
Nariman Jelveh 6598d798ea feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail (#4693)
* feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail

The desktop draws the start of a .js, .mjs, .cjs or .css file in a
fixed-width font with its tokens colored, and a .md or .markdown file as
the page it describes: headings, paragraphs, lists, quotes, code and
tables. Both go through the page drawer the Word readers use, which now
takes a font family per run and paragraphs that don't wrap.

Only the first 16 KiB of these files is read. The dashboard downloads
only that much when it makes a thumbnail for one that has none, so the
file size limit doesn't apply to them. An upload draws them one at a
time for at most 2 seconds; the rest keep their icon until the
dashboard shows them.

* fix(thumbnails): a <br> in Markdown breaks the line instead of joining the words around it

* fix(thumbnails): HTML headings and centered blocks in a README are drawn as GitHub shows them

An <h1> after other HTML lines was drawn as body text, joined to the lines
before it, and a block's align was ignored. HTML block tags now start and end
a block of their own, and align="center" or "right" on them, or a <center>,
is kept.

* fix(thumbnails): code fenced inside a Markdown list item is drawn as code

A fence indented four spaces under a list item was read as paragraph text,
so its backticks and lines were drawn joined on one line. A fence at any
indent now starts code, drawn under the item it belongs to without the
fence's indent.

* fix(thumbnails): every row of a Markdown table keeps the header's columns

A row with fewer or more cells than the header split the page's width its
own way, so its cells sat under the wrong headings. Rows now take the
header's columns, an escaped bar stays in its cell, and each column is
aligned as the row under the header says.

* fix(thumbnails): text after a Markdown table is spaced from it as from a paragraph

The line after a table sat as close to its last row as the rows sit to each
other, so it read as another row.

* fix(thumbnails): an empty Markdown heading draws nothing instead of a #

* fix(thumbnails): a Markdown task list shows boxes instead of [ ] and [x]

* fix(thumbnails): a GitHub alert in Markdown shows its title instead of [!NOTE]

* fix(thumbnails): the dashboard asks for only the first 16 KiB of a text file, whatever its listed size

A source or Markdown file listed at 16 KiB or less was downloaded whole, so
one that had grown since it was listed was fetched up to the 20 MiB cap to
read its start.

* fix(thumbnails): an HTML comment inside Markdown code is drawn as code

Comments were removed from the whole file before it was read, so a code
sample lost the <!-- file name --> comment it opens with, and an unclosed
<!-- in a code sample hid the rest of the document. Comments are now
left out only outside code.
2026-11-18 19:59:25 -07:00
Nariman Jelveh e62418f7a9 fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard (#4691)
* fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard

An overwrite clears a file's thumbnail and nothing made a new one, so a file
an app saved over lost its picture, and files apps created never had one.

The dashboard now makes a thumbnail for a file with none as its row comes
into view, with the upload thumbnail generator, within budgets on size,
downloads at a time, files per minute, and bytes per page load. A version
that gives no thumbnail is remembered so it isn't downloaded again.

/update-fsentry-thumbnail takes an optional expectedModified and refuses a
thumbnail made from an older version with 409, tells the owner's other
clients about the new thumbnail, and has its own rate-limit scope instead of
sharing the one opening a file uses. Overwrites and replacements emit
thumbnail.discarded, and the thumbnails extension deletes the object behind
it, so replaced thumbnails no longer stay in the bucket.

* fix(thumbnails): expectedModified must be a whole number of seconds the column can hold

A fraction or a value past the column's range reached the UPDATE, which
Postgres refuses with an error after the thumbnail was already uploaded.
The route now answers 400 before it uploads anything.

* fix(thumbnails): setting a thumbnail keeps the current one when the new one can't be stored

The route stored whatever the thumbnail.created listeners left behind:
a pointer whose upload failed, or the null left for an image that can't
be decoded. Either replaced a working thumbnail and answered 200. It now
answers 500 or 400 and leaves the entry as it was.

* fix(thumbnails): the update announced after setting a thumbnail carries the entry's current name and path

The event was built from the entry read before the thumbnail was
uploaded, so a rename or move that landed during the upload was
announced with the name and path it had just replaced, and open clients
put the row back on a path that no longer exists. The entry is read
again after the thumbnail is stored.

* fix(thumbnails): a file that stops needing a thumbnail is no longer downloaded for one

A file waiting its turn, or already downloading, was still read and its
thumbnail stored after another tab had made one, or after the file was
saved again as something the generator can't read. A queued file is now
checked again before its download starts, and a change that makes the
thumbnail unwanted drops the queued job and cancels the download.

* fix(thumbnails): refreshing the folder on screen keeps its thumbnail downloads

A refresh of the folder on screen (a sort, a view switch, an upload
finishing, coming back to the tab) cancelled the downloads under way.
The rows drawn right after were skipped, because their files still
counted as being tried, so they stayed without a thumbnail until some
later render. The rest were downloaded again from the start.

A download is now cancelled only if its file's row isn't drawn again in
the same task, and the new row takes it over. A row that comes back
while a cancelled download is still ending is queued again.

* fix(thumbnails): a stored thumbnail is recorded on the row's own entry

The filler handed its callback a copy of the row's entry, so the
thumbnail was written to an object nothing else reads, and the row's
entry kept saying the file had none. It now passes the row's entry, and
skips a row whose file was saved again while the thumbnail was being
stored, which would otherwise show the older version's picture.

* fix(thumbnails): the download budget counts the bytes that were downloaded

A cancelled download gave its whole size back to the page's download
budget, though the bytes it had received were already billed as egress.
A file saved over and over while its row was on screen could be started
again each time, well past the budget. A download the server refused
kept its size charged with nothing downloaded.

The file is now read as a stream and the budget is charged what arrived.
Reading also stops as soon as a file turns out to be over the size cap,
where before a file larger than its listed size was buffered whole.

* fix(thumbnails): a thumbnail download that fails to connect is tried again

A download that failed on the network counted as tried, so the file went
without a thumbnail for the rest of the page load. A laptop waking before
its Wi-Fi is back marked every row on screen that way. A failed
connection now pauses the filler like a 429 does, and the file is tried
again after the pause.

* fix(thumbnails): a thumbnail that couldn't be stored yet is sent again, not made again

When storing a thumbnail got a 429, the file was queued again and
downloaded a second time after the pause. When the request failed to
connect, the thumbnail was dropped and the file went without one. The
thumbnail is now kept with the queued job and sent again after the
pause, as long as the file is still at the version it shows.

* fix(thumbnails): a file whose thumbnail the server refuses isn't downloaded again on every page load

When the server answers 400 for a thumbnail, the file's version is now
remembered like one that gave no thumbnail at all. It counted as tried
for the page load only, so each later page load downloaded the file and
sent the same image again.

* fix(thumbnails): only pictures a browser can draw are downloaded for a thumbnail

Any file typed image/ counted as one the generator reads, so TIFF scans,
CAD drawings, DjVu books and the like were each downloaded in full, up
to 20 MiB, to make a thumbnail no browser can draw. A file is now
downloaded only when its type or name is one browsers decode. Uploads
are unchanged: the generator still tries any image there, where the file
is already local.

* fix(thumbnails): missing thumbnails are downloaded one file at a time

Each download holds one of the account's concurrent file reads until it
ends. Two at a time left a temporary account, which has three, a single
read for everything its apps do, so an app reading two files at once got
a 429 while a folder's thumbnails were being filled in. The per-minute
cap of 20 files already bounds how fast they're made.

* fix(thumbnails): an update refreshes the icon of every item it matches

An update can match the Files row and the same item in a file dialog
open over the dashboard. The row updater set the new thumbnail on the
first match only, where it used to set it on all of them.

* perf(thumbnails): an update works out a row's icon again only when its thumbnail changed

Every update event carries a thumbnail key, so the row updater worked
out the icon on each one. For a .app file or a web link that reads the
file, once per event. The icon is now refreshed only when the event's
thumbnail differs from the one the row has.

* perf(thumbnails): drawing a large folder doesn't rescan the thumbnail queue for every row

Each row handed to the filler went through every row queued before it,
looking for a job to start, so drawing a folder of files without
thumbnails took the square of its length: about a second for 20,000
rows. A row that isn't on screen yet has nothing to start, so the queue
is now only gone through when a row is reported on screen, a job ends,
or a wait is over.

* fix(thumbnails): one tab no longer drops the failed files another tab remembered

Each tab read the list of files that gave no thumbnail once, then wrote
its own copy back whole on every addition, which dropped whatever
another tab had added in between. Those files were downloaded again on
a later page load. The stored list is now read again and merged before
each write.

* perf(thumbnails): files downloaded for a thumbnail stay out of the browser's HTTP cache

The download asked the cache to revalidate, which still writes each
response to it, up to 100 MiB of originals per page load that nothing
reads back. The read route doesn't answer conditional requests, so a
cached copy could never save a download either.

* bench(thumbnails): scenario for setting a file's thumbnail from the dashboard

The dashboard calls the route for each file it fills in a thumbnail
for, up to 20 a minute, so its round trips are measured from here on.

* docs(thumbnails): list the picture formats downloaded for a missing thumbnail

* perf(thumbnails): setting a thumbnail reads the entry again alongside the write, not after it

The read that keeps the announced name and path current ran after the
update, which added a serial round trip to the route. It now runs with
the update. The window it closes is the upload before both.

* feat(thumbnails): a file saved over keeps showing its old thumbnail until the new one is ready

A save cleared the row to its type icon for the few seconds it takes to
make the new thumbnail, so a file an app saves repeatedly flashed
between the two. The row now keeps the old thumbnail while a new one is
on its way.

It goes back to the type icon at once when no thumbnail will be made
(the file is too large, the download budget is spent, the filler is
paused), as soon as the attempt fails, and after 10 seconds at most,
counted from the first save, so an old picture can't stay on a file
that keeps changing.

* fix(thumbnails): a document gets its thumbnail when the view goes to the list and back while it's made

A list row shows a document's type icon, so switching to the list gave up
on the thumbnail being made for it. Switching back before that ended found
the version already tried and queued nothing, and the row kept its type
icon until the folder was drawn again. The row now takes the job back.

* fix(thumbnails): a file being saved waits to settle whatever the computer's clock says

The wait before a saved file is downloaded was measured from its modified
time, which the server sets, against the browser's clock. On a computer
whose clock runs a few seconds ahead the wait came out as zero, so every
save of a file an app keeps saving started a download that the next save
cancelled. A file an update just arrived for now waits at least two
seconds, the least it waits when the clocks agree.

* fix(thumbnails): an item in a file dialog gets a new thumbnail when its folder isn't the one on screen

The row updater only set a thumbnail through the entry a Files row
carries. An update for a file shown only in a file dialog, with another
folder open in Files, matched an item that has no entry, and the item
kept the picture it had.

* refactor(thumbnails): the row observer asks for no margin around the screen

The 200px margin never took effect. The rows scroll inside the listing's
own pane, and a margin on the viewport doesn't widen what that pane clips,
so a row was only ever reported once it was on screen. That's also what
the download budget is written for, so the option goes rather than being
made to work.

* test(thumbnails): a version tried once, a hidden tab, and a browser saving data

Three of the filler's cost guards had no test: a version whose thumbnail
the server turned away isn't downloaded again in the page load, nothing
starts while the tab is hidden, and nothing is downloaded when the
browser asks to use less data.
2026-11-18 18:58:43 -07:00
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 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
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ć 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
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 62cb99b8a8 Use regular Gemini model prices throughout launch promotions 2026-11-16 14:44:36 +01: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
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
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 e17783931f fix(ai): follow-ups to the AI driver stack: optional image type hint, stable fuzz cases, provider-only integration workflow (#4638)
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
* fix(ai): the image type hint only has to be a string when a request carries an input image

* fix(ai): OpenAI speech to text answers 400 to a prompt that is a list or an object

* test(ai): a fuzz case keeps its input and route when the catalog changes, and a suite that reaches no provider fails

* fix(ai): a model id with a colon after its vendor keeps its name when it is qualified

* fix(ai): the native Gemini request type accepts the xhigh effort Hydrogen takes

* style: restore the repo formatting in files the AI stack reflowed

* docs(ai): the image reference and quotas page cover Replicate's safety reruns

* ci: the AI provider workflow runs only the provider tests and passes every provider's key
2026-11-14 01:37:43 -07:00
Filip KujundžićandDaniel Salazar 1eed9659e2 Forward Claude inference speed from SDK chat options (#4627)
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-14 00:23:05 -07:00
Filip KujundžićandDaniel Salazar 4d4b0b0990 Qualify published chat model names while preserving routing aliases (#4624)
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-14 00:23:05 -07:00
Filip KujundžićandDaniel Salazar 4ec125bbc6 Add Gemini 4 Carbon, Gemini 4 Hydrogen and Kling 4 video models (#4616)
* Add Gemini 4 Carbon and Kling 4 video models

* Include Kling 4 models in the video driver catalog test

* Document the Kling 4 prompt limit for non-English text

Kling 4.0 and 4.0 Flash take 26,000 characters of English but 11,000
of other languages, with mixed text sharing the limit in proportion.
The video page and the quotas page said 26,000 for every prompt.

- txt2vid.md and rate-limits-and-quotas.md give both limits, the rule
  for mixed text, and the error each one returns.
- Puter still rejects only a prompt over 26,000 characters. Kling
  enforces the lower limit, and its refusal reaches the caller as
  `upstream_bad_request` with nothing charged. A test covers that path.

* Add Gemini 4 Hydrogen and cap unary Gemini 4 Carbon output

Google released `gemini-4-hydrogen` on 2026-11-12. It uses the same
native request shape as Carbon and Argon.

- Hydrogen is served natively at $1.50 input, $7.50 output and $0.075
  cached input per million tokens, with fast service at 1.8 times
  those rates. It accepts `low`, `medium`, `high` and `xhigh` reasoning
  effort, ignores temperature, and takes text and images.
- A Carbon response that isn't streamed is capped at 32,768 output
  tokens, as Argon's already is, and the credit hold is sized to that
  cap. Google reports this limit for both models. The cap is now a
  field of the native model options instead of a check on Argon's id.
- chat.md and rate-limits-and-quotas.md list Hydrogen's reasoning
  levels and limits and Carbon's unary cap.

* Move the reasoning_effort model list out of the chat options table

The `reasoning_effort` row in chat.md listed the models that read the
option. Model-specific details belong under Model-specific features,
which already gives each family's accepted values.

- The row no longer names models.
- The Gemini and Moonshot Kimi sections say that their other models
  ignore the option.

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-14 00:23:04 -07:00
Filip KujundžićandDaniel Salazar f6139147fd Hold the AI concurrency slot until a detached chat completion settles (#4615)
A chat completion keeps running for up to 10 minutes after the caller
hangs up, so the upstream can report usage. It now counts against the
caller's concurrency cap for as long as the upstream runs, instead of
until the response closes.

- The chat driver registers its upstream run with the request's
  concurrency slot, so `/drivers/call` keeps the slot until the
  upstream is done. The cleanup after it does not hold the slot.
- The route concurrency gate now uses the same CallSlot as
  `/drivers/call`: the slot is held until the response is done and the
  work the handler registered has settled. The OpenAI- and
  Anthropic-compatible chat routes register the completion, so a
  non-streaming call counts until the upstream answers too.
- CallSlot moves to core/http, since the route gate below the
  controllers uses it. The context key is renamed keepConcurrencySlot.
- rate-limits-and-quotas.md says a completion counts until the model
  finishes it, even after a disconnect.

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-14 00:23:04 -07:00
Reynaldi Chernando 9d3a049988 document puter.host behavior (#4606)
* document puter.host behavior

* update
2026-11-13 19:13:59 +07:00
Daniel Salazar b5e4f20087 fix: KV size and credit edge cases, a metering double count, site name caching, /token-read content type (#4618)
* fix(fs): /token-read serves a file with no known extension as application/octet-stream

* fix(kv): a value too large once stored rejects with value_too_large, and a consistent read of several keys is consistent

* fix(kv): remove on an account with no credits left removes the paths and returns null

* fix(metering): a buffered increment whose base read fails is not also written through

* fix(hosting): site lookups by name share one cache entry for every spelling

* fix(metering): an increment whose base read fails is written through and taken back out of the buffer

* fix(hosting): create stores a site name trimmed and lowercased
2026-11-12 20:49:51 -07:00
Juan Fernando CastroandDaniel Salazar 4a958b3ca1 fix(gui): desktop push status counts only Puter's devices and follows subscription changes (#4550)
* fix(gui): desktop push status counts only Puter's devices and follows subscription changes

- fix(gui): desktop push status counts only Puter's own devices
- fix(gui): the desktop keeps its push subscription when the browser replaces it
- docs(gui): shorten push comments to one line
- fix(gui): removed browsers stay off after a subscription change, and websites can reach Puter push
- docs(puter-js): fit the desktop push request comment on one line
- fix(gui): background push registration checks every earlier endpoint and waits out a 429
- fix(puter-js): inside the desktop, requestPermission leaves a held push grant to the desktop
- fix(gui): a browser that stays off after being removed forgets its receipt
- fix(gui): push status holds right after enable(), and a subscription change is picked up after a run in flight
- fix(gui): an app's push grant counts whenever the app list can't be read

* fix(puter.js): a held push grant is left to the desktop only when it says it answers push

The desktop lists `push-permission` in `puter.gui_features` on the app
iframe's URL. Without it the SDK settles a held `notifications:push` from
its own check, so a desktop whose requestPermission handler has no held
check shows no dialog for a grant the app already holds.

* fix(gui): a held push grant isn't asked again beside other access, and never counts without an app uid

requestPermission drops a push grant held for Puter's devices from the
dialog and asks only for what is missing. The app list lookup answers no
for a missing app uid, whatever the list says; an app the list leaves out
still keeps its grant, since the list is capped and can trail a grant.

* test(puter.js): e2e for a push grant the app already holds inside the desktop

A held grant resolves true with no dialog, and a request for it beside
access the app is missing shows only the missing access.

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-12 20:06:23 -07:00
Daniel Salazar cd3600bae9 fix(fs): overwrite a file in place when a write spells its name in another case or normalization form (#4620)
* fix(fs): overwrite a file in place when a write spells its name in another case or normalization form

* docs(fs): say a write needs overwrite off to get a new name beside a look-alike one
2026-11-12 20:02:39 -07:00
Daniel Salazar 36e2d199c8 fix(fs): refuse instead of replacing an entry whose name differs only by an emoji or accent (#4589)
* fix(fs): refuse instead of replacing an entry whose name differs only by an emoji or accent

MySQL compares fsentries names and paths under collations that also fold
accents and most emoji, so a lookup for one name could return a sibling
with another, and writes then overwrote and renamed it.

Path lookups now return only an entry whose stored path matches the
requested one after NFC normalization and lower-casing; case-only and
NFC/NFD spellings still resolve as before. Name-collision checks opt in
to the folded match and treat it as taken by a different entry: write,
mkdir, touch, rename, shortcut, move and copy dedupe when asked and
otherwise answer 409, and never replace or return that entry.

* fix(fs): leave a sibling's subtree alone when a folder its path folds onto is renamed or moved

The subtree rewrite matches descendants with `path LIKE 'old/%'`, and LIKE
compares under the path collation (ASCII case on SQLite). With a sibling
folder whose path differs only that way, renaming or moving one folder also
rewrote the paths below the other.

When another row sits at such a path, the rewrite now follows parent links
down from the moved folder instead. Without one, the rewrite is unchanged,
after one indexed lookup.

* fix(fs): resolve an entry whose stored path is spelled unlike its names, and heal that path on the first read

Older rows can store a `path` whose spelling differs from the names on their
parent chain in ways the path collation ignores. A lookup that finds such a row
by its real spelling now confirms it through the parent chain, writes the path
from the stored names, and returns it, so overwriting, touching or copying over
it by name works and the next read takes the single indexed query again.

The lineage walk now writes a row's path only when it differs byte for byte
from the one its names give, and drops only those rows' cache keys, so a walk
over rows that are already right issues no writes. Whether an entry found at a
name is a different, folded name is decided by its own name and its path after
that walk, not by a stale path column. With `foldedNames`, a row only the path
collation matches still counts as holding the name.

* fix(fs): match entry names under full case mapping

Names are compared after upper- then lower-casing, with a dotted capital I
taken as I, so a request in another case finds the stored entry for Greek
final sigma (`οδος.txt` for `ΟΔΟΣ.txt`), German sharp s (`STRASSE.txt` for
`Straße.txt`) and Turkish dotted I (`istanbul.txt` for `İstanbul.txt`).
Accent, emoji, kana and width differences still make two names different.

* fix(fs): name the existing entry when a folded name is already taken, and show why a confirmed replace failed

`item_with_same_name_exists` from write, move and copy now carries the
existing entry's own name in `entry_name` when it differs from the requested
one only by accents or emoji, so the prompt names the file the folder shows.

In the GUI, a replace confirmed from that prompt that still fails is reported
with its error message and counts as not written, instead of rejecting out of
`handle_same_name_exists` and leaving the caller waiting.

* fix(webdav): answer MKCOL with 405 and COPY or MOVE with Overwrite: F with 412 on a folded name

The existence checks before MKCOL, COPY and MOVE now see an entry whose name
differs from the target only by accents or emoji, so those requests answer as
for an existing target instead of reaching the filesystem and coming back as
409.

* docs(fs): list the errors write, move and copy return when a name is taken

`puter.fs.write()` gets an Errors section with `item_with_same_name_exists`,
`cannot_overwrite_a_directory` and `conflict`, the last for a name that differs
from an existing one only by accents or emoji. The move and copy pages say how
they reject in that case.

* fix(fs): walk the parent chain on the primary when a path lookup reads hard

A lookup that asks for a try-hard read (the checks after a create or move hits
the unique key) now also runs its parent-chain walk on the primary, and falls
back to the primary for the entry it finds. Before, the walk read a replica, so
a name the replica had not seen yet came back as missing and the mkdir or move
surfaced the duplicate-key error as a 500 instead of a 409.

Lookups without a try-hard read are unchanged. A try-hard lookup issues the
same number of queries; its walk reads the primary instead of a replica.

* fix(fs): treat a folder only the collation matches as missing instead of naming a file in it

A name-collision lookup lets only the last segment of the path match a
differently spelled name. When a folder above it matches only under the
collation (`😁dir` for `😀dir`), the lookup reports no occupant, so a write,
mkdir or touch there fails as for a missing folder: 404, or with
`createMissingParents` a 409 that names the folder. Before, it reported the
file inside the other folder and answered 409 naming that file. A folder whose
stored path is spelled that way still counts as the same folder, so lookups
built from stored paths find what they did before.

A rename onto a name the unique key already holds now answers 409 when the
lookup before it missed the occupant, instead of a 500.

* fix(fs): name the existing entry when a rename's name is folded, and leave a copy onto itself out of the copy docs

A rename refused because the folder holds a name that differs only by accents
or emoji now names that entry in its 409, as write, move and copy do.

A copy onto a folded spelling of the source's own name answers as a copy onto
itself (400 with `overwrite`), so the copy page's paragraph on folded names
now covers only items other than the source.

* fix(fs): walk the parent chain on the primary only when a hard read found another spelling of the path
2026-11-12 17:26:22 -07:00
Daniel Salazar 8616b00f7b fix(gui): save a URL from showSaveFilePicker, and always answer the app when the save dialog closes (#4587)
* fix(gui): save a URL from showSaveFilePicker and always answer the picker

The save picker downloads an http(s) URL itself, without cookies or a
referrer, up to 100 MiB, and writes it where the user chose, in apps and on
websites. A failed download shows an error. In apps, a save dialog that
closes without saving (failed download, failed write, close button) answers
fileSaveCancelled once instead of leaving the call pending.

* fix(gui): answer the save picker with the save's real outcome when it closes mid-save

Closing the save dialog while a URL is downloading stops the download,
writes nothing and answers fileSaveCancelled, in apps and on websites. In
apps, closing it once a write has started leaves the answer to the write:
fileSaved if it lands, fileSaveCancelled if it fails, never both. A save
that throws shows an error and answers fileSaveCancelled instead of leaving
the dialog stuck, and a second Enter during a save is ignored.

On an https desktop only https URLs are accepted, with a message saying so,
since the browser blocks http downloads there.

* fix(gui): retry signing a saved file once, and say so when the app can't get it

The app save picker signs the written file for the app with one retry. If
both tries fail, the user is told the file was saved but couldn't be passed
back, and the app gets fileSaveCancelled. The picker's one-answer state
(answered, closed, saving, writing) lives in helpers/savePickerAnswer.js so
the website picker can share it.

* fix(gui): answer the website save picker once, with the save's real outcome

The website save picker runs one save at a time, so a second Enter is
ignored. Closing it while a URL downloads stops the download, writes nothing
and answers fileSaveCancelled; closing it once the write has started leaves
the answer to the write, so the page hears fileSaved or fileSaveCancelled,
never both. A failed download shows an error, answers fileSaveCancelled and
closes the picker, as in apps, and so does a save that throws. A saved file
that can't be signed is reported to the user and answered as cancelled.

* fix(gui): show apostrophes in the save picker's failure messages
2026-11-12 17:26:05 -07:00
Daniel Salazar 873303a7c4 fix(events): offer a queued delivery only to connections that run its handler (#4590)
* fix(events): offer a queued delivery only to connections that run its handler

A queue subscription with an events worker was sent to every connection of
the app. A connection without the handler declined it at once, which moved it
to the worker while the tab with the handler was still running it.

puter.js now sends `events.handle` with the persistent subscriptions a
connection runs a handler for, on connect and whenever that set changes. The
server puts the connection in a room for each queue row it holds, and offers
the row's deliveries only to that room. With nobody in it anywhere in the
region, the delivery goes to the worker at once. A peer region handed such a
delivery declines it straight back when none of its connections run the
handler. Rows without a worker are still sent to the whole app room.

* fix(events): probe the handler room only when the app has a connection in the region

A queued delivery for a pair with no connection here goes to the worker on
the same local lookup and presence read as before, with no request to the
other nodes.

* fix(events): probe a forwarded batch's handler rooms together, within one timeout

A region receiving a batch now looks up every handler room its queued
deliveries need before it sends any of them: each distinct room once, up to
16 at a time, all under one shared 500 ms deadline. A room not answered by
then counts as empty, so its delivery is declined home with `no_handler` and
never sent. Deliveries still go out in the batch's order, and a batch with no
such delivery probes nothing.

* fix(events): resend a handler announce refused for the call budget

puter.js now sends `events.handle` with an ack and a 10 second timeout. When
the server refuses it with `too_many_requests`, the client sends the current
set again after 10 seconds, until one goes through or the connection is
replaced. No answer, as from a server without the verb, and any other refusal
are left alone. A connection that never had a persistent handler sends no
announce; one that had sends an empty set when the last is removed.

The rate limits page now says that announces count toward the
acknowledgement budget.

* docs(events): say when a client starts getting first try at queued events

A client counts once the server has registered its handler, shortly after it
connects or calls `onPersistent()`. Before then, an event for a subscription
with an events worker goes to another client with the handler or to the
worker.

* fix(socket): settle a cluster room count on the first node that holds a socket

A count ask now hears each node's answer as it arrives: the first node holding
a socket answers it at once, every node saying none answers it once all have
said so, and a node that never answers only decides it when no answering node
holds one. The request sent is unchanged, so every node answers it as before.

* fix(events): look up handler connections in the region's record, not every node

Each connection that announces a handler is kept in a per-subscription
sorted set in the region's Redis, scored by renewal: added after it joins
the handler room, removed before it leaves or on disconnect, renewed every
minute while it runs one, and counted only for three minutes after its last
renewal. Handing out a queued delivery, and receiving a forwarded one, now
check this node's sockets and then that set with one read, instead of
asking every node in the region to count the room.

A connection the set names but that is gone gets the delivery sent to an
empty room, and the socket lease hands it to the worker as before.

* fix(events): try the next region with the app open after one declines for want of a handler

A queued delivery's region is picked by app presence, so the first region
tried can have the app open without the handler. Its no_handler decline now
hands the delivery to the next region with the app open that hasn't had it,
and the worker runs it once none is left. A lease that lapses still goes to
the worker.

A decline now counts only when it comes from the region the current attempt
went to (this region for a local attempt). The region goes into the entry in
the same write as the attempt's lease, so a second decline from a region
already tried can't take the next region's lease. An attempt made after a
decline stamps its lease in its own field, which a server that doesn't make
such attempts never reads, so it can't take that lease back either.
2026-11-12 17:25:54 -07:00
Juan Fernando CastroandDaniel Salazar 2c3b69011f fix(puter-js): unshare lists refused pairs in failed and rejects when all were refused (#4557)
* fix(puter-js): unshare rejects when every revoke was refused

/share/revoke reports refused pairs in a 200 body, and unshare() only
read `revoked`, so a call where every pair was refused resolved as if it
had worked. It now rejects with the first pair's { message, code }, the
same way share() does; a call where some pairs went through still
resolves with { revoked }.

GUI tests drive the SDK's unshare against a refused body and check that
the share dialogs and Remove from Shared show the error and keep the
row. The unshare docs list the per-pair codes.

* fix(puter-js): unshare and share reject with the first refused pair that names a code

A pair the server could not complete carries no code and a generic message,
so it no longer comes ahead of a refusal that says what happened. Both
operations pick the error through one helper. The unshare docs describe which
pair's error is surfaced and the request-level rejections.

* fix(gui): share modal says how many items a person was removed from when some were refused

After removing someone from several items, the refreshed listing is compared
with the items the removal covered, and the status reports the count that
went through instead of all of them.

* test(gui): unshare fixture swaps XMLHttpRequest per call; alert mock cleared in hooks

* feat(puter-js): unshare resolves with the refused pairs; share is as it was

unshare resolves { revoked, failed }, with one failed entry per refused
recipient/item pair. A pair refused because the recipient or the item is gone
counts as nothing to withdraw: the call rejects only when every pair was
refused and at least one for another reason, with the first such refusal that
names a code. paths and recipients are typed and documented.

share() picks its rejection as before; the error choice lives in unshare.

* fix(gui): sharing dialogs report the items an unshare was refused for

The share modal counts refused items from the unshare result across every
run of a large selection, going on past a run refused whole, for removing a
person and for closing the link on several items. The share window and
Remove from Shared show the refusal when the call resolves with the pair
refused.

* fix(gui): sharing dialogs keep the unshare outcome on screen after the listing refresh

The share modal shows the partial count once its refresh has settled, for
removing a person and for closing the link, so a listing that fails for the
refused item does not replace it. The share window does the same when closing
the link.

* feat(puter-js): an unshare rejected for refused pairs lists them in failed; failed[].path is documented as the absolute path

* test(puter-js): API suite covers unshare's refused pairs

* fix(gui): share modal stops at a revoke request that failed and counts only refused items

---------

Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-12 17:57:59 -05:00
Nariman Jelveh aaa5c82236 Redirect /show/* to the dashboard and remove leftover desktop code (#4610)
* Redirect /show/* to the dashboard's Files tab

/show/<path> redirects to /dashboard#files/<path> with its query intact,
instead of booting the desktop and opening Explorer there.

Also removes what only that route used: the shell's launch options, the
launch_options GUI param, and the GUI service that ran them.

* Remove the unused component window and Flexer

Nothing opens UIComponentWindow or uses Flexer, and JustHTML was only the
component window's default body. Also drops the attach() shim UIQRCode kept
for component containers.

* Remove translation keys left by removed features

Drops 36 keys nothing references in every language: the keyboard shortcuts
guide, desktop shortcuts, personalization, the toolbar's fullscreen, GitHub
and refer entries, the referral strings, and the publishing option prompt.

* Inline the toolbar height, which is always zero

The toolbar is gone, so window.toolbar_height only added or subtracted zero
in window sizing and placement.

* Remove window edge snapping

Dragging a window to a screen edge or corner no longer snaps it to half or a
quarter of the screen. Double-clicking the head and the scale button still
maximize.

* Remove the window color theme service

Nothing can set a window theme, so the GUI stops reading the saved theme
file on boot and windows keep the default colors. puter.ui.on() still
accepts themeChanged, which is never sent; its docs entry is removed.

* Remove styles and icons nothing references

Drops the stylesheet rules of the removed Settings window, launch menu,
intro menu and a few other removed features, and 16 icons whose names
appear nowhere in the GUI.

* Remove more translation keys nothing references

Drops 56 keys in every language that no GUI code, extension or backend
message uses, such as the system information labels, the old 2FA setup and
confirm-code steps, and the auth token copy dialog strings.

* Remove the global menubar leftovers and more unused styles

Nothing creates a global menubar, so the window code stops hiding, showing
and removing one. Also drops stylesheet rules for classes nothing uses,
including the old auth dialog, the responsive hidden-* and visible-*
helpers, and two keyframes only those rules animated.
2026-11-12 15:31:38 -07:00
Nariman Jelveh 8518023b0b Remove more desktop-only features and entry points (#4607)
* Remove the desktop's Publish Website window

The right-click menu on desktop folders and on an Explorer window's
background no longer has a Publish as Website item. This removes
UIWindowPublishWebsite, the publishAsWebsite helper that opened it, both
menu items, the window's CSS, window.extractProtocol (only the window used
it), and the dir_published_as_website and pick_name_for_website i18n keys.

The dashboard keeps publishing websites through its own dialog.
generateFileContextMenu no longer falls back to the removed window, so it
offers Publish as Website only when the caller passes onPublishWebsite,
which the dashboard's Files tab does. The website badge on desktop items
and the backend hosting API are unchanged.

* Remove the desktop's Hide Desktop Icons toggle

The desktop's right-click menu no longer has a Hide/Show Desktop Icons
item. Without the wallpaper, hiding the icons left an empty page. This
removes the menu item, toggleDesktopIcons/hideDesktopIcons/
showDesktopIcons, the boot-time read of the saved setting, and the
.desktop-icons-hidden CSS rule.

puter.js's GUI boot cache no longer batch-fetches desktop_icons_hidden,
menubar_style or user_preferences.clock_visible, which nothing reads
anymore. Values already saved under those keys stay in KV, unread.

Also drops the desktop's BroadcastChannel, whose message handler was
empty and which nothing else referenced.

* Remove the desktop's ?download= link handler

Opening puter.com/?download=<url> or /desktop?download=<url> no longer
asks to save that remote file to the Desktop. The parameter is ignored,
and a root URL that carries it boots the dashboard like any other root
URL instead of forcing the desktop.

This removes the handler in UIDesktop, its UIWindowProgress import, the
download entry in the GUI's dashboard routing, and the
confirm_download_file_to_desktop, downloading, downloading_file,
uploading_file and error_download_failed i18n keys only it used.

The decision of whether a page load boots the dashboard moves from an
inline block in initgui into helpers/bootsDashboard.js, so it is tested.

* Stop granting Camera and Recorder Desktop access on desktop boot

The desktop no longer grants Camera and Recorder write access to the
user's Desktop folder the first time it loads. Those apps now ask
through the normal permission prompt, as they already did for users
who only used the dashboard. Grants already given stay in place.

puter.js's GUI boot cache no longer batch-fetches the
has_set_default_app_user_permissions flag that kept the grant to one
run. Values already saved under it stay in KV, unread.

* Redirect /@username links to the dashboard

puter.com/@<username> no longer opens that user's Public folder on the
desktop. The backend now redirects /@:username to /, so old links land
on the dashboard instead of booting the desktop.

This removes the GUI's /@ handler and the error_invalid_username i18n
key only it used. error_user_or_path_not_found stays, since share links
still use it.

* Redirect /desktop/app links and stop opening share links on the desktop

/desktop/app/<name> now redirects to /app/<name>, keeping its query
string, so the app opens in the dashboard. The backend no longer serves
an app shell there, OIDC sign-in no longer returns to it, and the GUI no
longer strips a leading /desktop from its route segments. The rate-limits
page lists only /app/<name>, the route the limit still applies to.

/desktop?shared=<path> no longer opens the shared item on the desktop.
The desktop ignores ?shared=: it doesn't ask a guest to sign in for it,
doesn't switch to the account a share email names, and OIDC sign-in from
/desktop doesn't carry it along. Share emails link to /?shared=, which
the dashboard handles as before. Opening a share notification on the
desktop still opens the item.

* Remove the desktop's ?app=explorer link handler

?app=explorer[&path=<folder>] no longer boots the desktop and opens an
Explorer window. ?app= is ignored and no longer forces the desktop, so a
root URL that carries it opens the dashboard, and /app/<name>?app=... now
launches its app in the dashboard instead of booting the desktop and
launching nothing.

* Stop ?puter.fullpage= from booting the desktop

The root and /app/<name> with ?puter.fullpage= now open in the dashboard
like a plain /app/<name>, with the app maximized. The dashboard always
shows apps full page, so the parameter no longer overrides that. Iframe
embeds and popups, which still boot the desktop, read it as before.

bootsDashboard no longer takes the query string, since no parameter
decides the interface anymore.
2026-11-12 11:54:40 -07:00
Nariman Jelveh 33988ac84c Remove the desktop taskbar (#4605)
release-please / release-please (push) Canceled after 0s
Maintain Release Merge PR / update-release-pr (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
* Remove the desktop taskbar

The desktop no longer has a taskbar. Windows on /desktop can't be
minimized, since nothing could bring them back; the dashboard still
minimizes into app tiles. The desktop and maximized windows use the
full page height.

Backend: POST /update-taskbar-items is removed, and /whoami and the
login response no longer include taskbar_items. The user table's
taskbar_items column stays until a migration drops it.

puter.ui.createWindow() still accepts show_in_taskbar, which has no
effect and is marked deprecated.

* Keep desktop backdrops above ordinary windows

A backdrop's z-index used to take the taskbar's as a floor, which kept
modal dialogs on /desktop above every ordinary window, including ones
focused after the dialog opened. Keep that floor on the desktop; the
dashboard and fullpage mode stack as before.

Also drops commented-out geometry that referenced window.taskbar_height,
and a dashboard comment about the removed fullpage minimize rule.

* Keep dropped desktop icons fully on screen, and fill the phone popover

A desktop icon drop is accepted only where the whole item fits above the
bottom edge. Phone popovers use the full viewport height.
2026-11-11 20:16:13 -07:00
Nariman Jelveh 234994d3af Remove the desktop toolbar and nine desktop features, and use puter.js's color picker on the desktop (#4602)
* Remove the desktop's QR login button

The desktop toolbar no longer shows a QR code that signs another device
into the current session. This removes the toolbar button, its click
handler, the UIWindowQR window (its only caller), the qr.svg icon, the
window's CSS, and the four i18n keys only that window used.

UIQRCode and the qrcode library stay, since 2FA setup still uses them.
The ?auth_token= handler in initgui also stays, because the Playwright
e2e harness signs in through it.

* Remove the desktop's My Websites window

The user menu no longer has a My Websites item. This removes the
UIWindowMyWebsites window, its menu item, its CSS, the plug.svg icon only
it used, and the i18n keys only it used.

When publishing a website or worker hits the subdomain limit, the error
now shows only the server's message, without the "Manage your subdomains"
link that opened the window. The trash handlers keep fading the website
badge on a trashed folder and no longer touch the window's rows.

* Remove the desktop's Task Manager window

The user menu no longer has a Task Manager item. This removes the
UIWindowTaskManager window, its menu item, its CSS, the cog.svg icon only
it used, and the i18n keys only it used, including the process_type_*
and process_status_* keys it built at runtime.

The process model in definitions.js, including END_SOFT and END_HARD,
stays: windows still register processes, and a process still forwards
an end signal to its children.

* Remove the desktop's Change Desktop Background window

The desktop's context menu no longer has a "Change Desktop Background…"
item, or the separator above it. This removes the
UIWindowDesktopBGSettings window, its CSS, the palette.svg icon only it
used, and the i18n keys only it used.

Desktop backgrounds still work: the saved background loads at boot, and
an image's "Set as Desktop Background" item still applies and saves it
through /set-desktop-bg.

* Remove the desktop's Start menu

The taskbar no longer has a Start button, so it begins at Explorer. This
removes the Start item and its app popover (recent and recommended apps,
search, tile context menu, and drag-to-taskbar), along with:

- The taskbar's startup /get-launch-apps request and the desktop's
  app.opened socket handler, which only kept the menu's lists current
- The Start popover's search, click and keyboard handlers in UIDesktop.js,
  keyboard.js, initgui.js and UITaskbarItem.js
- The taskbar's handling of items dropped from outside it, and the
  UITaskbarItem append_to_taskbar option only that path used
- The Start CSS, the start.svg icon, and the i18n keys only the menu used

The dashboard's recently used apps still load, since the dashboard fetches
its own list and launchApp.js still records launches. UITaskbar.test.js now
covers the taskbar's item order and that it doesn't fetch launch apps.

* Remove the desktop's Search window

The desktop toolbar no longer has a Search button, and Ctrl/Cmd+F on the
desktop no longer opens the Search window, so it falls through to the
browser's find as it already did on the dashboard. This removes
UIWindowSearch, the toolbar button and its handler, the window's
keyboard handling (arrow keys, Enter, Escape) and click-outside close,
its CSS, the search.svg and magnifier-outline.svg icons only it used, and
the i18n keys only it used.

The backend /search endpoint is unchanged.

* Remove the desktop toolbar

The desktop no longer has the toolbar at the top of the screen, so its
Puter logo, guest Save Account button, and account menu are gone from the
desktop. Log out, account switching, language, settings, and contact all
remain on the dashboard.

Removed:
- The toolbar markup, its auto-hide logic and mouse tracking, its
  right-click menu, and the account menu with its click handlers
- The modify-user-options-menu GUI extension, which only added a
  Developer item to that menu
- UIWindowFeedback, the desktop's Contact Us window, which only the menu
  opened; the dashboard keeps its own contact dialog
- Toolbar hooks elsewhere: the hide_toolbar() call on window maximize,
  pointer-events toggles during window and item drags, the click guard in
  initgui, the account-button toggle in helpers.js, and the avatar sync
  for the toolbar's profile image in TabAccount
- The toolbar and feedback CSS, the toolbar's two KV keys from the
  puter.js GUI read cache, and the i18n keys only these used

window.toolbar_height stays: it was already 0, so window and desktop
layout are unchanged. The welcome window keeps its backdrop stacking.

* Remove the desktop's Share window

The right-click menu on desktop and Explorer items, and on items in open
and save file dialogs, no longer has a Share item. This removes
UIWindowShare, that menu item, the share-outline.svg icon only it used, its
CSS, and the share_with and share_row_team i18n keys only it used.

The Dashboard keeps sharing through UIShareModal. generateFileContextMenu
no longer falls back to the removed window, so it offers Share only when
the caller passes onShare, which the Dashboard's Files tab does. The share
dialog layout classes the Blocked Senders window uses, and the recipient
suggestion styles the share modal uses, stay.

* Remove the desktop's Welcome window

New desktop users no longer see the Welcome window on their first visit.
This removes UIWindowWelcome, the first-visit check in UIDesktop that
opened it, its CSS, the welcome_* i18n keys only it used, and the
UIWindow backdrop_covers_toolbar option only it passed.

has_seen_welcome_window is also dropped from the puter.js GUI boot read
cache. Values already saved under that key stay in KV, unread.

* Replace the desktop's color picker with puter.js's picker

puter.ui.showColorPicker() inside Puter now opens puter.js's own
<puter-color-picker>, the one it already shows on websites outside Puter,
instead of the desktop's iro-based window. Apps get the same answer
everywhere: a lowercase 6-digit hex string, or null when the user cancels.
Inside Puter it used to resolve to an 8-digit hex with alpha, or undefined.

This removes UIWindowColorPicker, UIColorPickerWidget, iro.min.js and its
lib-list entries, and the select_color i18n key only that window used.

The GUI loads puter.js from js.puter.com, so the IPC handler doesn't rely
on this branch's component: it drops the alpha from an 8-digit default,
leaves out a default that isn't a 3- or 6-digit hex, and removes the
picker once it answers.

<puter-color-picker> drops the alpha from an 8-digit default instead of
failing to open, opens on its own color when the default isn't valid,
and removes itself when Escape closes it. showColorPicker()'s type and
docs now give the 6-digit return value and null on cancel.

* Remove the desktop's Publish Worker window

The right-click menu on .js files on the desktop and in Explorer, and in
open and save file dialogs, no longer has a Publish as Worker item. This
removes UIWindowPublishWorker, that menu item, its CSS, and the
pick_name_for_worker i18n key only it used.

The Dashboard keeps publishing workers through its own dialog.
generateFileContextMenu no longer falls back to the removed window, so it
offers Publish as Worker only when the caller passes onPublishWorker,
which the Dashboard's Files tab does.

* Add a Language setting to the dashboard's Account tab

The desktop toolbar's account menu was the only place to change Puter's
language, so removing the toolbar left no way to change it. The Account
tab now has a Language card that shows the current language and opens a
dialog listing every supported language by its own name. Saving a new
one stores it on the account and reloads the page in it.

changeLanguage() now returns false when the language can't be saved, so
the dialog can show an error instead of doing nothing. The
change_language key comes back in every locale, and
language_save_failed is new.
2026-11-11 17:17:30 -07:00
Nariman Jelveh 711ece5800 feat(gui): let a first-party page frame the custom domain dialog (#4581)
* feat(gui): let a first-party page frame the custom domain dialog

`/embed/attach-custom-domain` joins the framed popups. On a signed-in page
one label under the Puter origin, `puter.hosting.attach()` now shows the
custom domain dialog in a frame over the page instead of a popup window.
Apps, the desktop and every other website keep their current behavior.

The frame covers the page with a transparent GUI page, so the dialog
floats over it with its own scrim as it does on the desktop. The GUI
serves only the framing page's own user, with no account check waiting,
and otherwise reports `unavailable`, which leaves the page to open the
popup as before. It runs the popup's action unchanged: the framing page
is the requester the dialog names, and gets the same
`customDomainAttached` answer.

Escape is left to the dialog, which doesn't close while a request is in
flight, and the frame allows `clipboard-write` for the DNS record copy
buttons. A call made while the frame shows resolves null without
replacing it, as a second call does on the desktop.

* Update RecommendedAppsService.ts

* fix(gui): let the framed custom domain dialog finish closing before it answers

The answer removes the frame from the page, so the dialog's exit transition
never showed. The framed action waits for the overlay to leave first, with the
wait the feedback embed already had, now one shared helper.
2026-11-11 11:44:39 -07:00
404oops db7ca8382b Price native service tiers and served premium capacity 2026-11-11 12:53:12 +01:00
404oops 0f2c325598 Meter Responses usage before validating empty output 2026-11-11 12:53:12 +01:00
404oops ffcfb85749 Validate voice changer models against the price table 2026-11-11 12:53:11 +01:00
Daniel Salazar d8c3e01dd9 fix(http): parse large JSON bodies in slices; store WebDAV uploads labeled as JSON (#4563)
Maintain Release Merge PR / update-release-pr (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
release-please / release-please (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
JSON request bodies over 32 KiB are parsed in slices, with the event loop
running between them, instead of in one JSON.parse call. Reading, limits,
decompression, req.rawBody and the errors stay as express.json has them.
Large bodies parse one at a time.

Gemini TTS and video replies use the same parser, and their base64 is
checked and decoded 1 MiB at a time.

A profile picture is sized before its pattern runs, so one of several
megabytes gets a 413.

Body parsers skip the dav subdomain: a PUT labeled as JSON or form data
was read by them and stored empty, or refused.

puter.js sends auth_token as the first field of a driver call. A chat body
over 50 MiB that opens with a valid token is accepted up to 128 MiB, as
one with a header credential is.

JSON in a charset other than UTF-8 is now limited to 1 MiB, and a body
over 32 KiB nested deeper than 10,000 levels is refused.
2026-11-10 16:36:52 -07:00
404oops 0191f2bfec Update chat.md 2026-11-09 16:11:51 +01:00
404oops 7aadc48cca Add service speed selection and billing to AI chat 2026-11-09 15:59:08 +01:00
Nariman Jelveh 5b850113ff Show sign-in and file pickers in a frame on first-party pages (#4537)
* Show sign-in and file pickers in a frame on first-party pages

puter.auth.signIn(), showOpenFilePicker(), showSaveFilePicker() and
showDirectoryPicker() on a page one label under the Puter origin now
show the GUI popup in a frame over the page instead of a window. Every
other page, and any frame that can't serve the request, keeps the popup
exactly as before, so apps need no changes.

/embed/sign-in and /embed/show-{open-file,save-file,directory}-picker
render the normal GUI shell with the framing rules, query redirect and
no-store of /embed/apps, and name the framing page (read from the
referrer, pinned with frame-ancestors) as embed_host_origin. The GUI
runs the popup boot unchanged with that page as window.opener; close()
asks it to remove the frame. Popup parameters come from the fragment
(msg_id, options, request_auth, and user for a picker).

Sign-in has a close button that rejects with auth_window_closed, as
closing the popup does. A federated provider can't be framed, so
choosing one continues in the popup. attempt_temp_user_creation and
cross-origin isolated pages keep the popup.

Pickers frame only for a signed-in page whose user owns the GUI
session; otherwise the GUI reports unavailable and the page opens the
popup, through a consent dialog if the click has expired. The page
keeps its own token rather than adopting the one sent with the answer.

The feedback embed and the new frames share one loading/ready state
machine in guiEmbed.js.

* Close a framed picker when Escape cancels it

Escape closes only the picker window inside the frame, so the frame now
closes with it. The mismatched-user e2e test waits for sign-in's whoami
before naming another user, which it could otherwise overwrite.

* Close a framed sign-in on Escape

The sign-in shows as a page in the frame, which ignored Escape. Escape
now asks the framing page to close it, as its close button does, unless
a request is in flight.

* Focus a framed sign-in once the page focuses the frame

A cross-origin frame's focus() calls do nothing until the framing page
focuses it, so the sign-in opened with focus on the body: keys missed
the form and Escape never reached the dialog. The screen now takes
focus when the frame gains it, unless something already has it.

* Skip the frame on subdomains the server refuses to let frame

The SDK framed embeds from any page one label under the GUI origin, but
the server refuses its own subdomains (api, docs, apps, ...). On those,
sign-in and the pickers waited on a refused frame before opening the
popup, which Safari could then block for want of a recent click. They
open the popup straight away now, and the user menu hides Apps there,
as its docs say.

* Keep a framed picker on the framing page's user

With several saved accounts, a framed picker could still show the
account picker (no grant yet, or request_auth in its fragment). Picking
another account switched the session inside the frame, and the picker
then ran with the first user's details and the second user's token,
saving that token under the first account. A framed picker already
holds the framing page's user, so it no longer offers to switch, and
its user check no longer writes the boot's shared whoami.

* Take a save picker's file only from the page that asked

The save picker opened a dialog for every showSaveFilePickerPopup
message from any window. In a frame, a sibling frame of the framing
page can reach it, so it could supply the bytes the user then saved,
or stack extra dialogs. The picker now takes the file once, and only
from its opener.

* Reopen a framed embed that reloads itself into a refused frame

A reload or navigation the embed starts itself names the embed as its
referrer, so the server refuses the framing: logging out at an account
gate, a sign-out in another tab, or a reset session left a blank box.
The page now shows its spinner and opens the embed again itself, once
per ready, and falls back as for a refused frame if that fails too.

* Correct why a temporary-account sign-in keeps the popup

notes.puter.com and puter.com are the same site, so browsers don't
partition the frame's storage. The popup is kept because only it
creates a temporary account.

* Remove the picker's consent dialog once answered

The consent dialog a picker shows when its click has expired was
closed but left in the page after Continue or Cancel, one element per
fallback. It is removed now, as the other consent dialogs are.

* Name the embed dialog for assistive tech

The modal dialog around a framed embed had no accessible name, so
screen readers announced an unnamed dialog. It is labelled with the
frame's title.

* Expose an embed's loading status only while it shows

The spinner is faded out rather than removed, so assistive tech still
read a Loading status over a frame that was ready. The status is
hidden from it whenever the spinner isn't showing.

* Let a popup frame fill in texted codes

Signup and the account checks fill a texted code in through WebOTP,
which a cross-origin frame may only use when allowed. Popup frames now
allow otp-credentials, so the code fills in as it does in the popup.

* Close a popup frame on Escape from the page too

Once a popup frame was ready, Escape with focus on the page (after a
click on the scrim) only moved focus back into the frame, so it took a
second Escape to close, and none if the frame stopped responding. It
now closes the frame, as Escape inside it does. The feedback embed
still leaves dismissal to the embed.

* Keep scrolling over an embed's scrim from scrolling the page

A wheel or swipe over the scrim around a framed embed chained to the
page behind the modal. The dialog now contains its overscroll.

* Frame a GUI popup only at its exact path

Routes match case-insensitively and with a trailing slash, so another
spelling of /embed/<action> was served frameable while the shell booted
the desktop for it. Any other spelling now redirects to the exact path.

* Prefill a web save picker with the suggested name

The popup and framed save pickers ignored suggestedName and opened with
an empty filename, unlike the save picker an app gets in the desktop.

* Open a provider picked in a framed sign-in straight in the popup

Picking a provider in the framed sign-in fell back to the sign-in popup,
where the user had to pick the provider again. The frame now hands the
page the provider's start URL for its sign-in, and the page opens the
popup there after checking it is the GUI's OIDC start for that sign-in.

* Open the popup straight away for a page framed by another site

frame-ancestors on the embeds allows only the GUI and the framing page,
so a first-party page inside another site's frame waited about a second
on a refused frame before sign-in or a picker opened the popup, by which
time Safari asks for another click. Such a page opens the popup straight
away now, as it did before the frame.

* Close a framed sign-in on Escape at its account checks

Escape closed the framed sign-in on its auth screens but did nothing once
signup moved on to confirming the email, phone or card, which show as
windows. Escape there now closes the frame as well, as its close button
does.

* Leave Escape that cancels an IME conversion to the IME in sign-in

In a framed sign-in, Escape pressed to cancel an IME conversion in a
field also closed the sign-in, losing what was typed. The auth screens
and the account checks now leave an Escape mid-composition to the IME,
as the dashboard's text fields do.

* Fade in a popup frame's scrim and box

The scrim behind a framed sign-in or picker, and the box's white
background, appeared at full opacity in one frame while the GUI's content
faded in over them. Both now fade in briefly, unless the user prefers
reduced motion.

* Keep a page's own styles off a popup frame's dialog, frame and close button

The dialog, its frame and the close button live in the page's document, so
a page's global dialog, iframe and button rules reached them: a transform
that centers the page's own dialogs moved the overlay half off screen, an
iframe max-width shrank the frame inside its box, and button margins and
min sizes turned the close button into a pill. The dialog and frame now
reset those properties inline, and the close button starts from all:unset.

* Fall back to the popup when a reopened embed frame never loads

After a refused self-reload the page opens the embed again, but nothing
timed that second start: a stalled request left the loading spinner up
until the user dismissed it, which settled the request as closed instead
of opening the popup. The reopened frame now gets the same ready timeout
as the first start.

* Hand a save picker frame its file again after it reloads

The page answered a picker's sendMeFileData once and then stopped
listening. A framed save picker that reloads asks again, and without an
answer it never opened its dialog, so the page waited out the ready
timeout and fell back to the popup. A frame is now answered until it
closes; a popup is still answered once.

* Keep a popup frame's white backing off its rounded edge in dark mode

The box's white background shared the frame's anti-aliased corner, so a
light arc showed around the dark sign-in. The backing now stops 1px inside
the edge, which leaves the curve to the frame and the scrim.

* Center a popup frame's box with margins so it fills a phone edge to edge

On a phone with a fractional pixel ratio the translate that centered the
full-screen box left it a fraction of a pixel short of the top, so a line
of scrim showed above the sign-in. Margins snap to device pixels.

* Focus a framed save picker's file name as the popup does

A cross-origin frame's focus() does nothing until the page focuses it, and
the page focusing it again resets it, so the framed save picker opened with
nothing focused and typing went nowhere. A framed popup now gets its latest
focus() back whenever the frame gains focus with nothing focused, until the
user presses a key or the pointer in it.

* Replace a showing popup frame instead of stacking a second one

A double click on a page's picker button framed two GUIs, one over the
other under two scrims, and the user had to cancel twice. A popup reuses
its named window instead. Now a newer popup frame dismisses the one
showing, which settles it as closed.

* Share one framed sign-in between calls made while it's open

A double click on a page's sign-in button started a second framed
sign-in, which replaced the first and rejected it as closed while the
user was still signing in. A call made while a framed sign-in with the
same request_auth is open now settles with it.

* Close only a context menu on Escape over a file dialog

Escape to dismiss a right-click menu in a file dialog also closed the
dialog, which cancels a picker and, in a framed picker, removes the whole
frame. An open context menu now takes the Escape on its own.

* Document that one popup frame shows at a time

* Keep a save dialog's file name and buttons on a phone's screen

The save dialog's bottom bar couldn't shrink below the file name's own
width, so on a phone it spilled off both edges: the name's start and
the Save button were cut off. A framed save picker fills the phone, so it
always hit this. The name now shrinks to fit.

* Keep a file dialog's buttons on one line on a small phone

On a 320px-wide screen the open picker's Open button wrapped under
Cancel and ran into the screen's edge, and Upload wrapped under its
icon. The buttons now stay on one line, with less side padding up to
480px wide so the save dialog's file name keeps room to show.

* Say what a picker is for when its popup needs a click to open

When a framed picker falls back to the popup after the click expired,
the consent dialog said the page used Puter for AI and Cloud features,
not that it wanted a file or folder. It now names the picker, as the
push notification dialog does.

* Share a framed sign-in with a call that differs in request_auth

Implicit auth asks with request_auth, so an explicit signIn() made while
it was open replaced its frame and rejected every puter.* call waiting
on it. Any framed sign-in in progress is now joined.

* Keep a popup frame open when a frame for another popup shows

A sign-in replaced a showing picker frame, cancelling the picker, and
the other way round, though their popups have different window names and
stay open together. Only a frame for the same popup is replaced now.

* Reopen a refused embed frame in WebKit

WebKit took the refused URL as a fragment navigation of its error page
and loaded nothing, so a frame that reloaded itself fell back to the
popup. The frame is reopened through the server's query redirect, which
keeps the fragment.

* Go back to the save picker on Escape at its replace prompt

Escape closed the alert without an answer, so the save waited on it
forever behind the picker's busy mask. In a frame nothing could close
the picker after that. The alert closing now counts as Cancel.

* Leave Safari's IME-ending Escape alone at a framed sign-in's account checks

Safari sends the Escape that ends an IME conversion with keyCode 229 and
isComposing false, so it closed the framed sign-in. The auth screens
already check for it.

* Keep an open dialog's buttons whole on a small phone in German

At 320px, German's longer labels pushed the Open button past the screen
edge, since the upload label couldn't shrink and the buttons could. The
upload label now gives way, cut off with an ellipsis.
2026-11-07 20:56:19 -07:00
Filip Kujundžić 84faf5c40c refactor(ai): rename convo API to realtime (#4524) 2026-11-07 10:55:35 -07:00
Nariman Jelveh e253a7f862 Show the app feedback dialog in a frame on first-party pages (#4534)
* Show the app feedback dialog in a frame on first-party pages

puter.ui.showFeedbackDialog() on a page one label under the Puter origin
now frames /embed/feedback in a modal over the page, instead of opening a
puter.com popup. The embed uses the same framing rules, query redirect,
and host-user binding as /embed/apps, and sends the feedback for the
framing page's origin, which the server reads from the referrer and pins
with frame-ancestors. Without the named user's Puter session, or with an
email still to confirm, the embed reports itself unavailable and the SDK
falls back to the popup, which can sign in. A frame that never answers
(such as one the host's CSP blocks) falls back too.

The embed session check moves out of appsEmbed.js into a shared helper,
and the first-party page check out of <puter-user-menu> into puter.js's
lib, so both embeds use one copy of each.

* Keep the framing page from scrolling behind the feedback embed

A wheel or touch scroll over the feedback embed's scrim chained out of
the frame and scrolled the first-party page underneath the open dialog.
The embed's root now stops overscroll from leaving the frame.

* Name the feedback embed's user from the cached whoami

showFeedbackDialog() on a first-party page fetched /whoami before it
started loading the embed, adding a round trip to every call. It now
uses the user puter.js already cached for the session and asks the API
only when there is none.
2026-11-07 01:57:47 -07:00