Commit Graph

2910 Commits

Author SHA1 Message Date
Hariz 6429dcf15e Add 'Set as Desktop Background' context menu item to images (#1635)
* Add 'Set as Desktop Background' context menu item

* Use the `mime` library to detect images in the `UIItem` context menu

---------

Co-authored-by: Nariman Jelveh <nj@puter.com>
2025-09-30 18:06:09 -07:00
KernelDeimos 5cc182653e doc: document creating extensions through drivers 2025-09-30 16:33:34 -04:00
KernelDeimos 87f2fbf36b clean: DriverService
Removes dead code and reduces branching. In the get_service_or_throw_
method, the changes in this commit show how the branching got more
redundnat in the previous change.
2025-09-30 16:33:34 -04:00
KernelDeimos 41820baba6 dev: add extension support in DriverService
Adds new events that DriverService emits: `create.interfaces` and
`create.drivers`. Returns the functionality of the "drivers" registry,
which now expects objects provided by extensions.
2025-09-30 16:33:30 -04:00
Nariman Jelveh eaa31ba18f Update copyright headers that were translated to non-english 2025-09-30 12:54:00 -07:00
Nariman Jelveh 343f042f39 feat: add tar and untar functionality for file management
- Implemented `tarItems` function to create tar archives from selected files or directories.
- Added `untarItem` function to extract tar archives.
- Updated UI to include options for downloading and tarring files.
- Enhanced item icon handling to display tar file icons.
- Added translations for tar and untar operations.

- Fixes #1629
2025-09-30 10:35:55 -07:00
Daniel Salazar 9c47a7f8ca perf: move user-user perm checks to flat kv entries (#1562)
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-29 19:41:39 -07:00
KernelDeimos 1c64cb274b fix(ai): try overriding timeout to disable error
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
The Anthropic SDK preemptively throws an error if it thinks a response
is going to take longer than 10 minutes:
https://github.com/anthropics/anthropic-sdk-typescript#long-requests

According to this documentation, overriding the `timeout` option
disables this error. In this commit the option is changed to the default
value of 10 minutes plus an additional 1 second; it is assumed based on
the documentation's phrasing that it is not necessary to make the
timeout higher but simply to specify a value.
2025-09-29 15:08:23 -04:00
KernelDeimos df6fc8a432 test: fix test kernel after adding runtimle modules
RuntimeModules (a feature for extensions) can be accessed by core
modules through a registry exposed in Context by Kernel. However,
TestKernel was not exposing this same registry which caused an error
when module installation occurred during tests.
2025-09-29 14:27:07 -04:00
jelveh 208d25f371 Update ClaudeService.js 2025-09-29 11:20:34 -07:00
Andrei Onel d216887fa0 doc: add comments under filesystem, modules, entitystorage
* Added reference documentation for: src/backend/src/modules/puterfs/DatabaseFSEntryFetcher.js

* Added reference documentation for: src/backend/src/modules/dns/DNSService.js

* Added reference documentation for: src/backend/src/filesystem/ll_operations/ll_write.js

* Added reference documentation for: src/backend/src/filesystem/strategies/storage_a/LocalDiskStorageStrategy.js

* Added reference documentation for: src/backend/src/om/entitystorage/WriteByOwnerOnlyES.js

---------

Co-authored-by: askmanu[bot] <192355599+askmanu[bot]@users.noreply.github.com>
2025-09-29 14:16:50 -04:00
jelveh 5caf148ae9 Update ClaudeService.js 2025-09-29 11:16:13 -07:00
jelveh 847b3a07a4 Improve item.add cache invalidation logic so that it doesn't purge the entire cache
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-29 00:02:03 -07:00
jelveh a69072b31b More precise cache invalidation in case of item rename
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-28 23:43:36 -07:00
jelveh fe022cff1d Back to native purge to build from first principles?! 2025-09-28 22:50:55 -07:00
jelveh 1195e319a8 update kv.js version in package.json 2025-09-28 22:05:30 -07:00
Nariman Jelveh ebb0162d79 Increase cache efficiency 2025-09-28 21:30:31 -07:00
Nariman Jelveh 7382264648 more nuanced cache invalidation strategy with logging enabled by default 2025-09-28 20:35:51 -07:00
Nariman Jelveh a965df0cc0 Remove cache expiry in puter.js 2025-09-28 19:16:29 -07:00
Nariman Jelveh 72341c78dc Update index.js 2025-09-28 18:59:44 -07:00
jelveh ef74a1a660 fix: prevent unnecessary updates on socket events
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
Updated the `bindSocketEvents` method to check the `original_client_socket_id` before posting updates for 'cache.updated' and 'item.renamed' events. This prevents unnecessary updates when the event originates from the same client socket.
2025-09-28 14:35:45 -07:00
jelveh f1fd372933 refactor: improve metadata handling in WSPushService
Updated the `WSPushService` to pass additional metadata during user timestamp updates and event emissions for file system operations. This includes modifications to the `_on_fs_create`, `_on_fs_update`, `_on_fs_move`, and `_on_fs_pending` methods to ensure metadata is consistently included, improving the context for GUI updates.
2025-09-28 13:43:08 -07:00
jelveh 740089aff1 fixes #1622
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-27 00:03:49 -07:00
Xiaochen Cui 891093fd2b fix a typo (#1627)
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 (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
2025-09-26 21:45:00 -07:00
Haitam 733c7b638d feat: Complete missing Ukrainian, Turkish and Thai translations (#1616)
* feat: Complete missing Ukrainian, Turkish and Thai translations

* add the trailing comma

---------

Co-authored-by: jelveh <nj@puter.com>
2025-09-26 21:40:20 -07:00
KernelDeimos baf261c0c4 fix: check if shraed files exist in ll_readshares
This may have been breaking the ability to see directories shared by
other users sometimes.
2025-09-26 18:59:23 -04:00
KernelDeimos 088ff4d696 fix: update path when renaming during save_account
We do update the path of all child directories by calling
filesystem.update_child_paths(), but this was never done for the user's
actual home directory itself (only everything under it).

The most ideal solution would be to delegate this behavior to the move
operation instead of updating the fsentries table directly, but making
this change right now has a high risk of breaking changes since this the
behavior in this file is very old.
2025-09-26 18:44:32 -04:00
Nariman Jelveh fae33301a8 fix the issue with last_valid_ts always being 0 2025-09-26 15:05:44 -07:00
mrtbgau b8263fd8e0 feat: add missing Persian and Finnish translations (#1614)
* feat: add missing Persian translations

* feat: add missing Finnish translations

* Remove "Missing translations" comment

---------

Co-authored-by: Nariman Jelveh <nj@puter.com>
2025-09-26 15:05:04 -07:00
KernelDeimos d5a2a34f53 dev(extensions): add extension.use
The extension.use method allows registering routers and generic handlers
(not wrapped by eggspress) to express.
2025-09-26 17:30:09 -04:00
KernelDeimos 601eb019a2 dev(extensions): [+] data
The data extension adds convenient access to the database and kvstore
via it's 'db' and 'kv' exports.

Example usage:
  const { db, kv } = extensions.import('data');
  await kv.set('some-key', 'some-value');
  await db.write('INSERT INTO something (a, b) VALUES (1, 2)');
2025-09-26 15:28:00 -04:00
KernelDeimos 63bf4eccbe dev: make services importable by extensions
For example you can access WebServerService with
extension.import('service:web')
2025-09-26 15:28:00 -04:00
KernelDeimos 570409ef15 doc: add more extension internals documentation 2025-09-26 15:28:00 -04:00
KernelDeimos 27d7668a72 dev: '@extension name' and priority in puter.json
Adds the '@extension name <name>' directive for single-file Puter
extensions, and adds support for defining priority in 'puter.json'.
2025-09-26 15:27:59 -04:00
KernelDeimos cb31c1d44e dev: add command to list extensions
This commit adds the `extension:list` command for listing extensions.
This command is itself defined in an extension. To make this possible,
an event called 'create.commands' is emitted form CommandService with
the event object holding a function that can be used to add commands.
2025-09-26 15:27:59 -04:00
KernelDeimos 353cf397cb dev: remove legacy whoami and use extension 2025-09-26 15:27:59 -04:00
KernelDeimos db5aef51b0 fix: missing await in extension loader 2025-09-26 15:27:59 -04:00
KernelDeimos dde652fb27 dev: expose 'core' from useapi as runtime module 2025-09-26 15:27:58 -04:00
KernelDeimos 15cb98107c doc: add extension documentation for core devs
Extensions need to be documented at different layers of concern:
1. How to use/run extensions
2. How to create extensions as a contributor
3. How extensions work under the hood

This documentation addresses the third layer, describing how Kernel
and core modules interact with extensions.
2025-09-26 15:27:58 -04:00
KernelDeimos 4353c2dc46 dev: expose 'web' from useapi as runtime module
This will allow extensions to import from the 'web' module:
const { Endpoint } = extension.import('web');
2025-09-26 15:27:58 -04:00
KernelDeimos f6be6952dc dev: export runtime module registry to context 2025-09-26 15:27:58 -04:00
KernelDeimos b328355a90 fix: apparently setters shadow getting
I thought you could:
  method() {}
  set method (v) { /* ... /* }

but you can't. You have to:
  get method() { return (function () {}).bind(this) }
  set method (v) { /* ... /* }

I don't know why a setter can't just only shadow setting, but that's
how they designed the language. ¯\_(ツ)_/¯
2025-09-26 15:27:57 -04:00
KernelDeimos 6ff3d154fa devex: .git is not an extension
This change makes sure Kernel skips `.git` directories when scanning
for extensions. This allows me to make a git repository containing
example extensions for Puter.
2025-09-26 15:27:57 -04:00
KernelDeimos bdd60c63d8 devex: add '{repo}' variable for extension paths
Previously '{source}' was added but this is a bit difficult to work
with since it's the path from the source file, which is usually the
'src/' directory under the repository. This won't be obvious anyone
who doesn't already know this. '{repo}' just points to the path of
the repository itself.
2025-09-26 15:27:57 -04:00
KernelDeimos 06cd14353a doc: document import/export mechanism for extensions 2025-09-26 15:27:57 -04:00
KernelDeimos e271476e0b tweak: alias 'runtime' to 'extension'
Extension developers should not have to remember what comes form
where between two different globals. This change makes Extension
effectively a facade (Facade Pattern) containing the behaviors
of both extensions and runtime modules.
2025-09-26 15:27:57 -04:00
KernelDeimos 9aef281ad2 dev: add runtime modules for imports and exports
RuntimeModule is a new construct which represents the import/export
mechanism for Puter extensions. This can be thought of as analogous
to node's Module class. These are called "runtime modules" because
extensions have less control of what they're consuming than a typical
npm module; i.e. `runtime.import('database')` will provide a version
of 'database' that's compatible with the importing extension, but the
version used can't be locked or otherwise determined by the extension.
2025-09-26 15:27:57 -04:00
Xiaochen Cui 860388c3cb update client-cache logic (#1626)
* client-cache: remove pulling

* client-cache: fix wrong ts field

* client-cache: purge cache on any local update

* client-cache: last_updated_time -> last_valid_time

* client-cache: update cache on remote update

* client-cache: update last_valid_ts every sec

* client-cache: switch to localstorage

* do the cache and purge test when `setAuthToken` is called

---------

Co-authored-by: Nariman Jelveh <nj@puter.com>
2025-09-26 11:44:12 -07:00
Nariman Jelveh a0b567da52 chore: update @heyputer/kv.js dependency to version 0.2.0 and initialize cache with dbName in puter-js (#1623) 2025-09-26 10:58:16 -07:00
Daniel Salazar d70d412115 feat: DAV Locks support + refactor of DAV method handler (#1486)
* feat: DAV Locks support + refactor of DAV method handler

* format: Restore old whitespace for CoreModule.js

* fix: options route registering after likecycle hooks

---------

Co-authored-by: Neal Shah <30693865+ProgrammerIn-wonderland@users.noreply.github.com>
2025-09-26 11:00:29 -04:00