221 Commits
Author SHA1 Message Date
Tautvydas Derzinskas 88949d9d8c feat: let users choose what their API token can read over the REST API
The API token read every GET endpoint. It now reads only the scopes its user allows
(search, models, dashboard, activity, collections, tags, categories, authors, images,
model files, imports, everything else), set beside the MCP tools in a sectioned Token
permissions dialog. Existing and new tokens get every scope, so integrations such as
Homarr and holm keep working; a refused request names the scope it needs.
2026-10-21 17:57:28 +02:00
Tautvydas Derzinskas 0d0eeaf7a8 Merge pull request #111 from Ruivalim/feat/mcp-endpoint
feat: MCP endpoint for AI assistants, with tools chosen per API token
2026-10-21 16:57:17 +02:00
Tautvydas Derzinskas 5dc6ff67a3 fix: leave room for a reasoning model's thinking in the AI token budget
Thinking comes out of max_tokens, so even low effort could use up a description's budget and cut the answer off. Each effort now adds room on top of the answer, and the description budget allows for URLs and escaped HTML.
2026-10-21 13:30:14 +02:00
Mantas Kantautas 060be2f692 fix: keep non-ASCII names readable in zip downloads
The zip writer stores entry names as UTF-8 but did not set the UTF-8 flag
(general purpose bit 11), so readers decoded them as CP437 or Latin-1.
Any model, category or file name with a non-ASCII character came out
garbled, including when the zip was imported back into Thingport.
2026-10-21 14:07:33 +03:00
Tautvydas Derzinskas 6555875e29 fix: check an imported model's description once its import is done
The AI description check started as soon as the model was created, before
its pictures were attached and its description's images stored locally.
Storing them rewrites the description, so a suggestion that came back
after that was dropped and logged as unchanged. Imports now start the
check when they finish; uploads still start it straight away.
2026-10-21 12:48:46 +02:00
Tautvydas Derzinskas 8affbbb6c3 fix: count only MakerWorld profiles with an id before taking the raw files
The import now skips profile records without an id, as the profile jobs
already did, so a model with none usable gets its raw files there too.
2026-10-21 12:12:35 +02:00
Tautvydas Derzinskas 437d85be14 feat: import MakerWorld models that have only raw files
Some MakerWorld listings have no print profiles, only the STL/CAD files
behind "Download STL/CAD files". The backend now downloads those as the
page's own zip and unpacks every model file onto the model, and a zip
Grab passes on is unpacked the same way instead of being stored whole.
Every-profile and queued imports take the raw files instead of failing.
2026-10-21 11:58:06 +02:00
Tautvydas Derzinskas 151a2731af ci: publish :dev images when changes are merged into develop
Testers who want changes before a release can point at :dev. :latest and
the version tags still only come from releases on main. Dev images carry
RELEASE_CHANNEL=dev so the update checker compares them with develop.
2026-10-21 10:00:38 +02:00
Tautvydas Derzinskas 8b4653e415 fix: harden mesh check against bad indices and tidy review follow-ups
- Reject triangle indices outside the vertex list instead of stalling the queue
- Leave degenerate triangles out of body bounding boxes
- Skip the quality fetch without a print id and never show a previous print's result
- Disable the per-check switches while a save is in flight
2026-10-21 08:55:58 +02:00
Tautvydas Derzinskas dec1b0dbe3 feat: admin MCP access, token permissions dialog, and review fixes
Follow-up to the review of the MCP endpoint, after merging develop.

Backend
- Instance-wide MCP access an admin sets (Off / Read only / Read and
  change, default Read and change), at GET/POST /settings/mcp and logged
  as mcp_access_changed. Off turns every token away at /api/mcp; Read
  only offers and answers only the tools that read, refuses turning a
  write tool on, and keeps a token's earlier write choices so they come
  back with Read and change. GET /profile/api-token carries mcp_access
  and only the tools it offers.
- Model links come from the public URL an admin saved, not the
  PUBLIC_URL env var it's only seeded from.
- An import refuses a category that isn't the user's own, for POST
  /import and import_model alike.
- add_to_collection inserts and logs only the models it actually adds.
- get_import_status refuses a task the web app started instead of
  failing on its result.
- The migration is now 20261030120000_api_token_mcp_tools, after every
  migration on develop and on open branches.
- Tests for each access level, the category check, a web app task id
  and the logged count.

Frontend
- The token's MCP tools move off the profile into a Token permissions
  dialog behind a cog beside the token, with MCP as its first section
  so the REST API's permissions can join it later.
