mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-25 23:27:39 +00:00
20d11ebf18cf743c8e7d645feeefc9abcc62bd84
7641
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
20d11ebf18 |
perf(ai): the chat model listing is built when the model map changes, not on each request
The chat driver rebuilt its model listing on every call to models() and list(): it flattened the model map, visiting each model once per name it answers to, dropped the repeats, applied the listed rates and sorted. The map only changes at boot and on the fifteen-minute refresh, and the routes that serve the listing are public. The listing is now built when the model map is swapped and both methods return it. A scheduled price change still takes effect at its instant: the listing records the span of time its rates hold for and is rebuilt from the current map on the first call outside that span. The returned arrays are frozen, since every caller now shares them. What the routes return is unchanged. |
||
|
|
3d49d320af | Merge branch 'main' of https://github.com/HeyPuter/puter into feat/gui-file-picker-remembers-view | ||
|
|
414090bb36 |
fix(ai): bill Mistral OCR for a page count a document can have (#4734)
* fix(ai): bill Mistral OCR for a page count a document can have Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(ai): retry a chat credit hold apart from lost headroom when the balance changed A conditional hold refused because the balance changed since it was read is now reported as 'stale', separately from one that no longer fits. The chat gate reads the balance again for it, up to five times with a short randomized wait, without spending the tries a lost headroom gets, and refuses with a plain 429 rather than credits_reserved if it never holds still. --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
0dbf84bc3e |
fix(ai): give Cloudflare image requests a timeout and a reply size cap (#4733)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
9e1ee69ac5 |
fix(ai): bill no more Replicate runtime than a prediction is given (#4732)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
24bc88b451 |
fix(ai): keep a failed model map build from leaving an unhandled rejection (#4731)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
16419dc951 |
fix(ai): reserve chat and video credits only while they still fit the balance (#4730)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
02a2d87d5e |
test(ai): fuzz vendor replies, gateway catalogs and recorded usage (#4729)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
3b5d6619dd |
fix(ai): classify malformed text-to-speech provider replies (#4728)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
ec8789e9fa |
fix(ai): classify malformed video provider replies (#4727)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
d60b909e83 |
fix(ai): classify a malformed Gemini image reply (#4726)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
b0df774be7 |
fix(ai): classify malformed image provider replies and options (#4725)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
2f43d618ae |
fix(ai): reject a Claude 2xx answer that isn't a message object (#4724)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
2798d721e0 |
fix(ai): record no usage for a provider count that isn't a positive number (#4723)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
d8bb1b3570 |
fix(ai): hold billed transcription seconds to what the audio can contain (#4722)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
f244f5d27e |
fix(ai): skip gateway catalog entries the chat model map can't use (#4721)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
3d300fae5c |
fix(ai): answer an unreadable 2xx JSON body from Mistral with a 502 (#4720)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
61c5186f4f |
fix(ai): meter Gemini thoughts and audio input separately (#4717)
* fix(ai): meter Gemini thoughts and audio input separately * fix(ai): schedule Gemini legacy redirect pricing * fix(ai): keep video in Gemini conversations that contain audio The native Gemini adapter maps video data URLs to inline data for the models whose audio input it serves, so a conversation with both audio and video is sent to Google instead of failing with 400. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(ai): meter Gemini audio by content, send video and Puter file audio Audio and video data URLs count as audio and video input whatever part carries them, and the input check runs again once Puter files are read. Gemini 2.5 Flash and Flash-Lite requests with video use the native API so the audio track is metered at the audio rate. Remote video URLs are fetched and inlined for Gemini, video reaches the compatible endpoint in the part it reads, and audio inlined from a Puter file is sent as bare base64 with a wav or mp3 format. The native adapter answers 400 for a tool call without a function name and no longer fails on a tool call id or image URL that is not text. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
4a13169815 |
fix(s3): close pooled connections before S3 drops them; name the host and site owner on error alarms (#4749)
* fix(s3): close pooled connections before S3 drops them S3 hangs up on a keep-alive connection that has been idle for about 6 s and sends no keep-alive hint, while the client's pool kept idle sockets indefinitely. A request written to a socket as S3 closed it failed with `socket hang up`, and the SDK's retries could draw more sockets of the same age from the pool and fail the same way. The pool now closes a socket after 4 s idle. Requests in flight keep the handler's own socket timeout. Plain-HTTP endpoints get the same pool settings as HTTPS ones. * feat(alarms): name the host and a hosted site's owner on HTTP error alarms A hosted site's visitor is usually anonymous, so an error alarm for a site request named nobody, and its path alone did not say which site failed. The site middleware now records the owner as the actor to report a failure against, used when the request has no actor of its own, and every HTTP error alarm carries the request host. |
||
|
|
2c4db5d4d1 | fix(gui): a file picker opens in the view and sort last chosen in one | ||
|
|
5b8e0576fd |
feat(auth): the SMS-to-card fallback follows what the account owes (#4748)
A card stands in for the phone step only on an account that neither owes a card nor has verified one. A number on file is still stood in for by the card on file. An account that owes both keeps both steps. `puter.phone-verification.check` gains two optional fields: - `countsTowardFallback: false` keeps a refused send out of the count that opens the fallback. Refused sends count by default, as before. - `refuseWithoutFallback` keeps a `card_fallback_instead` refusal in place when there is no fallback to offer, instead of letting the send through. GUI: a message for a card the verification doesn't accept, and the virtual-number message no longer mentions a card (the card link shows on its own when one is offered). |
||
|
|
d0a75e3b2e | fix(gui): a file picker's grid runs down to its button bar (#4750) | ||
|
|
9fba208387 |
feat(gui): file pickers look and work like the dashboard's Files tab (#4746)
* feat(gui): file pickers look and work like the dashboard's Files tab The open, save and directory pickers draw the Files tab's listing: its folders sidebar, breadcrumbs and typed paths, list and grid views, column sorting, thumbnails, selection with Shift/Ctrl/Cmd and drag, and its keyboard. Their rows and markup come from one module, fileListing.js, that the Files tab now uses too. - New FilePicker (listing) and filePickerDialog (button bar, answers). UIWindow keeps its picker options and data attributes; callers are unchanged. Pickers no longer use the explorer item container, so their branches in openItem, UIItem, uploadSelection and refreshItemContainer are gone. - The Open button and a double-click send one answer through one path. - The Files tab and UIDashboard look up their own elements only, so a picker over the dashboard doesn't share their selection or crumbs. - An app's open or directory picker closed with Escape or its close button reports a cancel; the folder a directory picker is open in comes back with a ~/ path. - Pickers can create folders, rename, move to Trash, upload (open) and take dropped files; their menus no longer launch apps. - upload_items takes an onUploaded callback, so a picker selects what it just uploaded even in a popup, which has no socket. * fix(gui): no gap above a narrow file picker's folders Below 768px the Files tab pads its folders column down past the dashboard's menu toggle. A picker has no toggle. * fix(gui): a file picker's folders keep the Files tab's 10px inset The dashboard insets the Files section by 10px; a picker has no such wrapper, so a hovered folder's highlight met the dialog's edge. * style(gui): less room above a file picker's first folder * fix(gui): a save picker's double-click and Enter don't save where Save is disabled Double-clicking a file, or pressing Enter on it, in a save picker names the save after it and presses Save. That ran the save even with the button disabled: in the Trash, the Shared view or a view-only share. The Save handler returns while the button is disabled. * fix(gui): a save picker saves into the folder being opened, not the one before it A folder opened in a picker becomes its current folder once the listing arrives. Save pressed before then wrote into the folder that was on screen before. The picker now exposes the folder a listing is on its way for, and Save goes there; it's also disabled at once when that folder takes no saves. * fix(gui): a file picker's sort arrow follows the click, not the re-listing Clicking a column header or a Sort menu entry re-reads the folder, and the header's arrow only moved once that answered. It moves with the click now, as the Files tab's does. * fix(gui): a file picker's row keeps its fitted name when a rename fails A rename the server refuses puts the old name back cut to the desktop's fixed length, which is shorter than the row has room for. The picker fits the name to its row again. * fix(gui): a file picker fits its names again when it's resized Names are cut in the middle to the room their row has when it's drawn. Resizing the picker left them as they were: still cut short in a wider window, and overflowing in a narrower one. The picker watches the listing's width and fits the names again, at most once a frame, as the Files tab does. * fix(gui): a file picker keeps the keyboard on its listing The picker's keys only work while the keyboard's focus is inside it, and several clicks took the focus away or left it on the wrong thing: - A click on a sidebar folder, a nav arrow or a toolbar button left that control focused. The arrows still moved the selection, but Enter went to the control: it opened the folder again instead of the selected row. The arrows and type-to-select now hand the focus to the listing, as the Files tab's do. - A click on a crumb, on a menu entry, on the picker's head or button bar, and Enter in a rename left the focus on the page, where no key reached the picker. The listing takes the focus back in each case. A crumb reached with the keyboard keeps the focus on that folder's crumb. * test(e2e): the directory picker test waits for the first picker to close The test picked a folder and asked for a second picker at once. The first picker's window was still closing, so the second one's locator matched both windows and the test failed every run. * fix(gui): a file picker's crumbs start at its edge on a phone Below 480px the Files tab moves its crumbs and path field 50px in, to clear the dashboard's menu button. A picker has no button there, so its crumbs sat behind an empty gap, out of line with the arrows under them. * fix(gui): the keyboard returns to a file picker's listing from the path field and a cancelled rename Enter or Escape in the path field, and Escape in a row's name, hid the field while it still held the focus. The listing doesn't take the focus from a field, so it stayed on the hidden one and then fell to the page, where the picker's keys don't work. The field is blurred before the listing takes over. * fix(gui): Enter opens the files just uploaded in a file picker An upload started with the picker's Upload button ends with the uploaded files selected and the focus still on Upload, so Enter asked for more files to upload. The listing takes the focus once the upload is in. * test(e2e): a file picker's keys work after a click on a sidebar folder or a crumb * fix(gui): a change made elsewhere doesn't close a file picker's path field A picker lists its folder again when another tab or device changes something in it. Every listing closed the path field first, so a path being typed was dropped mid-word, and Enter pressed just before the re-listing was ignored. Only opening another folder closes the field. * fix(gui): a file picker still opens a folder when it's sorted or re-listed before the folder arrives * fix(gui): a file picker's alerts open above it and hand the keyboard back when they close * fix(gui): a save picker's name errors show their quotes instead of HTML entities * fix(gui): the Files tab leaves the keyboard on a file picker's crumb when it lists its folder again * fix(gui): a rename made elsewhere doesn't move a file picker's row into the Files tab * fix(gui): a file picker doesn't answer with a file that can't be signed * fix(gui): a file picker keeps a selection made while its folder is being listed again * refactor(gui): UIWindow drops the last of the old file dialog |
||
|
|
78a7400c98 |
feat(auth): an extension can switch the SMS-to-card fallback on or off over config (#4747)
Adds the puter.card-fallback.policy event, asked before phone_verification_card_fallback.enabled is read. A listener that sets enabled decides in place of config; with none, config decides as before. |
||
|
|
9d89fc7a29 |
refactor(gui): folders in a file picker open in the picker, never in a new window (#4666)
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
From inside a file picker, Open in New Window and ctrl/cmd + click on a folder, a sidebar folder, or a path segment opened a standalone folder window over the dashboard. Those entry points are removed, so the click opens the folder in the picker. The sidebar folder menu, which only held Open and Open in New Window, is removed with them, and so is the open_in_new_window string. |
||
|
|
5048007254 |
feat(gui): show thumbnails for uploaded text, YAML and HTML files (#4738)
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 thumbnails for uploaded text, YAML and HTML files A .txt, .yml, .yaml, .html or .htm file, or one typed as plain text, YAML or HTML, gets a thumbnail of its first lines, drawn as source code is but in one color: an HTML file shows its markup, not the page it makes. Markdown, CSV and source files are matched by name first, since a browser can type any of them as plain text. These files go through the text queue, deadline and 16 KiB read of the other text files, and the dashboard downloads only that much of one that has no thumbnail. In the Files tab's list rows they show their type icon, as other text files do. * fix(gui): wrap the lines of a text file thumbnail, each as its own paragraph A text file's lines ran off the page as source code's do, so a note written one paragraph to a line showed only the start of each paragraph, and a line in a right-to-left script was drawn left to right. A text file now wraps each line inside the page, and a right-to-left line runs from the right. YAML and HTML are one-color languages beside JavaScript, CSS and JSON, and still run off the page as code does. * fix(gui): show the type icon in list rows for text drawn by its type A list row shows a page's type icon instead of the page, but told a page by the file's name alone. A text file the generator draws because of its type, such as a .log or .text file typed text/plain, kept its thumbnail in list rows, where a page is a blank square. The type now counts too, with or without a charset. * fix(gui): read text saved as UTF-16 for its thumbnail Notepad and Excel save Unicode text as UTF-16, and Windows PowerShell writes redirected output that way. Its NUL bytes made such a file look like it wasn't text, so it kept its file icon. Text that starts with a UTF-16 byte order mark is now decoded as UTF-16. |
||
|
|
38ca3d9a76 |
feat(gui): confirm before trashing a worker's source file (#4742)
* feat(gui): confirm before trashing a worker's source file Moving a worker's source file, or a folder that holds one, to the Trash now asks first and deletes those workers when the user agrees. Workers are found by prefix-matching the user's worker list against the trashed paths, so folders aren't walked; the list is cached for a minute and dropped when a worker is published or deleted. * fix(gui): refresh the worker list after a rename or move The cached list keeps each worker's source path, so a folder renamed or moved within the minute went to the Trash without a warning, and a folder a worker's file had just left asked to delete that worker. A move, rename or update heard over the socket now drops the cache; a move into the Trash keeps it. * fix(gui): trash anyway when a listed worker is already gone A worker deleted from another tab or the CLI since the list was cached made the delete fail with not_found, so the user saw "Worker not found" and nothing went to the Trash. That worker is already in the state the user agreed to, so the move goes ahead. * fix(gui): say which worker failed and that nothing was trashed A failed worker delete showed only the raw error, with no title, so the user couldn't tell which worker it was or whether their items had gone to the Trash. The dialog now has a title, names the worker, and says nothing was moved. * fix(gui): show the trash worker dialog over every window The dialog mounted on the body at the dashboard overlay's z-index, but phones and tablets pin every window, the dashboard included, at 9999999, so there the confirm sat hidden and trashing seemed to do nothing. Any window can trash, so the dialog now stacks over all of them, as the auth dialog does. * fix(gui): ask once when Delete is pressed again before the dialog A second Delete press while the worker list was loading opened a second confirm for the same items, so the user had to answer twice and the second answer acted on items already gone. A repeat check for the same paths while one is pending is now dropped; the first one trashes them. * fix(gui): bring back the phone selection bar when a trash is cancelled The Delete button in the phone selection bar hid the bar before trashing. Cancelling the worker dialog, or any other dialog that stops the trash, left the rows selected with no bar to act on them. The bar comes back when a selected row wasn't trashed. * fix(gui): stop waiting on a stalled worker listing after 10s The listing goes through the SDK's 15-minute idle limit, so a backend that stopped answering left Delete doing nothing, and a second press was dropped as a repeat. After 10s the trash goes ahead without the warning, as it does when the listing fails. * fix(gui): name every worker that couldn't be deleted When several worker deletes failed, the dialog named only the first, so the user didn't know the others were still running. It now lists each one with its error. * fix(gui): space lists in dashboard dialogs like paragraphs A list in a dialog's message kept the browser's margins and 40px indent, leaving a gap under it larger than the body's padding. It now takes the paragraphs' spacing and a 20px indent. |
||
|
|
ed3861f289 |
feat(puter-js): email.get() returns the sender check as senderAuth (#4716)
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
An EmailMessage carries `senderAuth`: the result Puter recorded in the
message's X-Puter-Sender-Auth header when it filed it ({ result, from,
signedBy, local }), or null when there is none. Only the first such header
counts, which is the one Puter writes.
|
||
|
|
3239539ef6 |
docs(bug-bounty): testing must be identified: declared test accounts and a request header (#4715)
Testing on puter.com is authorized only from accounts declared up front, with X-Bug-Bounty: <handle> on every request, from stable addresses. Other accounts, IP rotation and unidentified traffic are outside the policy and its safe harbor. |
||
|
|
af15ba8bfb |
feat(auth): proof on file signs out other sessions; a sign-in reads the team seat once (#4719)
* perf(auth): a sign-in reads the team seat once; validate event carries request signals - The seat a sign-in reads for its listeners is handed to the account payload it builds afterwards, instead of being read again: one cache read and, for an account with no seat, one database read fewer, and two fewer serial stages. - puter.signin.validate carries `request_signals`, every signal the edge proxy raised on the request. - A card step on an account that already has a card asks for that card, entered again, the way a number on file asks for its number. * feat(auth): proof of the phone or card on file belongs to the session that gives it A sign-in made while the account owes proof of its phone or card on file doesn't have its device remembered, and its session is noted. When a session proves the phone or card, its device is remembered then, and every other session opened while the proof was owed is revoked before the gate clears, so clearing it from one session can't let another one in. * fix(auth): proving the phone or card on file signs out the account's other web sessions The proving session keeps its sign-in and is the only device remembered. A sign-in that completes after the proof was given is not kept and is asked to sign in again. If the other sessions can't be signed out, the gate goes back on and the request fails. * fix(auth): other sessions are signed out before the on-file gate clears; the phone proof counts for its sign-in Proving the phone or card on file signs the account's other web sessions out before the gate clears and again after it, so a session never sees the gate open. Only the gates the request cleared go back on if the second pass fails. The proof that allows an email change while the address is pending is kept with the sign-in that gave it. A sign-in that isn't kept sets no session cookie, and a provider sign-in in that case returns to its page. * fix(auth): a gated sign-in checks the gate after its device id is kept The check is the last step before the session cookie is set. Tests assert the order of the gate writes and that a provider sign-in that isn't kept leaves no session. |
||
|
|
c0717947d1 |
feat(gui): show thumbnails for uploaded iWork, OpenDocument, Sketch and EPUB files (#4685)
* refactor(gui): give the ZIP reader and the image-type check modules of their own The reader of a ZIP archive's directory and entries moves from ooxml.js to zip.js, and telling an image's type from its first bytes moves from audio.js to images.js, so that readers of other packaged formats can use both. The archive's read budget gets a name of its own, with the value it had. What the existing readers do is unchanged. * feat(gui): show the preview a packaged document carries as its thumbnail Some formats are archives that hold a picture of the document, made by the editor that saved it. On upload, the desktop takes that picture and passes it to the image thumbnail generator: - Pages, Numbers and Keynote keep preview.jpg and a smaller preview-web.jpg, and files from before 2013 QuickLook/Thumbnail.jpg. - OpenDocument text, spreadsheets and presentations keep Thumbnails/thumbnail.png. - Sketch keeps previews/preview.png. - An EPUB's cover is found through its container and package document, by the EPUB 3 property, the EPUB 2 metadata entry, or its name. Nothing is rendered, and the image's type comes from its own first bytes. A file with none of these, such as a template or a text file with the name a Keynote file has, keeps its file icon. These files share the queue and the 5 second deadline of Office documents, and a stored preview may be up to 8 MiB, which is published with the other limits. In the Files tab's list rows, Pages, Numbers, Keynote and OpenDocument files show their type icon, as other documents do. A Sketch preview and a book's cover show in list rows too. * fix(gui): scale one packaged document's picture at a time The upload generator is called for every file at once, and the stored preview was scaled outside the queue that read it, so a folder of books decoded all their covers together. Each picture is now scaled inside the queue, as audio covers are. * fix(gui): skip a stored preview that states more than 16 megapixels A packaged document's preview or an EPUB's cover went to the image generator at whatever size it stated, and a picture is decoded at full size before it is scaled. A preview over 16,777,216 pixels is now passed over for the next one the file holds, as pictures in Office documents and HEIC photos are. pixelSizeOf() moves to images.js beside imageTypeOf() and reads WebP, so a WebP preview keeps its thumbnail. * fix(gui): find an EPUB cover whose path holds an XML entity The paths an EPUB's container and package document give are XML attribute values, so a cover at "Tom & Jerry.jpg" is the entry "Tom & Jerry.jpg". The entities in them are now decoded before the percent-encoding is. * fix(gui): pass over a damaged preview entry for the next one a package holds * fix(gui): try each cover an EPUB declares until one is a usable picture * test(gui): import the ZIP fixture with the DOCX one it sits beside |
||
|
|
ef5a78e5bd |
feat(puter-js): offer Add Credits in the Low Balance dialog to accounts with a plan (#4577)
A call refused for credit on a website shows the Low Balance dialog, whose only action was Upgrade. An account that already has a plan can buy add-on credit instead, which is quicker and cheaper than changing plans. For such an account the dialog now leads with Add Credits, which shows the top-up as the user menu's item does, and keeps Upgrade Plan beside it. Accounts without a plan, team seats and every other refusal see the dialog as before. The rule for who can top up moves into lib/topUp.js, shared with <puter-user-menu>. |
||
|
|
59524cc580 |
feat(auth): phone on file step, email replacement while unconfirmed, no lock without email (#4707)
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* feat(auth): phone on file step, email replacement while unconfirmed, no lock without email - Phone gate on an account that already has a number: /send-confirm-phone sends the code to that number and ignores any other, /confirm-phone checks only that number, and `lostNumber: true` opens the card fallback (409 when there is none). The send response and whoami carry `phone_on_file`, the number's last two digits; the phone window drops the number field for it. - /user-protected/change-email runs while the email code is pending, with every other gate still applied, for an account with a verified phone, card, paid plan or second factor; otherwise the code is still required. Provider-only accounts keep the code. Confirming the replacement runs the same side effects as confirming the code. The email window gets a step for it. - The per-account wrong-password lock skips accounts with no email; the failures still count and alarm. - puter.signin.validate carries `credential_exposed`. - GUI gate flows read the account again between gate windows and before opening one. * feat(auth): a number on file is stood in for only by the card on file; two codes a day - The card fallback for a phone on file opens only when the account already has a card, and confirming it clears the phone step only when the card's fingerprint matches the one on file (`card_not_on_file` otherwise). - Codes to a number on file: two per account per day; past that the route answers 429 `phone_on_file_send_limit` and offers the card on file. - Phone window drops the signup help line in on-file mode; the email window's footer no longer shows a stray separator in the change step. * feat(auth): replacing an unconfirmed email takes a factor the account had before A phone or card first verified while the address is unconfirmed is recorded in the account's metadata (`factorsAddedWhileEmailPending`), before it is stored, and no longer counts toward /user-protected/change-email. A number on file proven again and the card already on file still count, as do a second factor and a paid plan. The route no longer asks for a new factor; with none from before it answers `email_confirmation_required`, and the email window says the code is needed. * feat(auth): email replacement and the card stand-in each take proof in hand - Replacing an unconfirmed email: a dormant sign-in records, once, the number the account had (`phoneAtDormantSignIn` in metadata). The change is allowed only when the account still has that number and proved it within the hour, by its code or by the card on file; otherwise the route starts the phone step for it, or answers `email_confirmation_required`. A phone or card merely being on the account, a paid plan, and a number or card verified since no longer count. This replaces the list of factors added while unconfirmed. - Card confirmation while a number on file waits: only the card already on file verifies, under any gate order. The confirm event carries `required_fingerprint`, and the listener reports `card_entered` (details typed for this confirmation, not a saved card or an old confirmation); both are checked. - A card fallback opened earlier no longer offers a card to an account whose number on file has no card to stand in for it. |
||
|
|
743c1a772d |
feat(puter-js): the user menu shows its Upgrade button by default, signed in or out (#4712)
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(puter-js): the user menu's Upgrade button shows signed out, and signs in first Signed out or on a temporary account, a click signs in as the Sign in button does, then opens the upgrade for the account that signed in, unless it's a seat. * fix(puter-js): keyboard focus stays on the user menu's Upgrade button through the sign-in it asks for Loading the account that signed in hid the button and dropped the focus to the page, where the upgrade frame then handed it back. * feat(puter-js): the user menu shows its Upgrade button by default, and hide-upgrade hides it A page that sets show-upgrade gets the button as before. |
||
|
|
f0d44a5d4f |
feat(puter-js): <puter-user-menu> can show an Upgrade button (#4711)
* feat(puter-js): <puter-user-menu> can show an Upgrade button With the show-upgrade attribute, the user menu shows an Upgrade button to the left of the Apps button for a signed-in user. It is hidden by default, and while signed out or on a temporary account. Clicking it shows the upgrade in a frame over a first-party page, and opens the dashboard's upgrade page in a new tab anywhere else. The dashboard upgrade URL always carries the upgrade parameter, empty when no refused call is behind it, so the tab opens the upgrade flow either way. * feat(puter-js): the user menu's Upgrade button reads Manage plan for an account with a plan The button's label follows whoami's subscribed: Upgrade without a plan, Manage plan with one (manage-plan-label overrides it). An upgrade made in the frame the button opens changes the label when the frame closes. The button is hidden for a seat, whose team changes the plan. * fix(puter-js): the user menu's Upgrade button reads Manage plan after any framed upgrade An upgrade made in a frame opened by puter.ui.requestUpgrade(), such as from the usage limit dialog, gave the cached whoami a plan but left the button reading Upgrade. The UI module now tells internal listeners when a framed upgrade gives the user a plan, and the menu re-renders its plan state from it. * fix(puter-js): a double-click on the user menu's Upgrade button opens one tab On a page that can't frame the upgrade, each click of a double-click opened the dashboard's upgrade page in its own tab. The button now ignores the second click of a double-click. * docs(puter-js): the user menu's label follows any framed upgrade * fix(puter-js): the user menu's Upgrade button shows its pressed state under a mouse The :hover rule came later at the same specificity, so a press looked the same as a hover. |
||
|
|
bfcacc8469 |
fix(db): bound numbers must be safe integers; path, cursor and lookup input checks (#4708)
* fix(db): bound numbers must be safe integers; path and cursor input checks Bound numbers outside ±2^53 (including NaN and Infinity) are refused with a 400 by every database client. - Paths longer than 4096 characters are refused with a 400. - The path lineage lookup returns null for paths deeper than its walk without querying. - The read batcher's circuit breaker counts a failed fallback flush only when an item could not reach the database. - App, subdomain and worker list cursors must carry a non-negative integer id. - App stats grouping accepts only its own keys. - App batch lookups skip values of the wrong type, and app writes refuse keys that are not column names. - User, notification, durable subscription and KV share handle lookups return no row for values of the wrong type. - OIDC links are looked up by the sub as a string. - User-to-user and group permission reads keep exact matches only. - revoke-dev-app validates its parameters like grant-dev-app. - A durable subscription's expiresAt must be before the year 10000. - Installed apps paging reads page and limit as whole numbers. * fix(db): review follow-ups for input checks - The path length check measures the canonical absolute path, after the leading slash is added and a trailing one dropped. - The lineage lookup handles up to 500 segments, SQLite's compound select limit. - Group permission reads keep matching by the column's collation. - A server error code is never read as a lost connection from its message. - Cursor ids must be integers or digit strings, and a cursor that is neither a string nor an object is refused. - OIDC links store the sub as a string, matching lookups. - findEmailOwner returns no row for a value that is not a string. - Invalid stats groupings and non-string or non-number expiresAt values return a 400. - Installed apps limit clamps before rounding down. |
||
|
|
03639b9589 |
fix(db): bound parameters must be scalars; text lookups match only strings (#4706)
Every database client refuses an array, object or function parameter with a 400 before it reaches the driver. Strings, numbers, bigints, booleans, null, dates and buffers still bind. tryHardReadAll checks the whole batch first. Store lookups on text columns return null for a value that is not a string: users (only id takes a number), apps (also existsByName and uidExistsOnPrimary), fsentries by uuid, subdomains by uuid, sessions by uuid, shares and notifications by uid, notifications by send key. OIDC links still look up a numeric provider sub. |
||
|
|
31d9f2a89c |
feat(thumbnails): JSON and CSV files get a thumbnail (#4699)
Notify HeyPuter / notify (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
* feat(thumbnails): JSON and CSV files get a thumbnail
The desktop draws the start of a .json file like other source code, in a
fixed-width font with keys, strings, numbers and comments colored. A JSON
file whose first line holds a comma, as minified JSON does, is laid out
first one member or element to a line. That layout stops after 64 lines
and indents no deeper than 16 levels, so a file of nothing but brackets
costs no more than any other.
A .csv file is drawn as a spreadsheet opens it, through the sheet drawer
the XLSX reader uses: gridlines, default-sized cells, numbers aligned
right and other text left. Quoted fields follow RFC 4180, and the
delimiter is whichever of comma, semicolon, tab or bar the first line
holds the most of. Cell text is drawn as text; nothing is evaluated.
Both read only the first 16 KiB and share the 2-second upload queue the
other text files use. The dashboard downloads only that much when it
makes a thumbnail for one that has none.
* fix(thumbnails): a quote inside a CSV header field no longer hides its delimiter
Delimiter detection opened a quote at any double quote, while the parser
opens one only at the start of a field. A header such as `Size 5";Length`
then counted no semicolons and the whole file was drawn in one column.
* fix(thumbnails): CSV dates, times, money and grouped numbers align right
A spreadsheet reads these as numbers and aligns them right, as the XLSX
thumbnail does for the same data, but the CSV thumbnail drew them as left-
aligned text.
* fix(thumbnails): a CSV's sep= line sets its delimiter and isn't drawn
Exporters write a first line such as sep=; so Excel splits the file the
same way in every locale. Excel uses it and hides it; the thumbnail drew
it as a row of its own.
* fix(thumbnails): JSON layout keeps block comments apart from their neighbors
A block comment that started a line, such as a copyright header, had the
next token appended to it (`/* ... */{`), and one inside a line touched the
value after it.
* fix(thumbnails): a CSV number too wide for its cell keeps its leading digits
A right-aligned value wider than its column was clipped on the left, so an
ISO date drew as 24-01-15 and 1,234,567.89 as 34,567.89. Numbers in a CSV
sheet that don't fit their cell are drawn from the side the sheet starts at
and still cut off at their cell, as numbers don't run on.
* fix(thumbnails): text that isn't UTF-8 is read in the Windows code page
Excel on Windows saves a CSV in Windows-1252 by default, and accented
letters drew as replacement characters (Caf�). Text that isn't valid UTF-8
is now decoded as Windows-1252. A UTF-8 character cut in two by the read
limit is left out instead of making the whole read fall back.
* docs(thumbnails): describe CSV dates, sep= lines and Windows-1252 text
|
||
|
|
fdc1f9f3d8 | feat(ai): add Gemini 4 Neon chat model (#4695) | ||
|
|
8955253e2f |
feat(gui): app launches say what the user did and which page sent them (#4697)
Apps get `utm_content` set to how the user opened them: `app_icon`, `file_open`, `open_with` or `file_drop`. Apps opened from the app browser embed get the framing page's host as `utm_source`, which the server reads from the same referrer check that pins `frame-ancestors`. |
||
|
|
442a50baed |
fix(auth): user lookups match only string and number values (#4698)
UserStore.getByProperty returns null for a value that is not a string or a number, so an array or object from a request body never reaches the query. POST /send-pass-recovery-email answers 400 for a username that is not a string; it answered 500 for an array. |
||
|
|
4e50c81204 | clean up fast mode docs (#4696) | ||
|
|
e8bf0086dd |
fix(gui): no border around the captcha widget once it has passed (#4694)
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
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
The widget renders in its interaction-only mode, so when it passes without asking for anything there is nothing on screen and the border showed as a small green ring on the login and signup screens. |
||
|
|
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. |
||
|
|
5266f40383 |
feat(dashboard): file thumbnails get a subtle shadow in the grid views
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
|
||
|
|
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. |
||
|
|
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. |
||
|
|
6478f18feb |
perf: whoami row reuse, thumbnail URL cache, KV refusals, dashboard KV boot batch, profile revalidation (#4687)
* perf(whoami): answer from the user row token auth already loaded Token auth builds the actor from the user's row with the password hash left out. It now records `hasPassword` in its place, so /whoami builds the details (`oidc_only`, `is_temp`) from the actor and skips reading the same row again by id. An actor built any other way still reads the row. * perf(thumbnails): reuse a read URL signed this hour A thumbnail's read URL is the same for the whole signing hour, so listings re-signed it for nothing. Signed URLs are kept per signing client, keyed by the signing key, bucket, object key and hour (5,000 entries, one hour). A new signing key signs afresh. * perf(kv): a refused conditional write ends at the refusal when it can `set` with `onlyIfAbsent` on a live key, and a write or delete into a foreign namespace refused by a private entry, made four store calls: the refused write, a refused expired-row delete, a consistent read and a second refused write. The conditional write now asks for the refusing item. When its `ttl` is absent, null or a number, the condition already judged it the way reads do and the refusal stands after one call. A text or boolean `ttl`, or a refusal without the item, still settles and retries as before. * perf(gui): the dashboard reads its saved settings in the boot batch The GUI's boot KV batch fetched the desktop's keys on every boot, while the dashboard read its seven (Files view and sort, Apps order, groups and uninstalled list) one request each. The batch now carries the keys of the interface that booted. The uninstalled-apps read-modify-write skips the batch, which may predate another window's write. * perf(profile): answer a revalidated GET /profile without reading it A profile write records a hash of the stored JSON in the file's metadata. GET /profile sends it as the ETag with `Cache-Control: private, no-cache` and answers a matching If-None-Match with 304 before reading the stored profile. Visibility is checked first, so a hidden profile still 404s. A profile stored before this has no tag until its next write. * fix(thumbnails): a listing's concurrent signings share one URL cache The per-client cache was registered after the first signing returned, so a cold client's first listing kept only one of the URLs it signed. * fix(kv): recheck a refusing row's expiry and its private flag A numeric `ttl` that passes while the refusal is on its way now settles and retries, as before, instead of answering false. A share holder's refused `onlyIfAbsent` takes the private flag from the refusing item rather than an eventually consistent read after it. DDBClient tests cover the request and the undecoded item on the wire. * fix(gui): Apps refreshes read the saved layout from the store Only the open's first load takes it from the boot batch. A refresh exists to pick up another tab's changes, which a batch fetched a few seconds earlier can predate. * fix(profile): tag a profile response by the bytes it carries The file is written before its entry and the entry can be read from a cache that is behind, so a 200 now carries the tag of what was read. Tags are weak (the compressed and plain bodies share one) and the early 304 sends `Vary: Accept-Encoding` like the 200. A profile stored without a tag still answers 304 to its content tag, after reading the file. * fix(kv): the GUI boot batch only answers for the token it was fetched with A sign-in from another tab swaps the token while the batch is still live, so reads under the new account fall through to the store. |
||
|
|
65f3586847 |
fix(puter-js): accept the built-in web search tool in chat options (#4628)
* fix(puter-js): accept the built-in web search tool in chat options
The chat docs pass `tools: [{ type: "web_search" }]`, but `ChatOptions.tools`
only accepted function definitions, so the documented call was a type error.
`ChatOptions.tools` now accepts `Tool | BuiltInTool`, where `BuiltInTool` is
`{ type: 'web_search' }`. `Tool` is unchanged. There is no runtime change, since
the backend already accepts this tool.
* docs(puter-js): mark the chat vision option deprecated
The SDK sets vision itself when an image is passed, and the backend never reads it, so a caller's value has no effect. The type stays so existing callers still compile.
|
||
|
|
25804a8fbe |
Merge pull request #4681 from HanadHassan/HH/alibaba-catalog-snapshot-aliases
fix(ai): Alibaba snapshot names fold into the curated model instead of listing unpriced |