Your PHP application
Domain rules, commands, DTOs, repositories, events, policies, and product composition.
PAM Desktop becomes simple when every layer has one job. PHP owns application decisions. Servo owns the document. Rust owns native authority. PAM keeps the PHP worker alive and bounded.
Your PHP application
Domain rules, commands, DTOs, repositories, events, policies, and product composition.
The Servo document
Trusted local HTML, CSS, JavaScript, rendering, input, and calls through the
frozen window.pam bridge.
The Rust host
Windows, protocol validation, capabilities, operating-system handles, plugins, lifecycle, and failure containment.
The PAM worker
Persistent PHP execution, deadlines, cancellation, crash recovery, hot reload, and supervised concurrency.
window.pam.invoke('documents.save', payload).If the handler throws, partial effects are not published. If a deadline or cancellation compromises the worker, the host terminates it and prepares a fresh worker; it does not replay the interrupted command.
Application classes and attributes may describe commands and windows, but code discovery cannot grant native authority. Filesystem roots, databases, remote origins, processes, secrets, dialogs, clipboard, notifications, and portals must appear in the capability manifest before the host starts.
protected function configure(Desktop $desktop): void{ $desktop->permissions(static fn (Permissions $permissions) => $permissions ->filesystem('documents', __DIR__.'/../storage', read: true, write: true) ->database('app', 'storage/app.sqlite') ->http('api', 'https://api.example.com/v1') );}JavaScript refers to documents, app, and api; it never receives ambient
machine access merely because a PHP library can express an operation.
| State | Natural owner |
|---|---|
| Domain and persistence state | PHP services, repositories, SQLite |
| Ephemeral interface state | Frontend JavaScript |
| Window, tray, menu, and shortcut state | Rust host, changed through typed effects |
| Invocation-specific window/event context | Scoped PAM services |
| Long-running independent work | Supervised jobs or isolated plugins |
For the detailed threat boundary, continue with the security model.