- Each tool is a row: a small CSS tile picturing what it does (moving
  only while its row is hovered or focused, still for reduced motion,
  greyed when denied), its name and description, and a Deny / Allow
  Segmented control. Tools are grouped by whether they read or change
  the library.
- Admin Auth page: an AI assistants (MCP) section to set the access.
- The connect command gets a copy button and is hidden while MCP is off.
- Regenerating says the token's tools go back to the read-only ones.
- Save errors go through toasts.
- Spanish and French strings for every MCP key, and the new keys in all
  four languages.

Docs
- mcp.md and api-token.md: the Token permissions dialog, the admin
  setting, the regenerate reset, and what an assistant reading scraped
  descriptions could be talked into.
2026-10-21 08:47:49 +02:00
Tautvydas Derzinskas 12a6375832 Merge branch 'develop' into feat/mcp-endpoint 2026-10-21 08:47:09 +02:00
Tautvydas Derzinskas f913710cc4 feat: check models for print problems when they are opened
Closes #37. The first time a model is opened, each of its STL, OBJ and 3MF
files is checked in the render worker for holes, non-manifold edges, flipped
or inside-out faces, loose fragments, missing 3MF parts, damaged files and an
unlikely size. The rules follow ADMesh and Blender's 3D Print Toolbox.

The model page shows a scan overlay while it runs, then a tick or a
severity-coloured warning beside 3D Preview that opens a report with an
animated tile per problem. Results are saved per plate and rechecked only
when QUALITY_CHECK_VERSION changes.

Admins can switch checks off as a whole or per problem under Rendering;
severity and switched-off problems apply when results are read, so neither
needs a recheck. Checks are on by default.
2026-10-21 07:41:24 +02:00
Rui Valim 0da5db6536 perf(backend): load a listing's files for the returned page only 2026-10-20 21:59:42 -03:00
Tautvydas Derzinskas 8db1c02f07 Merge pull request #108 from TautvydasDerzinskas/feat/reset-to-defaults
Feat/reset to defaults
2026-10-20 20:39:57 +02:00
Tautvydas Derzinskas ef14f54221 fix: guard tag rewrites against concurrent edits, pluralise merge count, fix lt wording 2026-10-20 20:12:31 +02:00
Rui Valim 04e97197d7 fix(mcp): rank list_tags by use and let it narrow, instead of every tag at once
A real library of 488 models has 4,306 tags: the whole list came to 63 KB,
more of an assistant's context than one answer should take. It now
returns the most used 200 by default, with how many models have each,
and takes a query to narrow them.
2026-10-20 15:00:20 -03:00
Tautvydas Derzinskas 1a44b87cdc fix: count suffixed renames, roll back failed theme saves, keep reset dialog open on error 2026-10-20 19:58:08 +02:00
Rui Valim a36a99639a feat(backend): MCP tools that import models and file them into collections
import_model imports a link through the same checks, log and
notification as + Add > Import, optionally into a collection, and hands
an import still running after 25 seconds over to get_import_status.
create_collection and add_to_collection make and fill collections. None
deletes or overwrites anything.

They're off for every token until its user turns them on. import_model
skips the captcha, as Thingport Grab does: an assistant has nowhere to
show one, and the user chose to give it the tool.
2026-10-20 14:54:41 -03:00
Rui Valim 278688e64c refactor(backend): move single imports and collection filing into services
POST /import's checks and its log and notification, creating a
collection and adding models to one were written in the routes. They're
now services the routes call, so other callers run the same checks and
leave the same trail.
2026-10-20 14:54:41 -03:00
Tautvydas Derzinskas a0dbba8058 feat: sort, bulk actions and merge for collections and tags
Collections sort by newest, name or most models; tags gain a newest sort. Both pages get select mode with merge, bookmark and delete. Merging asks which one to keep and previews the result: the kept one's new model count, what is deleted, a bookmark moving over and syncs that stop. Built-in collections sit select mode out.
2026-10-20 19:50:56 +02:00
Rui Valim 8567f195c0 feat(backend): MCP endpoint at /api/mcp, with tools chosen per API token
An AI assistant connects over Streamable HTTP (stateless) with the user's
API token and gets read-only tools: search_models, list_models,
get_model, list_collections, get_collection, list_tags,
list_categories, get_author and library_stats. Each runs as the token's
user through the same services as the REST API.

