Commit Graph
3534 Commits
Author SHA1 Message Date
KernelDeimos 503c1a4bb8 test: refactor AppService comparison test 2026-01-20 16:28:22 -05:00
KernelDeimos 1c438107aa test(data-access): verify and fix database state compare
An "anti-test" (test that should fail) was created to verify that a test
fails when apps are different. This revealed a problem in the original
logic of comparing the database state (UUIDs don't need to be, and will
not be, identical; they need to be excluded from comparison). This
commit contains the new test and fixes the existing test case, which was
passing because this problem caused a false-negative.
2026-01-20 16:28:22 -05:00
KernelDeimos b17486b1b4 fix(backend): fix context dual-instance problem
The file `context.js` causes problems in unit tests because vitest does
not play nice with CJS, especially when both CJS and ESM are in use such
as in our repository.

Given that it is not feasible to solve the underlying interoperability
issue, I have elected to make `context.js` a singleton in `Symbol.for`.
This worked very well with `helpers.js`.
2026-01-20 16:28:22 -05:00
KernelDeimos be8b5ef70a fix(backend): singleton in helpers for testability
The `helpers.js` file has two instances when testing with vitest.
Usually this can be solved by creating an "import bridge" file - another
CJS file that imports the desired CJS file and re-exports it so that the
`require` mechanism for caching modules is used instead of the `import`
mechanism for caching modules. Unfortunately in my most recent test
cases this does not work. I do not know why this does not work. However,
without doing a deep-dive into the internals of vitest I can at least
see that the only state in helpers is for providing `services` as a
pseudo-global, so a hack with `Symbol.for` solves everything.
2026-01-20 16:28:22 -05:00
KernelDeimos 7531a94687 clean(data-access): remove bad fixes and simplify 2026-01-20 16:28:22 -05:00
KernelDeimos 01b50b66f2 test(data-access): regression test for es:app vs app
This test was very difficult to get working because of issues
initializing the context under vitest. After a lot of effort and trying
to narrow down the issue in many ways that didn't work, I eventually
found that manually setting the storage and calling run on the
AsyncLocalStorage object got it working. I'm currently unsure if this is
specific to vitest or not. We don't seem to do this in Puter's kernel
but everything works fine in the typical runtime. Maybe this is
side-effect of otel's own use of AsyncLocalStorage.
2026-01-20 16:28:22 -05:00
KernelDeimos 3a268e6f16 test(data-access): add tests for delete method 2026-01-20 16:28:22 -05:00
KernelDeimos 3fab0ca6a2 dev(data-access): implement .delete() method 2026-01-20 16:28:22 -05:00
KernelDeimos 1e3b704ea8 fix(data-access): add guard for app actors 2026-01-20 16:28:22 -05:00
KernelDeimos 25d23d687c dev(data-access): add simplified upsert method
This is a naive implementation of the `.upsert()` method that simply
calls `.create()` or `.update()` depending on whether or not the app
already exists.
2026-01-20 16:28:22 -05:00
KernelDeimos c47c52a298 test(data-access): test .create() and .update()
Primarily these tests were AI generated an then checked over for sanity.
These tests are good unit tests to avoid regressions as a result of
changes to this code but are not sufficient to test for regressions
introduced by this new implementation that will replace `es:app`.
2026-01-20 16:28:22 -05:00
KernelDeimos bec39e578f dev(data-access): implement .create() method 2026-01-20 16:28:22 -05:00
KernelDeimos fc03fafab9 dev(data-access): misc improvements to .update()
DRY some redundant code and use guard clauses where applicable.
2026-01-20 16:28:22 -05:00
KernelDeimos 464241e743 dev(data-access): implement .update() method 2026-01-20 16:28:22 -05:00
KernelDeimos 7c5639005b test(data-access): app .select() and .read()
Fixes are also included for a couple issues that were found:
- `null` being included in extensions list
- property called `user_owner` instead of `owner`
2026-01-20 16:28:22 -05:00
KernelDeimos ec0b333ad7 dev(data-access): implement .read() method
Most of this implementation matched `.select()` which saved time. The
common behavior can be factored out, but since the purpose of this
refactor is to flatten everything as much as possible I'm going to leave
the duplicated code and make a note to do this later.

