@noldova/desktop.runtime 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +82 -2
- package/api/index.d.ts +16404 -0
- package/api/index.js +256 -0
- package/api/index.js.map +1 -0
- package/api/testing.d.ts +2132 -0
- package/api/testing.js +20 -0
- package/api/testing.js.map +1 -0
- package/enums/agent-control-failure.js +13 -0
- package/enums/agent-control-failure.js.map +1 -0
- package/enums/build-relation.js +14 -0
- package/enums/build-relation.js.map +1 -0
- package/enums/data-directory-state.js +14 -0
- package/enums/data-directory-state.js.map +1 -0
- package/enums/endpoint-kind.js +13 -0
- package/enums/endpoint-kind.js.map +1 -0
- package/enums/permission-decision.js +18 -0
- package/enums/permission-decision.js.map +1 -0
- package/enums/permission-detail-kind.js +15 -0
- package/enums/permission-detail-kind.js.map +1 -0
- package/enums/permission-option.js +16 -0
- package/enums/permission-option.js.map +1 -0
- package/enums/session-state.js +17 -0
- package/enums/session-state.js.map +1 -0
- package/enums/tool-abort-reason.js +16 -0
- package/enums/tool-abort-reason.js.map +1 -0
- package/enums/tool-content-kind.js +13 -0
- package/enums/tool-content-kind.js.map +1 -0
- package/enums/tool-failure-code.js +22 -0
- package/enums/tool-failure-code.js.map +1 -0
- package/enums/tool-risk.js +14 -0
- package/enums/tool-risk.js.map +1 -0
- package/enums/unknown-schema-failure.js +14 -0
- package/enums/unknown-schema-failure.js.map +1 -0
- package/enums/update-barrier-state.js +14 -0
- package/enums/update-barrier-state.js.map +1 -0
- package/enums/update-barrier-status.js +14 -0
- package/enums/update-barrier-status.js.map +1 -0
- package/enums/window-state-kind.js +13 -0
- package/enums/window-state-kind.js.map +1 -0
- package/exceptions/addon-incomplete.exception.js +17 -0
- package/exceptions/addon-incomplete.exception.js.map +1 -0
- package/exceptions/addon-load-failed.exception.js +17 -0
- package/exceptions/addon-load-failed.exception.js.map +1 -0
- package/exceptions/addon-load.exception.js +14 -0
- package/exceptions/addon-load.exception.js.map +1 -0
- package/exceptions/addon-missing.exception.js +19 -0
- package/exceptions/addon-missing.exception.js.map +1 -0
- package/exceptions/addon-unexpected-value.exception.js +17 -0
- package/exceptions/addon-unexpected-value.exception.js.map +1 -0
- package/exceptions/agent-control.exception.js +28 -0
- package/exceptions/agent-control.exception.js.map +1 -0
- package/exceptions/answerer-registered.exception.js +10 -0
- package/exceptions/answerer-registered.exception.js.map +1 -0
- package/exceptions/app-image-copy-unavailable.exception.js +17 -0
- package/exceptions/app-image-copy-unavailable.exception.js.map +1 -0
- package/exceptions/app-image-copy-unlisted.exception.js +17 -0
- package/exceptions/app-image-copy-unlisted.exception.js.map +1 -0
- package/exceptions/backup-verification.exception.js +15 -0
- package/exceptions/backup-verification.exception.js.map +1 -0
- package/exceptions/batch-argument-refused.exception.js +17 -0
- package/exceptions/batch-argument-refused.exception.js.map +1 -0
- package/exceptions/batch-system-root-missing.exception.js +15 -0
- package/exceptions/batch-system-root-missing.exception.js.map +1 -0
- package/exceptions/build-mismatch.exception.js +18 -0
- package/exceptions/build-mismatch.exception.js.map +1 -0
- package/exceptions/call-unanswered.exception.js +17 -0
- package/exceptions/call-unanswered.exception.js.map +1 -0
- package/exceptions/command-failed.exception.js +18 -0
- package/exceptions/command-failed.exception.js.map +1 -0
- package/exceptions/command-registered.exception.js +10 -0
- package/exceptions/command-registered.exception.js.map +1 -0
- package/exceptions/connection-closed.exception.js +16 -0
- package/exceptions/connection-closed.exception.js.map +1 -0
- package/exceptions/connection-refused.exception.js +14 -0
- package/exceptions/connection-refused.exception.js.map +1 -0
- package/exceptions/connection.exception.js +16 -0
- package/exceptions/connection.exception.js.map +1 -0
- package/exceptions/data-directory-owned.exception.js +18 -0
- package/exceptions/data-directory-owned.exception.js.map +1 -0
- package/exceptions/declaration-field-invalid.exception.js +10 -0
- package/exceptions/declaration-field-invalid.exception.js.map +1 -0
- package/exceptions/declaration-not-object.exception.js +8 -0
- package/exceptions/declaration-not-object.exception.js.map +1 -0
- package/exceptions/declarations-format.exception.js +14 -0
- package/exceptions/declarations-format.exception.js.map +1 -0
- package/exceptions/declarations-unreadable.exception.js +18 -0
- package/exceptions/declarations-unreadable.exception.js.map +1 -0
- package/exceptions/declarations-version-unsupported.exception.js +10 -0
- package/exceptions/declarations-version-unsupported.exception.js.map +1 -0
- package/exceptions/discovery-field-invalid.exception.js +10 -0
- package/exceptions/discovery-field-invalid.exception.js.map +1 -0
- package/exceptions/discovery-format.exception.js +14 -0
- package/exceptions/discovery-format.exception.js.map +1 -0
- package/exceptions/discovery-not-object.exception.js +8 -0
- package/exceptions/discovery-not-object.exception.js.map +1 -0
- package/exceptions/discovery-unreadable.exception.js +18 -0
- package/exceptions/discovery-unreadable.exception.js.map +1 -0
- package/exceptions/discovery-version-unsupported.exception.js +10 -0
- package/exceptions/discovery-version-unsupported.exception.js.map +1 -0
- package/exceptions/endpoint-unavailable.exception.js +15 -0
- package/exceptions/endpoint-unavailable.exception.js.map +1 -0
- package/exceptions/environment-unreadable.exception.js +15 -0
- package/exceptions/environment-unreadable.exception.js.map +1 -0
- package/exceptions/event-declared.exception.js +10 -0
- package/exceptions/event-declared.exception.js.map +1 -0
- package/exceptions/event-withdrawn.exception.js +10 -0
- package/exceptions/event-withdrawn.exception.js.map +1 -0
- package/exceptions/exit-code-unreadable.exception.js +17 -0
- package/exceptions/exit-code-unreadable.exception.js.map +1 -0
- package/exceptions/exit-wait-timed-out.exception.js +19 -0
- package/exceptions/exit-wait-timed-out.exception.js.map +1 -0
- package/exceptions/folder-not-private.exception.js +19 -0
- package/exceptions/folder-not-private.exception.js.map +1 -0
- package/exceptions/foreground-group-read-failed.exception.js +18 -0
- package/exceptions/foreground-group-read-failed.exception.js.map +1 -0
- package/exceptions/foreground-group-unreadable.exception.js +19 -0
- package/exceptions/foreground-group-unreadable.exception.js.map +1 -0
- package/exceptions/handshake-closed.exception.js +15 -0
- package/exceptions/handshake-closed.exception.js.map +1 -0
- package/exceptions/handshake-identity-mismatch.exception.js +15 -0
- package/exceptions/handshake-identity-mismatch.exception.js.map +1 -0
- package/exceptions/handshake-timed-out.exception.js +15 -0
- package/exceptions/handshake-timed-out.exception.js.map +1 -0
- package/exceptions/job-assignment-failed.exception.js +19 -0
- package/exceptions/job-assignment-failed.exception.js.map +1 -0
- package/exceptions/job-closed-before-exit.exception.js +17 -0
- package/exceptions/job-closed-before-exit.exception.js.map +1 -0
- package/exceptions/launch-descriptors-unavailable.exception.js +15 -0
- package/exceptions/launch-descriptors-unavailable.exception.js.map +1 -0
- package/exceptions/launch-limit-reached.exception.js +17 -0
- package/exceptions/launch-limit-reached.exception.js.map +1 -0
- package/exceptions/launch-shell-unavailable.exception.js +15 -0
- package/exceptions/launch-shell-unavailable.exception.js.map +1 -0
- package/exceptions/launch-start-failed.exception.js +17 -0
- package/exceptions/launch-start-failed.exception.js.map +1 -0
- package/exceptions/launch-timed-out.exception.js +15 -0
- package/exceptions/launch-timed-out.exception.js.map +1 -0
- package/exceptions/launch.exception.js +14 -0
- package/exceptions/launch.exception.js.map +1 -0
- package/exceptions/main-process-refused-again.exception.js +15 -0
- package/exceptions/main-process-refused-again.exception.js.map +1 -0
- package/exceptions/method-failure.exception.js +16 -0
- package/exceptions/method-failure.exception.js.map +1 -0
- package/exceptions/method-registered.exception.js +10 -0
- package/exceptions/method-registered.exception.js.map +1 -0
- package/exceptions/migration.exception.js +17 -0
- package/exceptions/migration.exception.js.map +1 -0
- package/exceptions/module-activation.exception.js +17 -0
- package/exceptions/module-activation.exception.js.map +1 -0
- package/exceptions/module-database.exception.js +17 -0
- package/exceptions/module-database.exception.js.map +1 -0
- package/exceptions/module-id-device.exception.js +10 -0
- package/exceptions/module-id-device.exception.js.map +1 -0
- package/exceptions/module-load.exception.js +15 -0
- package/exceptions/module-load.exception.js.map +1 -0
- package/exceptions/module-stopping.exception.js +19 -0
- package/exceptions/module-stopping.exception.js.map +1 -0
- package/exceptions/move-aside-refused.exception.js +17 -0
- package/exceptions/move-aside-refused.exception.js.map +1 -0
- package/exceptions/no-job-for-exit-code.exception.js +17 -0
- package/exceptions/no-job-for-exit-code.exception.js.map +1 -0
- package/exceptions/no-runtime.exception.js +17 -0
- package/exceptions/no-runtime.exception.js.map +1 -0
- package/exceptions/not-contributed.exception.js +14 -0
- package/exceptions/not-contributed.exception.js.map +1 -0
- package/exceptions/notification-command-not-allowed.exception.js +12 -0
- package/exceptions/notification-command-not-allowed.exception.js.map +1 -0
- package/exceptions/notification-kind-changed.exception.js +12 -0
- package/exceptions/notification-kind-changed.exception.js.map +1 -0
- package/exceptions/ownership-released.exception.js +15 -0
- package/exceptions/ownership-released.exception.js.map +1 -0
- package/exceptions/permission-access.exception.js +14 -0
- package/exceptions/permission-access.exception.js.map +1 -0
- package/exceptions/permissions-closed.exception.js +8 -0
- package/exceptions/permissions-closed.exception.js.map +1 -0
- package/exceptions/permissions-module-only.exception.js +10 -0
- package/exceptions/permissions-module-only.exception.js.map +1 -0
- package/exceptions/pre-shell-data-found.exception.js +18 -0
- package/exceptions/pre-shell-data-found.exception.js.map +1 -0
- package/exceptions/pre-shell-data.exception.js +19 -0
- package/exceptions/pre-shell-data.exception.js.map +1 -0
- package/exceptions/process-start-failed.exception.js +17 -0
- package/exceptions/process-start-failed.exception.js.map +1 -0
- package/exceptions/process-start.exception.js +14 -0
- package/exceptions/process-start.exception.js.map +1 -0
- package/exceptions/process-table-row-unreadable.exception.js +17 -0
- package/exceptions/process-table-row-unreadable.exception.js.map +1 -0
- package/exceptions/product-file.exception.js +18 -0
- package/exceptions/product-file.exception.js.map +1 -0
- package/exceptions/program-not-found.exception.js +17 -0
- package/exceptions/program-not-found.exception.js.map +1 -0
- package/exceptions/program-path-relative.exception.js +17 -0
- package/exceptions/program-path-relative.exception.js.map +1 -0
- package/exceptions/pseudo-terminal-batch-refused.exception.js +17 -0
- package/exceptions/pseudo-terminal-batch-refused.exception.js.map +1 -0
- package/exceptions/pseudo-terminal-command-line-batch-refused.exception.js +17 -0
- package/exceptions/pseudo-terminal-command-line-batch-refused.exception.js.map +1 -0
- package/exceptions/pseudo-terminal-command-line-refused.exception.js +17 -0
- package/exceptions/pseudo-terminal-command-line-refused.exception.js.map +1 -0
- package/exceptions/pseudo-terminal-command-line-with-arguments.exception.js +17 -0
- package/exceptions/pseudo-terminal-command-line-with-arguments.exception.js.map +1 -0
- package/exceptions/pseudo-terminals-undeclared.exception.js +19 -0
- package/exceptions/pseudo-terminals-undeclared.exception.js.map +1 -0
- package/exceptions/registration.exception.js +14 -0
- package/exceptions/registration.exception.js.map +1 -0
- package/exceptions/runtime-exited-without-reason.exception.js +15 -0
- package/exceptions/runtime-exited-without-reason.exception.js.map +1 -0
- package/exceptions/runtime-exited.exception.js +17 -0
- package/exceptions/runtime-exited.exception.js.map +1 -0
- package/exceptions/runtime-handover.exception.js +18 -0
- package/exceptions/runtime-handover.exception.js.map +1 -0
- package/exceptions/runtime-unreachable.exception.js +17 -0
- package/exceptions/runtime-unreachable.exception.js.map +1 -0
- package/exceptions/runtime.exception.js +14 -0
- package/exceptions/runtime.exception.js.map +1 -0
- package/exceptions/secret-not-owned.exception.js +12 -0
- package/exceptions/secret-not-owned.exception.js.map +1 -0
- package/exceptions/service-access.exception.js +14 -0
- package/exceptions/service-access.exception.js.map +1 -0
- package/exceptions/service-missing.exception.js +10 -0
- package/exceptions/service-missing.exception.js.map +1 -0
- package/exceptions/service-not-allowed.exception.js +12 -0
- package/exceptions/service-not-allowed.exception.js.map +1 -0
- package/exceptions/service-not-owned.exception.js +12 -0
- package/exceptions/service-not-owned.exception.js.map +1 -0
- package/exceptions/service-published.exception.js +10 -0
- package/exceptions/service-published.exception.js.map +1 -0
- package/exceptions/service-type-mismatch.exception.js +12 -0
- package/exceptions/service-type-mismatch.exception.js.map +1 -0
- package/exceptions/setting-needs-device.exception.js +11 -0
- package/exceptions/setting-needs-device.exception.js.map +1 -0
- package/exceptions/setting-not-readable.exception.js +12 -0
- package/exceptions/setting-not-readable.exception.js.map +1 -0
- package/exceptions/setting-not-writable.exception.js +12 -0
- package/exceptions/setting-not-writable.exception.js.map +1 -0
- package/exceptions/setting-scope-not-allowed.exception.js +13 -0
- package/exceptions/setting-scope-not-allowed.exception.js.map +1 -0
- package/exceptions/setting-scope-not-owned.exception.js +12 -0
- package/exceptions/setting-scope-not-owned.exception.js.map +1 -0
- package/exceptions/setting-unknown.exception.js +11 -0
- package/exceptions/setting-unknown.exception.js.map +1 -0
- package/exceptions/setting-value-invalid.exception.js +11 -0
- package/exceptions/setting-value-invalid.exception.js.map +1 -0
- package/exceptions/setting.exception.js +14 -0
- package/exceptions/setting.exception.js.map +1 -0
- package/exceptions/stop-refused.exception.js +17 -0
- package/exceptions/stop-refused.exception.js.map +1 -0
- package/exceptions/stop-timed-out.exception.js +15 -0
- package/exceptions/stop-timed-out.exception.js.map +1 -0
- package/exceptions/system-command.exception.js +14 -0
- package/exceptions/system-command.exception.js.map +1 -0
- package/exceptions/system-root-missing.exception.js +15 -0
- package/exceptions/system-root-missing.exception.js.map +1 -0
- package/exceptions/tool-endpoint.exception.js +15 -0
- package/exceptions/tool-endpoint.exception.js.map +1 -0
- package/exceptions/tool-failure.exception.js +16 -0
- package/exceptions/tool-failure.exception.js.map +1 -0
- package/exceptions/tool-registered.exception.js +10 -0
- package/exceptions/tool-registered.exception.js.map +1 -0
- package/exceptions/unknown-schema.exception.js +30 -0
- package/exceptions/unknown-schema.exception.js.map +1 -0
- package/exceptions/update-in-progress.exception.js +19 -0
- package/exceptions/update-in-progress.exception.js.map +1 -0
- package/exceptions/update-preparing.exception.js +19 -0
- package/exceptions/update-preparing.exception.js.map +1 -0
- package/exceptions/user-identity-unreadable.exception.js +17 -0
- package/exceptions/user-identity-unreadable.exception.js.map +1 -0
- package/exceptions/verbatim-batch-refused.exception.js +17 -0
- package/exceptions/verbatim-batch-refused.exception.js.map +1 -0
- package/exceptions/web-view-failure.exception.js +17 -0
- package/exceptions/web-view-failure.exception.js.map +1 -0
- package/exceptions/work-in-progress.exception.js +17 -0
- package/exceptions/work-in-progress.exception.js.map +1 -0
- package/interfaces/i-app-shortcuts.js +9 -0
- package/interfaces/i-app-shortcuts.js.map +1 -0
- package/interfaces/i-app-windows.js +9 -0
- package/interfaces/i-app-windows.js.map +1 -0
- package/interfaces/i-environment-source.js +9 -0
- package/interfaces/i-environment-source.js.map +1 -0
- package/interfaces/i-event-sink.js +9 -0
- package/interfaces/i-event-sink.js.map +1 -0
- package/interfaces/i-file-share-options.js +9 -0
- package/interfaces/i-file-share-options.js.map +1 -0
- package/interfaces/i-folder-protector.js +9 -0
- package/interfaces/i-folder-protector.js.map +1 -0
- package/interfaces/i-idle-participant.js +9 -0
- package/interfaces/i-idle-participant.js.map +1 -0
- package/interfaces/i-issued-grant.js +9 -0
- package/interfaces/i-issued-grant.js.map +1 -0
- package/interfaces/i-line-process-listener.js +9 -0
- package/interfaces/i-line-process-listener.js.map +1 -0
- package/interfaces/i-line-process-starter.js +9 -0
- package/interfaces/i-line-process-starter.js.map +1 -0
- package/interfaces/i-line-process.js +9 -0
- package/interfaces/i-line-process.js.map +1 -0
- package/interfaces/i-main-process-check.js +9 -0
- package/interfaces/i-main-process-check.js.map +1 -0
- package/interfaces/i-method-handler.js +9 -0
- package/interfaces/i-method-handler.js.map +1 -0
- package/interfaces/i-module-database.js +9 -0
- package/interfaces/i-module-database.js.map +1 -0
- package/interfaces/i-module-log.js +9 -0
- package/interfaces/i-module-log.js.map +1 -0
- package/interfaces/i-module-secrets.js +9 -0
- package/interfaces/i-module-secrets.js.map +1 -0
- package/interfaces/i-module-settings.js +9 -0
- package/interfaces/i-module-settings.js.map +1 -0
- package/interfaces/i-peer-process-api.js +9 -0
- package/interfaces/i-peer-process-api.js.map +1 -0
- package/interfaces/i-permission-answerer.js +9 -0
- package/interfaces/i-permission-answerer.js.map +1 -0
- package/interfaces/i-permission-detail.js +9 -0
- package/interfaces/i-permission-detail.js.map +1 -0
- package/interfaces/i-permission-request.js +9 -0
- package/interfaces/i-permission-request.js.map +1 -0
- package/interfaces/i-permissions-context.js +9 -0
- package/interfaces/i-permissions-context.js.map +1 -0
- package/interfaces/i-posix-process-addon.js +9 -0
- package/interfaces/i-posix-process-addon.js.map +1 -0
- package/interfaces/i-posix-process-api.js +9 -0
- package/interfaces/i-posix-process-api.js.map +1 -0
- package/interfaces/i-posix-process-table-api.js +9 -0
- package/interfaces/i-posix-process-table-api.js.map +1 -0
- package/interfaces/i-process-ender.js +9 -0
- package/interfaces/i-process-ender.js.map +1 -0
- package/interfaces/i-process-starter.js +9 -0
- package/interfaces/i-process-starter.js.map +1 -0
- package/interfaces/i-process-table.reader.js +9 -0
- package/interfaces/i-process-table.reader.js.map +1 -0
- package/interfaces/i-profile-watch.js +9 -0
- package/interfaces/i-profile-watch.js.map +1 -0
- package/interfaces/i-pseudo-terminal-exit.js +9 -0
- package/interfaces/i-pseudo-terminal-exit.js.map +1 -0
- package/interfaces/i-pseudo-terminal-handle.js +9 -0
- package/interfaces/i-pseudo-terminal-handle.js.map +1 -0
- package/interfaces/i-pseudo-terminal-library.js +9 -0
- package/interfaces/i-pseudo-terminal-library.js.map +1 -0
- package/interfaces/i-pseudo-terminal-options.js +9 -0
- package/interfaces/i-pseudo-terminal-options.js.map +1 -0
- package/interfaces/i-pseudo-terminal-start-options.js +9 -0
- package/interfaces/i-pseudo-terminal-start-options.js.map +1 -0
- package/interfaces/i-pseudo-terminal-subscription.js +9 -0
- package/interfaces/i-pseudo-terminal-subscription.js.map +1 -0
- package/interfaces/i-resolved-file.js +9 -0
- package/interfaces/i-resolved-file.js.map +1 -0
- package/interfaces/i-runtime-client-listener.js +9 -0
- package/interfaces/i-runtime-client-listener.js.map +1 -0
- package/interfaces/i-runtime-discovery-json.js +9 -0
- package/interfaces/i-runtime-discovery-json.js.map +1 -0
- package/interfaces/i-runtime-files.js +9 -0
- package/interfaces/i-runtime-files.js.map +1 -0
- package/interfaces/i-runtime-part-context.js +9 -0
- package/interfaces/i-runtime-part-context.js.map +1 -0
- package/interfaces/i-runtime-part-loader.js +9 -0
- package/interfaces/i-runtime-part-loader.js.map +1 -0
- package/interfaces/i-runtime-part.js +9 -0
- package/interfaces/i-runtime-part.js.map +1 -0
- package/interfaces/i-runtime-web-views.js +9 -0
- package/interfaces/i-runtime-web-views.js.map +1 -0
- package/interfaces/i-secret-backend.js +9 -0
- package/interfaces/i-secret-backend.js.map +1 -0
- package/interfaces/i-session-listener.js +9 -0
- package/interfaces/i-session-listener.js.map +1 -0
- package/interfaces/i-tool-call-options.js +9 -0
- package/interfaces/i-tool-call-options.js.map +1 -0
- package/interfaces/i-tool-call-permissions.js +9 -0
- package/interfaces/i-tool-call-permissions.js.map +1 -0
- package/interfaces/i-tool-deadline.js +9 -0
- package/interfaces/i-tool-deadline.js.map +1 -0
- package/interfaces/i-tool-descriptor.js +9 -0
- package/interfaces/i-tool-descriptor.js.map +1 -0
- package/interfaces/i-tool-endpoint-handler.js +9 -0
- package/interfaces/i-tool-endpoint-handler.js.map +1 -0
- package/interfaces/i-tool-endpoint.js +9 -0
- package/interfaces/i-tool-endpoint.js.map +1 -0
- package/interfaces/i-tool-handler.js +9 -0
- package/interfaces/i-tool-handler.js.map +1 -0
- package/interfaces/i-tool-hints.js +9 -0
- package/interfaces/i-tool-hints.js.map +1 -0
- package/interfaces/i-tool-limits.js +9 -0
- package/interfaces/i-tool-limits.js.map +1 -0
- package/interfaces/i-tool-risk-range.js +9 -0
- package/interfaces/i-tool-risk-range.js.map +1 -0
- package/interfaces/i-tool-schema.validator.js +2 -0
- package/interfaces/i-tool-schema.validator.js.map +1 -0
- package/interfaces/i-tool-session-host.js +9 -0
- package/interfaces/i-tool-session-host.js.map +1 -0
- package/interfaces/i-tools-context.js +9 -0
- package/interfaces/i-tools-context.js.map +1 -0
- package/interfaces/i-web-view-relay.js +9 -0
- package/interfaces/i-web-view-relay.js.map +1 -0
- package/interfaces/i-windows-peer-addon.js +9 -0
- package/interfaces/i-windows-peer-addon.js.map +1 -0
- package/interfaces/i-windows-process-addon.js +9 -0
- package/interfaces/i-windows-process-addon.js.map +1 -0
- package/interfaces/i-windows-process-api.js +9 -0
- package/interfaces/i-windows-process-api.js.map +1 -0
- package/interfaces/i-windows-signature.js +9 -0
- package/interfaces/i-windows-signature.js.map +1 -0
- package/models/app-image-copy-record.js +49 -0
- package/models/app-image-copy-record.js.map +1 -0
- package/models/app-image-source.js +48 -0
- package/models/app-image-source.js.map +1 -0
- package/models/attach-options.js +16 -0
- package/models/attach-options.js.map +1 -0
- package/models/capability-token.js +29 -0
- package/models/capability-token.js.map +1 -0
- package/models/caught-failure.js +15 -0
- package/models/caught-failure.js.map +1 -0
- package/models/client-closure.js +16 -0
- package/models/client-closure.js.map +1 -0
- package/models/client-settings.js +26 -0
- package/models/client-settings.js.map +1 -0
- package/models/connected-client.js +16 -0
- package/models/connected-client.js.map +1 -0
- package/models/data-directory-inspection.js +16 -0
- package/models/data-directory-inspection.js.map +1 -0
- package/models/endpoint.js +46 -0
- package/models/endpoint.js.map +1 -0
- package/models/event-channel.js +25 -0
- package/models/event-channel.js.map +1 -0
- package/models/granted-file.js +41 -0
- package/models/granted-file.js.map +1 -0
- package/models/image-size.js +22 -0
- package/models/image-size.js.map +1 -0
- package/models/kept-program.js +16 -0
- package/models/kept-program.js.map +1 -0
- package/models/launch-settings.js +44 -0
- package/models/launch-settings.js.map +1 -0
- package/models/migration.js +22 -0
- package/models/migration.js.map +1 -0
- package/models/module-activation.js +23 -0
- package/models/module-activation.js.map +1 -0
- package/models/module-declaration.js +203 -0
- package/models/module-declaration.js.map +1 -0
- package/models/notification-handle.js +24 -0
- package/models/notification-handle.js.map +1 -0
- package/models/owned-process.js +42 -0
- package/models/owned-process.js.map +1 -0
- package/models/packaged-path.js +14 -0
- package/models/packaged-path.js.map +1 -0
- package/models/peer-process.js +18 -0
- package/models/peer-process.js.map +1 -0
- package/models/pending-call.js +28 -0
- package/models/pending-call.js.map +1 -0
- package/models/permission-outcome.js +22 -0
- package/models/permission-outcome.js.map +1 -0
- package/models/permission-question.js +23 -0
- package/models/permission-question.js.map +1 -0
- package/models/permission-record.js +23 -0
- package/models/permission-record.js.map +1 -0
- package/models/permission-revocation.js +18 -0
- package/models/permission-revocation.js.map +1 -0
- package/models/process-ending.js +24 -0
- package/models/process-ending.js.map +1 -0
- package/models/process-exit.js +24 -0
- package/models/process-exit.js.map +1 -0
- package/models/process-killing.js +20 -0
- package/models/process-killing.js.map +1 -0
- package/models/process-launch-command.js +46 -0
- package/models/process-launch-command.js.map +1 -0
- package/models/process-launch.js +21 -0
- package/models/process-launch.js.map +1 -0
- package/models/process-record.js +41 -0
- package/models/process-record.js.map +1 -0
- package/models/process-request.js +40 -0
- package/models/process-request.js.map +1 -0
- package/models/process-settings.js +31 -0
- package/models/process-settings.js.map +1 -0
- package/models/process-table-entry.js +30 -0
- package/models/process-table-entry.js.map +1 -0
- package/models/process-table.js +55 -0
- package/models/process-table.js.map +1 -0
- package/models/product-info.js +68 -0
- package/models/product-info.js.map +1 -0
- package/models/pseudo-terminal-console.js +41 -0
- package/models/pseudo-terminal-console.js.map +1 -0
- package/models/pseudo-terminal-exit.js +24 -0
- package/models/pseudo-terminal-exit.js.map +1 -0
- package/models/pseudo-terminal-request.js +44 -0
- package/models/pseudo-terminal-request.js.map +1 -0
- package/models/pseudo-terminal.js +104 -0
- package/models/pseudo-terminal.js.map +1 -0
- package/models/refusal.js +16 -0
- package/models/refusal.js.map +1 -0
- package/models/registered-tool.js +22 -0
- package/models/registered-tool.js.map +1 -0
- package/models/registration.js +17 -0
- package/models/registration.js.map +1 -0
- package/models/remembered-permission.js +26 -0
- package/models/remembered-permission.js.map +1 -0
- package/models/request-context.js +27 -0
- package/models/request-context.js.map +1 -0
- package/models/running-process.js +25 -0
- package/models/running-process.js.map +1 -0
- package/models/running-program.js +26 -0
- package/models/running-program.js.map +1 -0
- package/models/running-tool-call.js +111 -0
- package/models/running-tool-call.js.map +1 -0
- package/models/runtime-build.js +17 -0
- package/models/runtime-build.js.map +1 -0
- package/models/runtime-command.js +39 -0
- package/models/runtime-command.js.map +1 -0
- package/models/runtime-discovery.js +85 -0
- package/models/runtime-discovery.js.map +1 -0
- package/models/runtime-options.js +63 -0
- package/models/runtime-options.js.map +1 -0
- package/models/server-settings.js +34 -0
- package/models/server-settings.js.map +1 -0
- package/models/started-runtime.js +29 -0
- package/models/started-runtime.js.map +1 -0
- package/models/system-error-code.js +29 -0
- package/models/system-error-code.js.map +1 -0
- package/models/terminal-size.js +19 -0
- package/models/terminal-size.js.map +1 -0
- package/models/tool-call.js +65 -0
- package/models/tool-call.js.map +1 -0
- package/models/tool-content.js +44 -0
- package/models/tool-content.js.map +1 -0
- package/models/tool-descriptor.js +104 -0
- package/models/tool-descriptor.js.map +1 -0
- package/models/tool-failure.js +39 -0
- package/models/tool-failure.js.map +1 -0
- package/models/tool-result.js +22 -0
- package/models/tool-result.js.map +1 -0
- package/models/tool-session.js +29 -0
- package/models/tool-session.js.map +1 -0
- package/models/tool-turns.js +31 -0
- package/models/tool-turns.js.map +1 -0
- package/models/update-barrier.js +39 -0
- package/models/update-barrier.js.map +1 -0
- package/models/watched-pseudo-terminal-handle.js +118 -0
- package/models/watched-pseudo-terminal-handle.js.map +1 -0
- package/models/web-view-protocol-event.js +20 -0
- package/models/web-view-protocol-event.js.map +1 -0
- package/models/windows-device-names.js +15 -0
- package/models/windows-device-names.js.map +1 -0
- package/models/work-item.js +29 -0
- package/models/work-item.js.map +1 -0
- package/native/darwin-arm64/posix-process.node +0 -0
- package/native/darwin-x64/posix-process.node +0 -0
- package/native/linux-arm64/posix-process.node +0 -0
- package/native/linux-x64/posix-process.node +0 -0
- package/native/win32-arm64/windows-process.node +0 -0
- package/native/win32-x64/windows-process.node +0 -0
- package/package.json +59 -3
- package/resources.js +1786 -0
- package/resources.js.map +1 -0
- package/services/app-surface/app-shortcuts-changed-method.js +24 -0
- package/services/app-surface/app-shortcuts-changed-method.js.map +1 -0
- package/services/app-surface/app-surface.js +57 -0
- package/services/app-surface/app-surface.js.map +1 -0
- package/services/app-surface/app-windows-changed-method.js +24 -0
- package/services/app-surface/app-windows-changed-method.js.map +1 -0
- package/services/app-surface/main-window-changed-method.js +24 -0
- package/services/app-surface/main-window-changed-method.js.map +1 -0
- package/services/app-surface/main-window-method.js +10 -0
- package/services/app-surface/main-window-method.js.map +1 -0
- package/services/app-surface/module-app-shortcuts.js +27 -0
- package/services/app-surface/module-app-shortcuts.js.map +1 -0
- package/services/app-surface/module-app-windows.js +24 -0
- package/services/app-surface/module-app-windows.js.map +1 -0
- package/services/app-surface/reported-list.js +61 -0
- package/services/app-surface/reported-list.js.map +1 -0
- package/services/client/app-image-copy-launch.js +187 -0
- package/services/client/app-image-copy-launch.js.map +1 -0
- package/services/client/app-image-extraction.js +39 -0
- package/services/client/app-image-extraction.js.map +1 -0
- package/services/client/app-image-keepalive.js +63 -0
- package/services/client/app-image-keepalive.js.map +1 -0
- package/services/client/build-comparer.js +25 -0
- package/services/client/build-comparer.js.map +1 -0
- package/services/client/runtime-client.js +203 -0
- package/services/client/runtime-client.js.map +1 -0
- package/services/client/runtime-launcher.js +259 -0
- package/services/client/runtime-launcher.js.map +1 -0
- package/services/commands/shell-commands.js +18 -0
- package/services/commands/shell-commands.js.map +1 -0
- package/services/commands/system-command.js +31 -0
- package/services/commands/system-command.js.map +1 -0
- package/services/data-directory/data-directory-inspector.js +49 -0
- package/services/data-directory/data-directory-inspector.js.map +1 -0
- package/services/data-directory/data-directory-locator.js +25 -0
- package/services/data-directory/data-directory-locator.js.map +1 -0
- package/services/data-directory/data-directory.js +85 -0
- package/services/data-directory/data-directory.js.map +1 -0
- package/services/database/backup-guard.js +64 -0
- package/services/database/backup-guard.js.map +1 -0
- package/services/database/database-backup.js +122 -0
- package/services/database/database-backup.js.map +1 -0
- package/services/database/migrated-database.js +198 -0
- package/services/database/migrated-database.js.map +1 -0
- package/services/database/module-database.js +21 -0
- package/services/database/module-database.js.map +1 -0
- package/services/database/shell-database.js +25 -0
- package/services/database/shell-database.js.map +1 -0
- package/services/database/shell-migrations.js +22 -0
- package/services/database/shell-migrations.js.map +1 -0
- package/services/database/update-backup.js +57 -0
- package/services/database/update-backup.js.map +1 -0
- package/services/diagnostics/diagnostic-redactor.js +75 -0
- package/services/diagnostics/diagnostic-redactor.js.map +1 -0
- package/services/diagnostics/log-file.js +56 -0
- package/services/diagnostics/log-file.js.map +1 -0
- package/services/diagnostics/log-text.js +15 -0
- package/services/diagnostics/log-text.js.map +1 -0
- package/services/diagnostics/standard-error-cap.js +107 -0
- package/services/diagnostics/standard-error-cap.js.map +1 -0
- package/services/discovery/discovery-publisher.js +64 -0
- package/services/discovery/discovery-publisher.js.map +1 -0
- package/services/discovery/discovery.reader.js +44 -0
- package/services/discovery/discovery.reader.js.map +1 -0
- package/services/discovery/folder-protector-factory.js +19 -0
- package/services/discovery/folder-protector-factory.js.map +1 -0
- package/services/discovery/mac-folder-protector.js +37 -0
- package/services/discovery/mac-folder-protector.js.map +1 -0
- package/services/discovery/posix-folder-protector.js +15 -0
- package/services/discovery/posix-folder-protector.js.map +1 -0
- package/services/discovery/windows-folder-protector.js +57 -0
- package/services/discovery/windows-folder-protector.js.map +1 -0
- package/services/endpoint/client-closures.js +27 -0
- package/services/endpoint/client-closures.js.map +1 -0
- package/services/endpoint/client-session.js +120 -0
- package/services/endpoint/client-session.js.map +1 -0
- package/services/endpoint/main-process-check.js +48 -0
- package/services/endpoint/main-process-check.js.map +1 -0
- package/services/endpoint/runtime-server.js +355 -0
- package/services/endpoint/runtime-server.js.map +1 -0
- package/services/endpoint/window-closed-method.js +19 -0
- package/services/endpoint/window-closed-method.js.map +1 -0
- package/services/environment/current-environment.js +43 -0
- package/services/environment/current-environment.js.map +1 -0
- package/services/environment/line-process-starter.js +21 -0
- package/services/environment/line-process-starter.js.map +1 -0
- package/services/environment/line-process.js +83 -0
- package/services/environment/line-process.js.map +1 -0
- package/services/environment/login-shell-environment.js +162 -0
- package/services/environment/login-shell-environment.js.map +1 -0
- package/services/environment/profile-watch.js +247 -0
- package/services/environment/profile-watch.js.map +1 -0
- package/services/environment/windows-environment.js +181 -0
- package/services/environment/windows-environment.js.map +1 -0
- package/services/files/discard-file-grants-method.js +24 -0
- package/services/files/discard-file-grants-method.js.map +1 -0
- package/services/files/end-file-grants-method.js +25 -0
- package/services/files/end-file-grants-method.js.map +1 -0
- package/services/files/file-grant-table.js +154 -0
- package/services/files/file-grant-table.js.map +1 -0
- package/services/files/file-identity.js +14 -0
- package/services/files/file-identity.js.map +1 -0
- package/services/files/file-presence.js +26 -0
- package/services/files/file-presence.js.map +1 -0
- package/services/files/file-renamer.js +35 -0
- package/services/files/file-renamer.js.map +1 -0
- package/services/files/folder-watch.js +134 -0
- package/services/files/folder-watch.js.map +1 -0
- package/services/files/grant-file-method.js +24 -0
- package/services/files/grant-file-method.js.map +1 -0
- package/services/files/module-files.js +68 -0
- package/services/files/module-files.js.map +1 -0
- package/services/files/resolve-file-share-method.js +23 -0
- package/services/files/resolve-file-share-method.js.map +1 -0
- package/services/installation/device-folder.js +24 -0
- package/services/installation/device-folder.js.map +1 -0
- package/services/installation/installation.js +207 -0
- package/services/installation/installation.js.map +1 -0
- package/services/installation/process-presence.js +45 -0
- package/services/installation/process-presence.js.map +1 -0
- package/services/lifetime/app-image-copy-cleanup.js +78 -0
- package/services/lifetime/app-image-copy-cleanup.js.map +1 -0
- package/services/lifetime/idle-monitor.js +47 -0
- package/services/lifetime/idle-monitor.js.map +1 -0
- package/services/lifetime/move-aside-method.js +18 -0
- package/services/lifetime/move-aside-method.js.map +1 -0
- package/services/lifetime/quit-answered-method.js +19 -0
- package/services/lifetime/quit-answered-method.js.map +1 -0
- package/services/lifetime/quit-method.js +17 -0
- package/services/lifetime/quit-method.js.map +1 -0
- package/services/lifetime/quit-relay.js +91 -0
- package/services/lifetime/quit-relay.js.map +1 -0
- package/services/lifetime/runtime-host.js +405 -0
- package/services/lifetime/runtime-host.js.map +1 -0
- package/services/lifetime/runtime-log.js +74 -0
- package/services/lifetime/runtime-log.js.map +1 -0
- package/services/lifetime/stop-method.js +39 -0
- package/services/lifetime/stop-method.js.map +1 -0
- package/services/lifetime/update-method.js +24 -0
- package/services/lifetime/update-method.js.map +1 -0
- package/services/lifetime/update-preparation.js +167 -0
- package/services/lifetime/update-preparation.js.map +1 -0
- package/services/lifetime/update-saved-method.js +19 -0
- package/services/lifetime/update-saved-method.js.map +1 -0
- package/services/modules/commands-method.js +17 -0
- package/services/modules/commands-method.js.map +1 -0
- package/services/modules/dependency-states.js +33 -0
- package/services/modules/dependency-states.js.map +1 -0
- package/services/modules/module-context.js +206 -0
- package/services/modules/module-context.js.map +1 -0
- package/services/modules/module-declaration.reader.js +46 -0
- package/services/modules/module-declaration.reader.js.map +1 -0
- package/services/modules/module-host.js +287 -0
- package/services/modules/module-host.js.map +1 -0
- package/services/modules/module-log.js +25 -0
- package/services/modules/module-log.js.map +1 -0
- package/services/modules/modules-method.js +17 -0
- package/services/modules/modules-method.js.map +1 -0
- package/services/modules/package-runtime-part-loader.js +33 -0
- package/services/modules/package-runtime-part-loader.js.map +1 -0
- package/services/modules/run-command-method.js +28 -0
- package/services/modules/run-command-method.js.map +1 -0
- package/services/native/native-addon.js +65 -0
- package/services/native/native-addon.js.map +1 -0
- package/services/notifications/clear-notifications-method.js +18 -0
- package/services/notifications/clear-notifications-method.js.map +1 -0
- package/services/notifications/dismiss-notification-method.js +19 -0
- package/services/notifications/dismiss-notification-method.js.map +1 -0
- package/services/notifications/mark-notifications-read-method.js +18 -0
- package/services/notifications/mark-notifications-read-method.js.map +1 -0
- package/services/notifications/notification-center.js +87 -0
- package/services/notifications/notification-center.js.map +1 -0
- package/services/notifications/notification-policy.js +54 -0
- package/services/notifications/notification-policy.js.map +1 -0
- package/services/notifications/notification-settings.js +32 -0
- package/services/notifications/notification-settings.js.map +1 -0
- package/services/notifications/notifications-method.js +21 -0
- package/services/notifications/notifications-method.js.map +1 -0
- package/services/notifications/post-notification-method.js +26 -0
- package/services/notifications/post-notification-method.js.map +1 -0
- package/services/ownership/ownership-lock.js +73 -0
- package/services/ownership/ownership-lock.js.map +1 -0
- package/services/permissions/module-permissions.js +36 -0
- package/services/permissions/module-permissions.js.map +1 -0
- package/services/permissions/permission-center.js +172 -0
- package/services/permissions/permission-center.js.map +1 -0
- package/services/permissions/permission-request-checker.js +146 -0
- package/services/permissions/permission-request-checker.js.map +1 -0
- package/services/permissions/remembered-permission-store.js +52 -0
- package/services/permissions/remembered-permission-store.js.map +1 -0
- package/services/process/batch-command-line.js +32 -0
- package/services/process/batch-command-line.js.map +1 -0
- package/services/process/child-process-starter.js +68 -0
- package/services/process/child-process-starter.js.map +1 -0
- package/services/process/foreground-process-group.reader.js +64 -0
- package/services/process/foreground-process-group.reader.js.map +1 -0
- package/services/process/linux-process-folder.js +55 -0
- package/services/process/linux-process-folder.js.map +1 -0
- package/services/process/posix-peer-process-api.js +95 -0
- package/services/process/posix-peer-process-api.js.map +1 -0
- package/services/process/posix-process-api.js +50 -0
- package/services/process/posix-process-api.js.map +1 -0
- package/services/process/posix-process-ender.js +199 -0
- package/services/process/posix-process-ender.js.map +1 -0
- package/services/process/posix-process-table.reader.js +24 -0
- package/services/process/posix-process-table.reader.js.map +1 -0
- package/services/process/posix-responsibility-api.js +38 -0
- package/services/process/posix-responsibility-api.js.map +1 -0
- package/services/process/process-clock.js +38 -0
- package/services/process/process-clock.js.map +1 -0
- package/services/process/process-ender-factory.js +22 -0
- package/services/process/process-ender-factory.js.map +1 -0
- package/services/process/process-environment.js +53 -0
- package/services/process/process-environment.js.map +1 -0
- package/services/process/process-record-store.js +35 -0
- package/services/process/process-record-store.js.map +1 -0
- package/services/process/process-signals.js +56 -0
- package/services/process/process-signals.js.map +1 -0
- package/services/process/process-supervisor.js +489 -0
- package/services/process/process-supervisor.js.map +1 -0
- package/services/process/program-launch-resolver.js +88 -0
- package/services/process/program-launch-resolver.js.map +1 -0
- package/services/process/program-locator.js +95 -0
- package/services/process/program-locator.js.map +1 -0
- package/services/process/programs-method.js +17 -0
- package/services/process/programs-method.js.map +1 -0
- package/services/process/windows-peer-process-api.js +52 -0
- package/services/process/windows-peer-process-api.js.map +1 -0
- package/services/process/windows-process-api.js +69 -0
- package/services/process/windows-process-api.js.map +1 -0
- package/services/process/windows-process-ender.js +137 -0
- package/services/process/windows-process-ender.js.map +1 -0
- package/services/process/windows-process-job.js +63 -0
- package/services/process/windows-process-job.js.map +1 -0
- package/services/process/windows-process-killer.js +58 -0
- package/services/process/windows-process-killer.js.map +1 -0
- package/services/process/windows-process-table.reader.js +46 -0
- package/services/process/windows-process-table.reader.js.map +1 -0
- package/services/recent-commands/recent-commands-method.js +18 -0
- package/services/recent-commands/recent-commands-method.js.map +1 -0
- package/services/recent-commands/recent-commands-store.js +29 -0
- package/services/recent-commands/recent-commands-store.js.map +1 -0
- package/services/recent-commands/record-command-method.js +21 -0
- package/services/recent-commands/record-command-method.js.map +1 -0
- package/services/registry/command-registry.js +51 -0
- package/services/registry/command-registry.js.map +1 -0
- package/services/registry/event-registry.js +34 -0
- package/services/registry/event-registry.js.map +1 -0
- package/services/registry/method-registry.js +26 -0
- package/services/registry/method-registry.js.map +1 -0
- package/services/registry/service-registry.js +26 -0
- package/services/registry/service-registry.js.map +1 -0
- package/services/runtime-entry.js +87 -0
- package/services/runtime-entry.js.map +1 -0
- package/services/secrets/machine-secret-backend.js +121 -0
- package/services/secrets/machine-secret-backend.js.map +1 -0
- package/services/secrets/module-secrets.js +37 -0
- package/services/secrets/module-secrets.js.map +1 -0
- package/services/secrets/remove-secret-method.js +19 -0
- package/services/secrets/remove-secret-method.js.map +1 -0
- package/services/secrets/save-secret-method.js +20 -0
- package/services/secrets/save-secret-method.js.map +1 -0
- package/services/secrets/secret-answered-method.js +19 -0
- package/services/secrets/secret-answered-method.js.map +1 -0
- package/services/secrets/secret-status-method.js +18 -0
- package/services/secrets/secret-status-method.js.map +1 -0
- package/services/secrets/secret-table.js +26 -0
- package/services/secrets/secret-table.js.map +1 -0
- package/services/settings/module-settings.js +69 -0
- package/services/settings/module-settings.js.map +1 -0
- package/services/settings/setting-read-method.js +18 -0
- package/services/settings/setting-read-method.js.map +1 -0
- package/services/settings/setting-reset-method.js +20 -0
- package/services/settings/setting-reset-method.js.map +1 -0
- package/services/settings/setting-write-method.js +20 -0
- package/services/settings/setting-write-method.js.map +1 -0
- package/services/settings/settings-read-method.js +18 -0
- package/services/settings/settings-read-method.js.map +1 -0
- package/services/settings/settings.service.js +162 -0
- package/services/settings/settings.service.js.map +1 -0
- package/services/settings/shell-settings.js +78 -0
- package/services/settings/shell-settings.js.map +1 -0
- package/services/tools/agent-control.js +49 -0
- package/services/tools/agent-control.js.map +1 -0
- package/services/tools/image-size.reader.js +35 -0
- package/services/tools/image-size.reader.js.map +1 -0
- package/services/tools/image-size.resources.js +24 -0
- package/services/tools/image-size.resources.js.map +1 -0
- package/services/tools/module-tools.js +77 -0
- package/services/tools/module-tools.js.map +1 -0
- package/services/tools/tool-endpoint.js +131 -0
- package/services/tools/tool-endpoint.js.map +1 -0
- package/services/tools/tool-registry.js +386 -0
- package/services/tools/tool-registry.js.map +1 -0
- package/services/tools/tool-result.validator.js +93 -0
- package/services/tools/tool-result.validator.js.map +1 -0
- package/services/tools/tool-schema.resources.js +45 -0
- package/services/tools/tool-schema.resources.js.map +1 -0
- package/services/tools/tool-schema.validator.js +232 -0
- package/services/tools/tool-schema.validator.js.map +1 -0
- package/services/web-views/module-web-view-relay.js +33 -0
- package/services/web-views/module-web-view-relay.js.map +1 -0
- package/services/web-views/module-web-views.js +46 -0
- package/services/web-views/module-web-views.js.map +1 -0
- package/services/web-views/web-view-answered-method.js +19 -0
- package/services/web-views/web-view-answered-method.js.map +1 -0
- package/services/web-views/web-view-center.js +119 -0
- package/services/web-views/web-view-center.js.map +1 -0
- package/services/web-views/web-view-events-method.js +19 -0
- package/services/web-views/web-view-events-method.js.map +1 -0
- package/services/window-state/window-state-read-method.js +20 -0
- package/services/window-state/window-state-read-method.js.map +1 -0
- package/services/window-state/window-state-store.js +24 -0
- package/services/window-state/window-state-store.js.map +1 -0
- package/services/window-state/window-state-write-method.js +22 -0
- package/services/window-state/window-state-write-method.js.map +1 -0
- package/services/work/work-method.js +17 -0
- package/services/work/work-method.js.map +1 -0
- package/services/work/work-tracker.js +56 -0
- package/services/work/work-tracker.js.map +1 -0
- package/testing/models/fake-app-shortcuts.js +18 -0
- package/testing/models/fake-app-shortcuts.js.map +1 -0
- package/testing/models/fake-app-windows.js +17 -0
- package/testing/models/fake-app-windows.js.map +1 -0
- package/testing/models/fake-module-database.js +17 -0
- package/testing/models/fake-module-database.js.map +1 -0
- package/testing/models/fake-module-log.js +12 -0
- package/testing/models/fake-module-log.js.map +1 -0
- package/testing/models/fake-module-secrets.js +15 -0
- package/testing/models/fake-module-secrets.js.map +1 -0
- package/testing/models/fake-module-settings.js +23 -0
- package/testing/models/fake-module-settings.js.map +1 -0
- package/testing/models/fake-permissions-context.js +28 -0
- package/testing/models/fake-permissions-context.js.map +1 -0
- package/testing/models/fake-runtime-files.js +13 -0
- package/testing/models/fake-runtime-files.js.map +1 -0
- package/testing/models/fake-runtime-part-context.js +70 -0
- package/testing/models/fake-runtime-part-context.js.map +1 -0
- package/testing/models/fake-runtime-web-views.js +26 -0
- package/testing/models/fake-runtime-web-views.js.map +1 -0
- package/testing/models/fake-tools-context.js +72 -0
- package/testing/models/fake-tools-context.js.map +1 -0
- package/testing/models/fake-web-view-relay.js +23 -0
- package/testing/models/fake-web-view-relay.js.map +1 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
9
|
+
import { realpathSync } from "node:fs";
|
|
10
|
+
import { link, mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import "@noldova/context.core";
|
|
13
|
+
import { JsonException, JsonReader } from "@noldova/context.json";
|
|
14
|
+
import { UpdateProcess } from "@noldova/desktop.protocol";
|
|
15
|
+
import { UpdateBarrierState } from "../../enums/update-barrier-state.js";
|
|
16
|
+
import { UpdateBarrierStatus } from "../../enums/update-barrier-status.js";
|
|
17
|
+
import { CaughtFailure } from "../../models/caught-failure.js";
|
|
18
|
+
import { SystemErrorCode } from "../../models/system-error-code.js";
|
|
19
|
+
import { UpdateBarrier } from "../../models/update-barrier.js";
|
|
20
|
+
import { Resources } from "../../resources.js";
|
|
21
|
+
import { FilePresence } from "../files/file-presence.js";
|
|
22
|
+
import { FileRenamer } from "../files/file-renamer.js";
|
|
23
|
+
export class Installation {
|
|
24
|
+
isRunningAsync;
|
|
25
|
+
renamer = new FileRenamer();
|
|
26
|
+
folder;
|
|
27
|
+
barrierFile;
|
|
28
|
+
recordFolder;
|
|
29
|
+
mainProcessFolder;
|
|
30
|
+
constructor(folder, isRunningAsync) {
|
|
31
|
+
this.folder = folder;
|
|
32
|
+
this.barrierFile = path.join(folder, Resources.barrierFileName);
|
|
33
|
+
this.recordFolder = path.join(folder, Resources.dataDirectoriesFolderName);
|
|
34
|
+
this.mainProcessFolder = path.join(folder, Resources.mainProcessesFolderName);
|
|
35
|
+
this.isRunningAsync = isRunningAsync;
|
|
36
|
+
}
|
|
37
|
+
static locate(deviceFolder, programPath, platform) {
|
|
38
|
+
const canonical = Installation.canonicalize(programPath);
|
|
39
|
+
return path.join(deviceFolder, Resources.installationsFolderName, Installation.digest(platform === Resources.windowsPlatform ? canonical.toLowerCase() : canonical));
|
|
40
|
+
}
|
|
41
|
+
static canonicalize(file) {
|
|
42
|
+
try {
|
|
43
|
+
return realpathSync.native(file);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (!SystemErrorCode.isAny(error, Resources.unreadablePathCodes))
|
|
47
|
+
throw error;
|
|
48
|
+
return path.resolve(file);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static digest(text) {
|
|
52
|
+
return createHash(Resources.tokenDigestAlgorithm).update(text).digest(Resources.hexEncoding).slice(0, Resources.installationIdLength);
|
|
53
|
+
}
|
|
54
|
+
async recordAsync(dataDirectory) {
|
|
55
|
+
const root = path.resolve(dataDirectory);
|
|
56
|
+
const file = path.join(this.recordFolder, `${Installation.digest(root)}${Resources.jsonExtension}`);
|
|
57
|
+
const temporary = path.join(this.recordFolder, Resources.formatTemporaryName(path.basename(file), randomUUID()));
|
|
58
|
+
await mkdir(this.recordFolder, { recursive: true });
|
|
59
|
+
await writeFile(temporary, JSON.stringify({ [Resources.dataDirectoryField]: root }));
|
|
60
|
+
await this.renamer.renameAsync(temporary, file);
|
|
61
|
+
}
|
|
62
|
+
async listDataDirectoriesAsync() {
|
|
63
|
+
const files = await FilePresence.unlessMissingAsync(readdir(this.recordFolder)) ?? [];
|
|
64
|
+
const roots = await Promise.all(files.filter(t => t.endsWith(Resources.jsonExtension)).map(t => Installation.readEntryAsync(path.join(this.recordFolder, t))));
|
|
65
|
+
return roots.filter(t => !Object.isNull(t));
|
|
66
|
+
}
|
|
67
|
+
async recordMainProcessAsync(mainProcess) {
|
|
68
|
+
const file = path.join(this.mainProcessFolder, `${mainProcess.processId}${Resources.jsonExtension}`);
|
|
69
|
+
const temporary = path.join(this.mainProcessFolder, Resources.formatTemporaryName(path.basename(file), randomUUID()));
|
|
70
|
+
await mkdir(this.mainProcessFolder, { recursive: true });
|
|
71
|
+
await writeFile(temporary, JSON.stringify(mainProcess.toJson()));
|
|
72
|
+
await this.renamer.renameAsync(temporary, file);
|
|
73
|
+
}
|
|
74
|
+
async listMainProcessesAsync() {
|
|
75
|
+
const files = await FilePresence.unlessMissingAsync(readdir(this.mainProcessFolder)) ?? [];
|
|
76
|
+
const mainProcesses = await Promise.all(files.filter(t => t.endsWith(Resources.jsonExtension)).map(t => this.readMainProcessAsync(path.join(this.mainProcessFolder, t))));
|
|
77
|
+
return mainProcesses.filter(t => !Object.isNull(t));
|
|
78
|
+
}
|
|
79
|
+
async holdAsync(barrier, version) {
|
|
80
|
+
if (await this.checkAsync(version) !== UpdateBarrierStatus.None)
|
|
81
|
+
return false;
|
|
82
|
+
await mkdir(this.folder, { recursive: true });
|
|
83
|
+
const temporary = await this.writeTemporaryAsync(barrier);
|
|
84
|
+
let isHeld = false;
|
|
85
|
+
try {
|
|
86
|
+
await link(temporary, this.barrierFile);
|
|
87
|
+
isHeld = true;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (!SystemErrorCode.is(error, Resources.existingFileErrorCode))
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
await rm(temporary, { force: true }).catch((error) => {
|
|
95
|
+
if (!SystemErrorCode.isAny(error, Resources.busyFileErrorCodes))
|
|
96
|
+
throw error;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return isHeld;
|
|
100
|
+
}
|
|
101
|
+
async replaceAsync(barrier) {
|
|
102
|
+
await this.renamer.renameAsync(await this.writeTemporaryAsync(barrier), this.barrierFile);
|
|
103
|
+
}
|
|
104
|
+
async releaseAsync() {
|
|
105
|
+
await rm(this.barrierFile, { force: true });
|
|
106
|
+
}
|
|
107
|
+
async readAsync() {
|
|
108
|
+
const text = await this.readBarrierAsync();
|
|
109
|
+
return Object.isNull(text) ? null : UpdateBarrier.fromJson(JsonReader.parse(text).toJson());
|
|
110
|
+
}
|
|
111
|
+
readTextAsync() {
|
|
112
|
+
return this.readBarrierAsync();
|
|
113
|
+
}
|
|
114
|
+
async checkAsync(version) {
|
|
115
|
+
const text = await this.readBarrierAsync();
|
|
116
|
+
if (Object.isNull(text))
|
|
117
|
+
return UpdateBarrierStatus.None;
|
|
118
|
+
const barrier = Installation.parse(text);
|
|
119
|
+
if (Object.isNull(barrier))
|
|
120
|
+
return UpdateBarrierStatus.Unfinished;
|
|
121
|
+
if (await this.isRunningAsync(barrier.holder))
|
|
122
|
+
return UpdateBarrierStatus.Held;
|
|
123
|
+
if (barrier.state === UpdateBarrierState.HandedOff && barrier.version !== version)
|
|
124
|
+
return !Object.isNull(barrier.handoff) && await this.isRunningAsync(barrier.handoff) ? UpdateBarrierStatus.Held : UpdateBarrierStatus.Unfinished;
|
|
125
|
+
return await this.removeStaleAsync(text, version);
|
|
126
|
+
}
|
|
127
|
+
async hasEndedAsync() {
|
|
128
|
+
const text = await this.readBarrierAsync();
|
|
129
|
+
if (Object.isNull(text))
|
|
130
|
+
return true;
|
|
131
|
+
const barrier = UpdateBarrier.fromJson(JsonReader.parse(text).toJson());
|
|
132
|
+
return barrier.state !== UpdateBarrierState.HandedOff && !await this.isRunningAsync(barrier.holder);
|
|
133
|
+
}
|
|
134
|
+
async removeAsync(text) {
|
|
135
|
+
const claimed = path.join(this.folder, Resources.formatTemporaryName(Resources.barrierFileName, randomUUID()));
|
|
136
|
+
if (Object.isNull(await FilePresence.unlessMissingAsync(this.renamer.renameAsync(this.barrierFile, claimed).then(() => claimed))))
|
|
137
|
+
return true;
|
|
138
|
+
const isJudged = await readFile(claimed, Resources.utf8Encoding) === text;
|
|
139
|
+
if (!isJudged)
|
|
140
|
+
await Installation.putBackAsync(claimed, this.barrierFile);
|
|
141
|
+
await rm(claimed, { force: true });
|
|
142
|
+
return isJudged;
|
|
143
|
+
}
|
|
144
|
+
async removeStaleAsync(text, version) {
|
|
145
|
+
return await this.removeAsync(text) ? UpdateBarrierStatus.None : await this.checkAsync(version);
|
|
146
|
+
}
|
|
147
|
+
static async putBackAsync(claimed, file) {
|
|
148
|
+
try {
|
|
149
|
+
await link(claimed, file);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
if (!SystemErrorCode.is(error, Resources.existingFileErrorCode))
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
static parse(text) {
|
|
157
|
+
try {
|
|
158
|
+
return UpdateBarrier.fromJson(JsonReader.parse(text).toJson());
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
CaughtFailure.expect(error, JsonException);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async writeTemporaryAsync(barrier) {
|
|
166
|
+
const temporary = path.join(this.folder, Resources.formatTemporaryName(Resources.barrierFileName, randomUUID()));
|
|
167
|
+
await writeFile(temporary, JSON.stringify(barrier.toJson()));
|
|
168
|
+
return temporary;
|
|
169
|
+
}
|
|
170
|
+
static async readEntryAsync(file) {
|
|
171
|
+
const text = await FilePresence.unlessMissingAsync(readFile(file, Resources.utf8Encoding));
|
|
172
|
+
if (Object.isNull(text))
|
|
173
|
+
return null;
|
|
174
|
+
let root;
|
|
175
|
+
try {
|
|
176
|
+
root = JsonReader.parse(text).readString(Resources.dataDirectoryField);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
CaughtFailure.expect(error, JsonException);
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return await FilePresence.existsAsync(root) ? root : null;
|
|
183
|
+
}
|
|
184
|
+
async readMainProcessAsync(file) {
|
|
185
|
+
const text = await FilePresence.unlessMissingAsync(readFile(file, Resources.utf8Encoding));
|
|
186
|
+
const mainProcess = Object.isNull(text) ? null : Installation.parseMainProcess(text);
|
|
187
|
+
if (Object.isNull(mainProcess))
|
|
188
|
+
return null;
|
|
189
|
+
if (await this.isRunningAsync(mainProcess))
|
|
190
|
+
return mainProcess;
|
|
191
|
+
await rm(file, { force: true });
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
static parseMainProcess(text) {
|
|
195
|
+
try {
|
|
196
|
+
return UpdateProcess.fromJson(JsonReader.parse(text).toJson());
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
CaughtFailure.expect(error, JsonException);
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
readBarrierAsync() {
|
|
204
|
+
return FilePresence.unlessMissingAsync(readFile(this.barrierFile, Resources.utf8Encoding));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=installation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/installation/installation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,OAAO,YAAY;IACN,cAAc,CAA8C;IAC5D,OAAO,GAAgB,IAAI,WAAW,EAAE,CAAC;IAE1C,MAAM,CAAS;IACf,WAAW,CAAS;IACpB,YAAY,CAAS;IACrB,iB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AAC;IACd,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,IAAY;QAC1C,IAAI,CAAC;YACH,OAAO,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACb,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,gBAAgB;QACtB,OAAO,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
9
|
+
import { UpdateProcess } from "@noldova/desktop.protocol";
|
|
10
|
+
import { Resources } from "../../resources.js";
|
|
11
|
+
import { PosixProcessApi } from "../process/posix-process-api.js";
|
|
12
|
+
import { PosixProcessTableReader } from "../process/posix-process-table.reader.js";
|
|
13
|
+
import { ProcessClock } from "../process/process-clock.js";
|
|
14
|
+
import { WindowsProcessApi } from "../process/windows-process-api.js";
|
|
15
|
+
import { WindowsProcessTableReader } from "../process/windows-process-table.reader.js";
|
|
16
|
+
export class ProcessPresence {
|
|
17
|
+
createReader;
|
|
18
|
+
reader = null;
|
|
19
|
+
constructor(platform, posix, windows) {
|
|
20
|
+
this.createReader = () => platform === Resources.windowsPlatform
|
|
21
|
+
? new WindowsProcessTableReader(windows, ProcessClock.create(platform))
|
|
22
|
+
: new PosixProcessTableReader(posix);
|
|
23
|
+
}
|
|
24
|
+
static create(platform) {
|
|
25
|
+
return new ProcessPresence(platform, PosixProcessApi.create(platform), WindowsProcessApi.create());
|
|
26
|
+
}
|
|
27
|
+
async stampAsync(processes) {
|
|
28
|
+
if (processes.length === 0)
|
|
29
|
+
return [];
|
|
30
|
+
const table = await this.readTableAsync();
|
|
31
|
+
return processes.flatMap(([processId, role]) => {
|
|
32
|
+
const entry = table.find(processId);
|
|
33
|
+
return Object.isUndefined(entry) ? [] : [new UpdateProcess(processId, entry.earliest, entry.latest, role)];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async isRunningAsync(process) {
|
|
37
|
+
const entry = (await this.readTableAsync()).find(process.processId);
|
|
38
|
+
return !Object.isUndefined(entry) && entry.earliest <= process.latest && process.earliest <= entry.latest;
|
|
39
|
+
}
|
|
40
|
+
readTableAsync() {
|
|
41
|
+
this.reader ??= this.createReader();
|
|
42
|
+
return this.reader.readAsync();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=process-presence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-presence.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/installation/process-presence.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,MAAM,OAAO,eAAe;IACT,YAAY,CAA4B;IACjD,MAAM,GAA+B,IAAI,CAAC;IA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,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC;IAC5G,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { rmSync } from "node:fs";
|
|
9
|
+
import { mkdir, readdir, realpath, rm } from "node:fs/promises";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import "@noldova/context.core";
|
|
13
|
+
import { AppImageCopyRecord } from "../../models/app-image-copy-record.js";
|
|
14
|
+
import { SystemErrorCode } from "../../models/system-error-code.js";
|
|
15
|
+
import { Resources } from "../../resources.js";
|
|
16
|
+
import { AppImageKeepalive } from "../client/app-image-keepalive.js";
|
|
17
|
+
export class AppImageCopyCleanup {
|
|
18
|
+
static async removeAsync(directory, diagnostics, presence, findWriters = AppImageKeepalive.findWriters) {
|
|
19
|
+
await mkdir(directory.logsFolder, { recursive: true });
|
|
20
|
+
const records = (await readdir(directory.logsFolder)).filter(t => Resources.copyRecordNamePattern.test(t)).map(t => path.join(directory.logsFolder, t));
|
|
21
|
+
await Promise.all(records.map(t => AppImageCopyCleanup.endAsync(t, presence, findWriters).catch((error) => {
|
|
22
|
+
diagnostics.write(Resources.formatCopyNotEnded(t, String(error)));
|
|
23
|
+
})));
|
|
24
|
+
}
|
|
25
|
+
static async removeOwnAsync(file, diagnostics) {
|
|
26
|
+
await AppImageCopyCleanup.removeOwnCopyAsync(file).catch((error) => {
|
|
27
|
+
diagnostics.write(Resources.formatCopyNotEnded(file, String(error)));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static async removeOwnCopyAsync(file) {
|
|
31
|
+
const record = await AppImageCopyRecord.readAsync(file);
|
|
32
|
+
if (Object.isNull(record?.mounter ?? null))
|
|
33
|
+
await AppImageCopyCleanup.removeCopyAsync(file, record);
|
|
34
|
+
}
|
|
35
|
+
static async endAsync(file, presence, findWriters) {
|
|
36
|
+
const record = await AppImageCopyRecord.readAsync(file);
|
|
37
|
+
if (Object.isNull(record) || await presence.isRunningAsync(record.holder))
|
|
38
|
+
return;
|
|
39
|
+
const listing = `${file}${Resources.copyListingSuffix}`;
|
|
40
|
+
for (const processId of await AppImageCopyCleanup.findMountersAsync(record, listing, presence, findWriters))
|
|
41
|
+
process.kill(processId, Resources.copyEndSignal);
|
|
42
|
+
await rm(listing, { force: true });
|
|
43
|
+
await AppImageCopyCleanup.removeCopyAsync(file, record);
|
|
44
|
+
}
|
|
45
|
+
static async findMountersAsync(record, listing, presence, findWriters) {
|
|
46
|
+
if (!Object.isNull(record.mounter))
|
|
47
|
+
return await presence.isRunningAsync(record.mounter) ? [record.mounter.processId] : [];
|
|
48
|
+
if (!Object.isNull(record.extraction))
|
|
49
|
+
return [];
|
|
50
|
+
const file = await realpath(listing).catch((error) => {
|
|
51
|
+
if (!SystemErrorCode.is(error, Resources.missingFileErrorCode))
|
|
52
|
+
throw error;
|
|
53
|
+
return null;
|
|
54
|
+
});
|
|
55
|
+
return Object.isNull(file) ? [] : findWriters(file);
|
|
56
|
+
}
|
|
57
|
+
static async removeCopyAsync(file, record) {
|
|
58
|
+
if (Object.isNull(record) || Object.isNull(record.extraction) || AppImageCopyCleanup.removeExtraction(record.extraction))
|
|
59
|
+
await rm(file, { force: true });
|
|
60
|
+
}
|
|
61
|
+
static removeExtraction(folder) {
|
|
62
|
+
const location = path.resolve(folder);
|
|
63
|
+
if (path.dirname(location) !== path.resolve(tmpdir()))
|
|
64
|
+
return false;
|
|
65
|
+
if (!Resources.copyExtractionName.test(path.basename(location)))
|
|
66
|
+
return true;
|
|
67
|
+
const isArchiveOff = process.noAsar;
|
|
68
|
+
process.noAsar = true;
|
|
69
|
+
try {
|
|
70
|
+
rmSync(location, { recursive: true, force: true });
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
process.noAsar = isArchiveOff;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=app-image-copy-cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-image-copy-cleanup.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/lifetime/app-image-copy-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIrE,MAAM,OAAO,mBAAmB;IACvB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,WAAqB,EAAE,QAAyB,EACxG,cAAmD,iBAAiB,CAAC,WAAW;QAChF,MAAM,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,C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
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
9
|
+
import { ArgumentOutOfRangeException } from "@noldova/context.exceptions";
|
|
10
|
+
import { Resources } from "../../resources.js";
|
|
11
|
+
export class IdleMonitor {
|
|
12
|
+
graceMilliseconds;
|
|
13
|
+
participant;
|
|
14
|
+
timer = null;
|
|
15
|
+
isDisposed = false;
|
|
16
|
+
constructor(graceMilliseconds, participant) {
|
|
17
|
+
ArgumentOutOfRangeException.throwIfNotPositiveInteger(graceMilliseconds, Resources.idleGraceParameterName);
|
|
18
|
+
this.graceMilliseconds = graceMilliseconds;
|
|
19
|
+
this.participant = participant;
|
|
20
|
+
}
|
|
21
|
+
check() {
|
|
22
|
+
if (this.isDisposed)
|
|
23
|
+
return;
|
|
24
|
+
if (!this.participant.isIdle) {
|
|
25
|
+
this.disarm();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (Object.isNull(this.timer))
|
|
29
|
+
this.timer = setTimeout(() => this.fire(), this.graceMilliseconds);
|
|
30
|
+
}
|
|
31
|
+
[Symbol.dispose]() {
|
|
32
|
+
this.isDisposed = true;
|
|
33
|
+
this.disarm();
|
|
34
|
+
}
|
|
35
|
+
fire() {
|
|
36
|
+
this.timer = null;
|
|
37
|
+
if (this.participant.isIdle)
|
|
38
|
+
this.participant.handleIdle();
|
|
39
|
+
}
|
|
40
|
+
disarm() {
|
|
41
|
+
if (Object.isNull(this.timer))
|
|
42
|
+
return;
|
|
43
|
+
clearTimeout(this.timer);
|
|
44
|
+
this.timer = null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=idle-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idle-monitor.js","sourceRoot":"","sources":["../../../../../src/noldova.des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,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3B,OAAO;QACT,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export class MoveAsideMethod {
|
|
9
|
+
moveAside;
|
|
10
|
+
constructor(moveAside) {
|
|
11
|
+
this.moveAside = moveAside;
|
|
12
|
+
}
|
|
13
|
+
async handleAsync(_context) {
|
|
14
|
+
await this.moveAside();
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=move-aside-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-aside-method.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/lifetime/move-aside-method.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,OAAO,eAAe;IACT,SAAS,CAAsB;IAEhD,YAAmB,SAA8B;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,QAAwB;QAC/C,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { QuitAnswered } from "@noldova/desktop.protocol";
|
|
9
|
+
export class QuitAnsweredMethod {
|
|
10
|
+
relay;
|
|
11
|
+
constructor(relay) {
|
|
12
|
+
this.relay = relay;
|
|
13
|
+
}
|
|
14
|
+
handleAsync(context) {
|
|
15
|
+
this.relay.recordAnswer(context.connection, QuitAnswered.fromJson(context.payload));
|
|
16
|
+
return Promise.resolve(null);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=quit-answered-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quit-answered-method.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/lifetime/quit-answered-method.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAMzD,MAAM,OAAO,kBAAkB;IACZ,KAAK,CAAY;IAElC,YAAmB,KAAgB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,WAAW,CAAC,OAAuB;QACxC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACpF,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export class QuitMethod {
|
|
9
|
+
relay;
|
|
10
|
+
constructor(relay) {
|
|
11
|
+
this.relay = relay;
|
|
12
|
+
}
|
|
13
|
+
async handleAsync(context) {
|
|
14
|
+
return (await this.relay.quitAsync(context)).toJson();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=quit-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quit-method.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/lifetime/quit-method.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,OAAO,UAAU;IACJ,KAAK,CAAY;IAElC,YAAmB,KAAgB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,OAAuB;QAC9C,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Noldova.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { setImmediate as yieldTurn } from "node:timers/promises";
|
|
9
|
+
import "@noldova/context.core";
|
|
10
|
+
import { Failure, FailureCode, QuitAnswer, QuitReport, QuitResult, ShellClients } from "@noldova/desktop.protocol";
|
|
11
|
+
import { MethodFailureException } from "../../exceptions/method-failure.exception.js";
|
|
12
|
+
import { ProductInfo } from "../../models/product-info.js";
|
|
13
|
+
import { Resources } from "../../resources.js";
|
|
14
|
+
export class QuitRelay {
|
|
15
|
+
server;
|
|
16
|
+
quitting;
|
|
17
|
+
waits = new Map();
|
|
18
|
+
quittingMainProcesses = new Set();
|
|
19
|
+
mainProcesses = new Set();
|
|
20
|
+
constructor(server, quitting) {
|
|
21
|
+
this.server = server;
|
|
22
|
+
this.quitting = quitting;
|
|
23
|
+
}
|
|
24
|
+
countWaiting(context) {
|
|
25
|
+
return new Set([...this.waits.keys()].map(t => t.connection).filter(t => t !== context.connection)).size;
|
|
26
|
+
}
|
|
27
|
+
quitAsync(context) {
|
|
28
|
+
const isJoining = this.waits.size > 0;
|
|
29
|
+
if (!isJoining) {
|
|
30
|
+
const mainProcesses = this.server.clients.filter(t => t.client === ShellClients.mainProcess && t.connection !== context.connection).map(t => t.connection);
|
|
31
|
+
if (mainProcesses.length === 0)
|
|
32
|
+
return Promise.resolve(new QuitReport(QuitResult.NoMainProcess));
|
|
33
|
+
this.mainProcesses = new Set(mainProcesses);
|
|
34
|
+
}
|
|
35
|
+
const wait = Promise.withResolvers();
|
|
36
|
+
this.waits.set(context, wait);
|
|
37
|
+
context.signal.addEventListener(Resources.abortEvent, () => this.cancel(context), { once: true });
|
|
38
|
+
if (!isJoining)
|
|
39
|
+
this.quitting.publish(null);
|
|
40
|
+
return wait.promise;
|
|
41
|
+
}
|
|
42
|
+
recordAnswer(connection, answered) {
|
|
43
|
+
if (!this.mainProcesses.has(connection))
|
|
44
|
+
return;
|
|
45
|
+
this.fail(answered.answer === QuitAnswer.Stayed
|
|
46
|
+
? new Failure(FailureCode.Cancelled, Resources.formatQuitKept(ProductInfo.current.name))
|
|
47
|
+
: new Failure(FailureCode.Conflict, Resources.formatQuitSaveFailed(ProductInfo.current.name)));
|
|
48
|
+
}
|
|
49
|
+
recordStop(connection) {
|
|
50
|
+
if (this.server.clients.some(t => t.connection === connection && t.client === ShellClients.mainProcess))
|
|
51
|
+
this.quittingMainProcesses.add(connection);
|
|
52
|
+
}
|
|
53
|
+
check() {
|
|
54
|
+
if (this.waits.size > 0 && !this.server.clients.some(t => this.mainProcesses.has(t.connection)))
|
|
55
|
+
this.finish(Resources.formatQuitUnanswered(ProductInfo.current.name));
|
|
56
|
+
for (const connection of this.quittingMainProcesses) {
|
|
57
|
+
if (!this.server.clients.some(t => t.connection === connection))
|
|
58
|
+
this.quittingMainProcesses.delete(connection);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async endAsync() {
|
|
62
|
+
if (this.waits.size === 0)
|
|
63
|
+
return;
|
|
64
|
+
this.finish(Resources.formatQuitInterrupted(ProductInfo.current.name));
|
|
65
|
+
await yieldTurn();
|
|
66
|
+
}
|
|
67
|
+
finish(unanswered) {
|
|
68
|
+
if (![...this.mainProcesses].some(t => this.quittingMainProcesses.has(t))) {
|
|
69
|
+
this.fail(new Failure(FailureCode.Unavailable, unanswered));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
for (const wait of this.takeWaits())
|
|
73
|
+
wait.resolve(new QuitReport(QuitResult.Quit));
|
|
74
|
+
}
|
|
75
|
+
fail(failure) {
|
|
76
|
+
for (const wait of this.takeWaits())
|
|
77
|
+
wait.reject(new MethodFailureException(failure));
|
|
78
|
+
}
|
|
79
|
+
cancel(context) {
|
|
80
|
+
this.waits.delete(context);
|
|
81
|
+
if (this.waits.size === 0)
|
|
82
|
+
this.mainProcesses = new Set();
|
|
83
|
+
}
|
|
84
|
+
takeWaits() {
|
|
85
|
+
const waits = [...this.waits.values()];
|
|
86
|
+
this.waits.clear();
|
|
87
|
+
this.mainProcesses = new Set();
|
|
88
|
+
return waits;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=quit-relay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quit-relay.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/lifetime/quit-relay.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAqB,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEtI,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,OAAO,SAAS;IACH,MAAM,CAAgB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