Every MCP message is a POST, which requireAuth refuses to an API token,
so /api/mcp checks the token itself and is mounted before the routers
that apply requireAuth to every path. The token stays read-only over
REST; over MCP it only reaches the tools its user ticked, stored per
token in User.apiTokenMcpTools. Existing tokens get the read-only tools;
a tool that writes would be off for every token until its user turns it
on.

get_model reads through printOutById rather than GET /print/:id, so an
assistant looking a model up doesn't count as a view or land in
Browsing History.
2026-10-20 14:23:37 -03:00
Rui Valim 0931af55ea refactor(backend): move the library listing's filters and order into a service
GET /prints and GET /tags built their query from the request itself. The
same listing is now a function of a user and plain filters, so other
callers list exactly what the library page lists for the same filters.
2026-10-20 14:23:36 -03:00
Tautvydas Derzinskas f8424dcb23 feat: reset categories to the starter tree, previewing what changes 2026-10-20 19:22:56 +02:00
Tautvydas Derzinskas 67bea149a9 fix: list a nested pictures folder's files as its own model's 2026-10-20 16:14:50 +02:00
Tautvydas Derzinskas ecc551ef27 fix: touch only a model's own pictures, check picture files once, drop plate folders for other files 2026-10-20 15:46:22 +02:00
Tautvydas Derzinskas 0d505b716a feat: keep a model's pictures and supporting files beside its model files
Gallery and description images, plate thumbnails and renders now live in an
Images folder next to the model's files (Print.assetsPath), and supporting and
prepared files sit beside the plates, named through the storage template. They
move with the model when the storage structure changes, and the storage browser
lists them by kind.

Models from before keep working: reads fall back to the old shared folders, and
the first start runs the storage move to bring their files over, then clears
what's left in those folders.
2026-10-20 15:09:19 +02:00
Tautvydas Derzinskas 401cc38461 fix: retry a dashboard row's render when its url changes 2026-10-20 14:19:36 +02:00
Tautvydas Derzinskas 74ca5cbc0e refactor: read tag mosaic pictures once for both kinds 2026-10-20 14:07:44 +02:00
Tautvydas Derzinskas 4c301bb460 test: cover render colour and hover slideshow, drop dashboard thumbnails tests 2026-10-20 13:49:15 +02:00
Tautvydas Derzinskas 926c5d345b feat: add render colour, graphite accent and hover slideshow toggle
Appearance gains a render colour that tints generated renders, the dashboard lists, tag tiles and the 3D preview.
It follows the accent until picked apart, and offers the accents plus an untinted light grey. A graphite accent
joins the palette, light grey in the dark theme so it stays visible. The hover slideshow on model cards can be
turned off, and the language picker moves to the top.

The dashboard's own Thumbnails option is gone: its lists and the tag tiles now lead with pictures or renders as
the model cards do, tags from a mosaic of the models' renders. The one-colour dashboard icon is no longer made.
2026-10-20 13:32:53 +02:00
Tautvydas Derzinskas 678c4802d7 fix: address card preview review comments
Retry thumbnail adoption for a cached render, reset card and model-page
render state per print, scope the card-preview choice to the signed-in
account and put it back when saving fails.
2026-10-20 11:37:44 +02:00
Tautvydas Derzinskas 908ae80b5b feat: tint generated model renders with the accent
Model cards can lead with the model's own pictures (default) or with our render, a choice saved per user in Appearance. The server draws each model once in grey shading on transparent, from the first file it can draw, simplifying oversized meshes and viewing flat models from above; the browser tints it with the accent, so every theme and accent shows at once. The model page's 3D preview offers the accent palette and opens in the chosen accent.
2026-10-20 11:03:54 +02:00
Tautvydas Derzinskas d26f730bee feat: let users pick an accent color
Appearance gains an accent picker: Thingport green plus colors from provider brands (Thingiverse, Printables, Thangs, MyMiniFactory, Cults3D). The choice is stored per user beside the theme and recolors the app, the logo and its seasonal overlays at once.
2026-10-20 10:16:55 +02:00
github-actions[bot] 999179a7f9 chore(backend): release 1.1.0
# [thingport-backend-v1.1.0](https://github.com/TautvydasDerzinskas/Thingport/compare/thingport-backend-v1.0.2...thingport-backend-v1.1.0) (2026-10-20)

### Bug Fixes