The challenging part was `#build_complex_id_where()`, which is the
equivalent to the `fetch_based_on_complex_id_()` method in
EntityStoreService. This allows `uid: app-UUID-OF-APP` and `id: { name:
'editor' }` to both work.
2026-01-20 16:28:22 -05:00
KernelDeimos 2bb036616f dev(data-access): app select icon_size` param
Adds the `icon_size` parameter to the `.select()` method on the new
non-ES/OM implementation.

When adding the necessary `params` parameter to the `.select()`
method, it was noticed that the `predicate` parameter did not have a
default value - potentially causing a regression; a default value was
set for both `params` and `predicate`.
2026-01-20 16:28:22 -05:00
KernelDeimos 7cd7be7af5 dev(data-access): add filetype associations 2026-01-20 16:28:22 -05:00
KernelDeimos 3839afd805 dev(data-access): add app owner relationship
It turns out self-referencing tables add some nuances to what is and
what isn't ambiguous in SQL queries, so getting this right took a little
longer than expected. Following the entire chain doesn't seem to be
possible so a compromise is made by only traversing one level of depth.
(you can the uid of the owner of the app, but not the uid of the owner
app's own owner)
2026-01-20 16:28:22 -05:00
KernelDeimos 1a8130b8fd dev(data-access): add owner object to app select 2026-01-20 16:28:22 -05:00
KernelDeimos 6592f87882 dev(data-access): coerce boolean values from db
Adds `as_bool` utility function for boolean values from MySQL and
Sqlite, based on the previous implementatoin for ES/OM.
2026-01-20 16:28:22 -05:00
KernelDeimos a85d2b7098 fix(perms): fix revokePermission for "flat" impl
The "flat" implementation of permissions was broken because
revokePermission tried to delete entries by calling `.set` with an
option called "delete". I'm not sure if this has ever existed on the
puter-kvstore interface, so it's weird that it was called like that.
2026-01-20 16:07:10 -05:00
KernelDeimos 79fda7b8c2 fix(backend): update protected app perm implicator
The permission implicator for protected apps was written before changes
to the permission system that affect the conditions under which a user
is allowed to grant and revoke permissions; specifically this is the
`manage:` set of permissions, which now needs to be granted to the owner
of a protected app.

Additionally, the "level" component of the permission is ignored because
the owner of a protected all is implied to have all the permissions
pertaining to that protected app.
2026-01-20 16:07:10 -05:00
jelveh 6805c90252 Remove unnecessary logging in get_app function
Eliminated redundant cache and info log statements from the get_app helper to reduce log noise and improve code clarity.
2026-01-20 11:45:06 -08:00
Neal ShahandGitHub 13578e81e6 gemini 2.5/3 no preview (#2306)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-20 11:43:01 +05:30
KernelDeimos 3da318129c fix(puter.js): check for uuid before relative path
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-19 19:55:04 -05:00
KernelDeimos c715057065 feat(puter.js): make home directory default cwd
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Make the home directory (AKA "~") the default CWD for puter.js, making
relative paths work in environments other than app environments (i.e.
gui or worker environments).
2026-01-19 13:29:28 -05:00
Neal ShahandGitHub e95aa81e00 OpenAI web_search support (#2299)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-19 00:01:47 +05:30
Daniel SalazarandGitHub f9888e6705 feat: paginated list (#2296)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* feat: paginated list

* fix: kv list
2026-01-16 16:16:47 -08:00
Neal ShahandGitHub bd57f7a221 Add GPT 5.2 Codex (#2293)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-16 22:52:28 +05:30
Nariman JelvehandGitHub 6b45667220 Revert "feat(gui): add keyboard shortcuts guide dialog (#2278)" (#2288)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
This reverts commit 340d932ae1.
2026-01-15 15:35:13 -08:00
Rahul aswalandGitHub 340d932ae1 feat(gui): add keyboard shortcuts guide dialog (#2278)
* feat(gui): add keyboard shortcuts guide dialog

* feat(gui): add dedicated keyboard shortcuts dialog
2026-01-15 15:34:40 -08:00
KernelDeimos 21d02e7dae fix(backend): status code check and handle HLMkdir
Fix the status code handling in hl_mkdir and handling to the HLMkdir
operation itself. This effectively fixes #1603.

Resolves #1603
2026-01-15 18:32:08 -05:00
KernelDeimos 452d1de92e refactor: MkTree and QuickMkdir parent dir check
Extract common behavior from MkTree and QuickMkdir to a separate method
which is user by both operations.
2026-01-15 18:32:08 -05:00
KernelDeimos f125830fba fix(backend): handle ll_mkdir exists race condition
Handle a race condition affecting mkdir operations with the
`createMissingParents` option enabled. When creating a directory because
this option was specified, errors because the directory already exists
are likely due to a race condition and should not be propagated to the
client but instead handled by using the directory that's already there.
2026-01-15 18:32:08 -05:00
KernelDeimos f9a3e86fe9 fix: normalize file object in /writeFile
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-14 18:21:46 -05:00
KernelDeimos 5e4dfbc963 fix: attempt coercion to fix vscode corruption 2026-01-14 15:05:17 -05:00
Daniel SalazarandGitHub 0b9863814c fix: shard app usages properly by user (#2279)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-13 20:32:46 -08:00
Sauhbagya PrasadandGitHub 529a3d026b Improve UI for App Deployment Options in Dev Center (#2266)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
* Improve UI for App Deployment Options in Dev Center

- Added CSS styling for deployment option cards
- Implemented active state switching between deployment methods with guardrails
- Abstracted saveEditApp for reuse across Deploy and Edit tabs
- Added error handling for invalid URLs in the Deploy tab

* updated mode's description and fixed function's error

* updated by npm install

* Revert "updated by npm install"

This reverts commit 82cd962f62.

* in url mode the deploy button is enabled by default
2026-01-13 10:54:08 -08:00
jelveh 07f3387363 Add CAPTCHA required message to English translations
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Introduced a new translation key 'captcha_required' with the message 'Please complete the CAPTCHA verification' in the English locale file.
2026-01-13 10:19:31 -08:00
Neal ShahandGitHub f4c37d4cf4 prevent signout from workers (#2276) 2026-01-13 13:18:06 +05:30
Neal ShahandGitHub edcfe63131 no_extra_params in together service to prevent defaults from being specified (#2275) 2026-01-13 13:08:30 +05:30
Neal ShahandGitHub 989ee58f05 Retry for openrouter on max_tokens overage (#2274) 2026-01-13 12:30:05 +05:30
Neal ShahandGitHub bb6b40be7b Support getDeveloperProfile with no arguments (#2270)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-12 16:06:45 +05:30
Neal ShahandGitHub 8e6d3d8d9f Make puter boot on windows (#2269)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-12 15:26:53 +05:30
Neal ShahandGitHub 04901a7cd1 provide safety_identifier in addition to user (#2268) 2026-01-12 13:24:30 +05:30
Nariman JelvehandGitHub c051a6caa6 Add automatic thumbnail generation to file uploads in GUI (#2261)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Introduces thumbnail generation for image files during upload operations. Thumbnails are generated client-side if enabled via the `generateThumbnails` option, and are included in file metadata and operation payloads. This enhances file previews and user experience in the file system.
2026-01-11 09:38:33 -08:00
KernelDeimos 8e418a11a1 fix(backend): race condition in hashing_stream
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Based on a stack trace from production and manual static analysis, it
appears that a race condition occurs within hashing_stream
intermittently. The conditions that cause this issue might be heavy
backpressure. The source stream emits the 'end' event before
stream.Transform's transform callback has had a chance to process all of
the chunks, which results in an incorrect order in calling methods on
the `typeof crypto.createHash()` object.

It would appear that `source.pipe(stream)` is not able to propagate
errors from Transform because the chain was simply broken and upload
would get stuck (if this was indeed the cause of upload getting stuck,
which seems likely but not conclusive)
2026-01-09 20:02:50 -05:00
Daniel SalazarandGitHub d64bd21a99 feat: give referrals (#2262)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
2026-01-09 16:48:49 -08:00
Neal ShahandGitHub 5aa25bae5f Model singularity (#2255)
* model naming singularity

* model singularity pt2

* Remove incorrect assumption check which breaks openrouter:openai/gpt-5-image
2026-01-09 16:18:54 -08:00