* add validation and improve error handling in sync operations ([7c3c7ec](https://github.com/TautvydasDerzinskas/Thingport/commit/7c3c7ec90298672150219ea18c44ac37bc40280c))
* correct category updates and improve NexPrint error handling ([1cf2903](https://github.com/TautvydasDerzinskas/Thingport/commit/1cf2903b8efd9e13f71b50e4e768f7930c1382eb))
* detect Cults3D clearance cookie in Cloudflare partitions ([2f66ed6](https://github.com/TautvydasDerzinskas/Thingport/commit/2f66ed682b1bc61b0a6c456db23aedbc15193eb1))
* handle malformed tokens, add refresh concurrency control, and improve list URL validation ([44f4bf2](https://github.com/TautvydasDerzinskas/Thingport/commit/44f4bf26354675ce41ee0c7e2684d3fe9384e70f))
* Makerworld profile thumbnails being all the same ([c6c8161](https://github.com/TautvydasDerzinskas/Thingport/commit/c6c8161a74dceca83d0827fec00735763ce76428))
* models with images should use them as thumbnails ([cf0653b](https://github.com/TautvydasDerzinskas/Thingport/commit/cf0653b005e9339a8cd0f200a7ef4a7e6f028f75))
* page a Thangs collection to the end without a total ([68a1481](https://github.com/TautvydasDerzinskas/Thingport/commit/68a14817079d8cc3bd275cfe4badf7bc16084194))
* **printService:** restore file on failed plate database update ([03fdd83](https://github.com/TautvydasDerzinskas/Thingport/commit/03fdd836a5889e9f06deea8d2311d69cae27efa1))
* tell print profiles apart by name and picture on every provider ([f34a488](https://github.com/TautvydasDerzinskas/Thingport/commit/f34a488fb21b69b50e8170105f5933f70cf46f01))

### Features

* add Cults3D provider ([930b9b4](https://github.com/TautvydasDerzinskas/Thingport/commit/930b9b48dba5c2375d4fccf2e59ced2965e87711))
* add MyMiniFactory as a provider ([a7a9190](https://github.com/TautvydasDerzinskas/Thingport/commit/a7a91902a0f43d47741e8cb52c1ec294f143fadb))
* add Thangs provider ([2591714](https://github.com/TautvydasDerzinskas/Thingport/commit/2591714c0cd44b086c0cb3c94d11e99c8262fe81))
* enable Creality Cloud provider ([772b1ac](https://github.com/TautvydasDerzinskas/Thingport/commit/772b1acfef609796015b51db186012e717124bc5))
* enable NextPrint provider ([4037151](https://github.com/TautvydasDerzinskas/Thingport/commit/4037151e4aaa6a744469b52ef60f999b343e085a))
* multi-select models in grids with bulk actions ([fe5dbec](https://github.com/TautvydasDerzinskas/Thingport/commit/fe5dbecdc5a76ab43eec39a5dd432626a9eaf2f6)), closes [#91](https://github.com/TautvydasDerzinskas/Thingport/issues/91)
* pick mapped provider categories by name ([87db3f0](https://github.com/TautvydasDerzinskas/Thingport/commit/87db3f0ff0346a2811ea4b4659056e9e5928df22))
* preview dashboard panels as tiles and add an activity heatmap panel ([c65e712](https://github.com/TautvydasDerzinskas/Thingport/commit/c65e712a31c30c0c0621c440a50a4e3f256dfb42))
* **providers:** enable MakerOnline provider ([5bf3457](https://github.com/TautvydasDerzinskas/Thingport/commit/5bf3457e8c5a5448c97f12fb0ac9101137884dca))
* **providers:** enable Snapmaker Space provider ([ac5bf25](https://github.com/TautvydasDerzinskas/Thingport/commit/ac5bf253c7c3a09abd0ce90e8c24539004f0f879))
* replace the AI Thinking toggle with a per-connection reasoning effort ([b30b0ce](https://github.com/TautvydasDerzinskas/Thingport/commit/b30b0cefd82691d391a9144d40efbd178ffbb331))
2026-10-20 06:35:30 +00:00
Tautvydas Derzinskas fe5dbecdc5 feat: multi-select models in grids with bulk actions
A select toggle above each model grid (models, collections, tags, search,
author) switches clicks from opening a card to selecting it. The selected
models can then be added to or removed from a collection, favourited or
unfavourited, downloaded as one zip, deleted, or sent to AI categorization
or description improvement.

The AI actions start a single library run limited to the selected models,
so they get the run's progress bar and one summary notification instead
of one provider call and notification per model.

Closes #91
2026-10-20 07:53:55 +02:00
Tautvydas Derzinskas c65e712a31 feat: preview dashboard panels as tiles and add an activity heatmap panel 2026-10-20 07:01:16 +02:00
Tautvydas Derzinskas 9a81ad8c9e test: remove incorrect cults3d_no_key assertion 2026-10-20 06:07:40 +02:00
Tautvydas Derzinskas e1ed0c6ff0 refactor: move Cults3D credential checks upstream and prefer keyed users
Cults3D API requires each model's owner's own API key. Move credential checks
into the lookup loop to detect unavailable keys earlier, and restructure the
selection query to prefer models from owners with configured API keys.
2026-10-20 06:03:25 +02:00
Tautvydas Derzinskas 37094b56db refactor: add Cults3D error handling and enhance sync provider picker with logos 2026-10-20 05:34:53 +02:00
Tautvydas Derzinskas 2f66ed682b fix: detect Cults3D clearance cookie in Cloudflare partitions 2026-10-20 05:17:12 +02:00
Tautvydas Derzinskas 930b9b48db feat: add Cults3D provider
Imports Cults3D models, anyone's likes and the user's own printlists, and
syncs them. Metadata comes from Cults3D's GraphQL API with each user's own
nickname and API key. The API never hands out files, and the site's pages are
behind a Cloudflare check only a browser passes, so Thingport Grab sends the
browser's _session_id and cf_clearance cookies with its User-Agent; with
them the server orders a free model for nothing, as its Download button
does, and follows the download page to the signed file link (CloudFront, or
Cults3D's Scaleway bucket for older models). Paid models download once
bought. A Cloudflare block defers a sync until the next visit with Grab.
2026-10-20 05:08:08 +02:00
Tautvydas Derzinskas 7c3c7ec902 fix: add validation and improve error handling in sync operations
- Hide API keys from error messages by stripping query strings
- Validate that category responses contain entries before using them
- Distinguish between unreadable and malformed cookie values with proper types
2026-10-20 00:17:12 +02:00
Tautvydas Derzinskas 68a1481707 fix: page a Thangs collection to the end without a total
A collection answer without totalCount stopped after its first page, so syncs missed every model past 50.
2026-10-20 00:02:34 +02:00
Tautvydas Derzinskas 87db3f0ff0 feat: pick mapped provider categories by name
Each provider gets a Manage button that opens its categories as chips, by name, instead of a field of ids. The names come from a catalog checked in with the app, refreshed by backend/scripts/syncProviderCategories.ts. Stored values keep their shape.
2026-10-20 00:01:04 +02:00
Tautvydas Derzinskas 2591714c0c feat: add Thangs provider
Imports Thangs models, likes and collections, and syncs them. Metadata is
public; files need the user's own sign-in, which Thingport Grab sends and
Thingport renews from the refresh token. Paid models download once owned;
print-only ones are refused before any download. Free accounts' daily
download limit stops a batch and defers the rest of a sync to its next check.
2026-10-19 23:36:07 +02:00
Tautvydas Derzinskas cf0653b005 fix: models with images should use them as thumbnails
Uploaded images now replace generated renders for cover and thumbnail.
2026-10-19 21:01:50 +02:00
Tautvydas Derzinskas 03fdd836a5 fix(printService): restore file on failed plate database update
If the plate database update fails after moving a file, the file's
location no longer matches the stored path. Wrap the update in a
try-catch to restore the file to its original location on failure,
so the stored path still finds it.
2026-10-19 20:59:18 +02:00
Tautvydas Derzinskas f34a488fb2 fix: tell print profiles apart by name and picture on every provider
Profile files often come named alike, so the files on a model read the
same. A profile whose file clashes with another profile's is now named
after its profile, or by its title alone when that already holds the
file's name; profiles with the same title keep the site's name.

Each profile's own picture now becomes its file's thumbnail on Snapmaker
Space, MakerOnline, Creality Cloud and NexPrint too, not just MakerWorld.

Earlier profiles are renamed before the new file is placed, and a preview
render that loses its file to a rename retries from where it went.
2026-10-19 20:34:24 +02:00
Tautvydas Derzinskas c6c8161a74 fix: Makerworld profile thumbnails being all the same 2026-10-19 20:06:07 +02:00
Tautvydas Derzinskas 1cf2903b8e fix: correct category updates and improve NexPrint error handling 2026-10-19 18:39:24 +02:00