@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 @@
|
|
|
1
|
+
{"version":3,"file":"app-image-copy-launch.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/client/app-image-copy-launch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAA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,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAChE,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACpD,SAAS,CAAC;gBACR,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;gBAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;gBAClD,IAAI,GAAG,GAAG,CAAC;oBACT,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;gBAC5B,IAAI,GAAG,KAAK,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,GAAG,EAAE,IAAI,QAAQ;oBACtF,OAAO,IAAI,CAAC;gBACd,MAAM,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC;YACvH,CAAC;QACH,CAAC;gBACO,CAAC;YACP,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { spawn } from "node:child_process";
|
|
9
|
+
import { once } from "node:events";
|
|
10
|
+
import { open } from "node:fs/promises";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import "@noldova/context.core";
|
|
13
|
+
import { ExceptionOptions } from "@noldova/context.exceptions";
|
|
14
|
+
import { AppImageCopyUnavailableException } from "../../exceptions/app-image-copy-unavailable.exception.js";
|
|
15
|
+
import { Resources } from "../../resources.js";
|
|
16
|
+
export class AppImageExtraction {
|
|
17
|
+
static async extractAsync(image, extraction, environment, startLog) {
|
|
18
|
+
const errors = await open(startLog, Resources.appendFlag, Resources.privateFileMode);
|
|
19
|
+
let isExtracted;
|
|
20
|
+
try {
|
|
21
|
+
isExtracted = await AppImageExtraction.runAsync(image, extraction, environment, errors.fd);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw new AppImageCopyUnavailableException(image, new ExceptionOptions(error));
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
await errors.close();
|
|
28
|
+
}
|
|
29
|
+
if (!isExtracted)
|
|
30
|
+
throw new AppImageCopyUnavailableException(image);
|
|
31
|
+
return path.join(extraction, Resources.copyExtractionFolder);
|
|
32
|
+
}
|
|
33
|
+
static async runAsync(image, extraction, environment, errors) {
|
|
34
|
+
const child = spawn(image, [Resources.appImageExtractOption], { cwd: extraction, env: environment, stdio: [Resources.ignoredOutput, Resources.ignoredOutput, errors] });
|
|
35
|
+
const [exitCode] = await once(child, Resources.exitEvent);
|
|
36
|
+
return exitCode === 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=app-image-extraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-image-extraction.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/client/app-image-extraction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,uBAAuB,C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AAE,CAAC,CAAC;QACxK,MAAM,CAAC,QAAQ,CAAC,GAAc,MAAM,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACrE,OAAO,QAAQ,KAAK,CAAC,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { closeSync, constants, fstatSync, openSync, readdirSync, readlinkSync } from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import "@noldova/context.core";
|
|
11
|
+
import { SystemErrorCode } from "../../models/system-error-code.js";
|
|
12
|
+
import { Resources } from "../../resources.js";
|
|
13
|
+
export class AppImageKeepalive {
|
|
14
|
+
static open(processId) {
|
|
15
|
+
const folder = path.posix.join(Resources.processFolder, String(processId), Resources.descriptorFolderName);
|
|
16
|
+
const names = AppImageKeepalive.unlessGone(() => readdirSync(folder)) ?? [];
|
|
17
|
+
const pipes = names.map(t => ({ name: t, link: AppImageKeepalive.readLink(path.posix.join(folder, t)) })).filter(t => t.link.startsWith(Resources.pipeLinkPrefix));
|
|
18
|
+
const [pipe, ...others] = pipes;
|
|
19
|
+
if (Object.isUndefined(pipe) || others.length > 0)
|
|
20
|
+
return null;
|
|
21
|
+
const descriptor = AppImageKeepalive.unlessGone(() => openSync(path.posix.join(folder, pipe.name), constants.O_RDONLY | constants.O_NONBLOCK));
|
|
22
|
+
if (Object.isNull(descriptor) || AppImageKeepalive.isPipe(descriptor, pipe.link))
|
|
23
|
+
return descriptor;
|
|
24
|
+
closeSync(descriptor);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
static findWriters(file) {
|
|
28
|
+
return readdirSync(Resources.processFolder).filter(t => Resources.processIdPattern.test(t))
|
|
29
|
+
.filter(t => AppImageKeepalive.readLink(path.posix.join(Resources.processFolder, t, Resources.descriptorFolderName, Resources.outputDescriptorName)) === file)
|
|
30
|
+
.map(Number);
|
|
31
|
+
}
|
|
32
|
+
static isPipe(descriptor, link) {
|
|
33
|
+
try {
|
|
34
|
+
const status = fstatSync(descriptor);
|
|
35
|
+
return status.isFIFO() && Resources.formatPipeLink(status.ino) === link;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
closeSync(descriptor);
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static unlessGone(read) {
|
|
43
|
+
try {
|
|
44
|
+
return read();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof Error && Resources.nodeErrorCodeField in error && error[Resources.nodeErrorCodeField] === Resources.missingFileCode)
|
|
48
|
+
return null;
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static readLink(file) {
|
|
53
|
+
try {
|
|
54
|
+
return readlinkSync(file);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!SystemErrorCode.isAny(error, Resources.unreadableDescriptorCodes))
|
|
58
|
+
throw error;
|
|
59
|
+
return String.empty;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=app-image-keepalive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-image-keepalive.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/client/app-image-keepalive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC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C;IACH,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,IAAY;QAClC,IAAI,CAAC;YACH,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,yBAAyB,CAAC;gBACpE,MAAM,KAAK,CAAC;YACd,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { ArgumentException } from "@noldova/context.exceptions";
|
|
9
|
+
import { BuildRelation } from "../../enums/build-relation.js";
|
|
10
|
+
import { Resources } from "../../resources.js";
|
|
11
|
+
export class BuildComparer {
|
|
12
|
+
static compare(own, other) {
|
|
13
|
+
const ownKey = BuildComparer.formatKey(own.productVersion);
|
|
14
|
+
const otherKey = BuildComparer.formatKey(other.productVersion);
|
|
15
|
+
if (ownKey === otherKey)
|
|
16
|
+
return BuildRelation.SameVersion;
|
|
17
|
+
return ownKey > otherKey ? BuildRelation.Newer : BuildRelation.Older;
|
|
18
|
+
}
|
|
19
|
+
static formatKey(version) {
|
|
20
|
+
if (!Resources.productVersionPattern.test(version))
|
|
21
|
+
throw new ArgumentException(Resources.formatProductVersionInvalid(version), Resources.productVersionParameterName);
|
|
22
|
+
return version.split(Resources.versionSeparator).map(t => t.padStart(Resources.versionPartWidth, Resources.versionPadding)).join(Resources.versionSeparator);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=build-comparer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-comparer.js","sourceRoot":"","sources":["../../../../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|
+
* 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 { connect } from "node:net";
|
|
9
|
+
import "@noldova/context.core";
|
|
10
|
+
import { ArgumentException, ArgumentOutOfRangeException, ExceptionOptions } from "@noldova/context.exceptions";
|
|
11
|
+
import { BuildIdentity, Cancel, Event, Failure, FailureCode, FrameReader, FrameWriter, Handshake, PreShellData, ProtocolException, Request, Response, RuntimeHandover, ShellMethods, StopRequest, WireDecoder } from "@noldova/desktop.protocol";
|
|
12
|
+
import { CallUnansweredException } from "../../exceptions/call-unanswered.exception.js";
|
|
13
|
+
import { ConnectionClosedException } from "../../exceptions/connection-closed.exception.js";
|
|
14
|
+
import { ConnectionRefusedException } from "../../exceptions/connection-refused.exception.js";
|
|
15
|
+
import { ConnectionException } from "../../exceptions/connection.exception.js";
|
|
16
|
+
import { HandshakeClosedException } from "../../exceptions/handshake-closed.exception.js";
|
|
17
|
+
import { HandshakeIdentityMismatchException } from "../../exceptions/handshake-identity-mismatch.exception.js";
|
|
18
|
+
import { HandshakeTimedOutException } from "../../exceptions/handshake-timed-out.exception.js";
|
|
19
|
+
import { RuntimeUnreachableException } from "../../exceptions/runtime-unreachable.exception.js";
|
|
20
|
+
import { ClientSettings } from "../../models/client-settings.js";
|
|
21
|
+
import { PendingCall } from "../../models/pending-call.js";
|
|
22
|
+
import { Resources } from "../../resources.js";
|
|
23
|
+
export class RuntimeClient {
|
|
24
|
+
socket;
|
|
25
|
+
identity;
|
|
26
|
+
listener;
|
|
27
|
+
settings;
|
|
28
|
+
reader;
|
|
29
|
+
writer;
|
|
30
|
+
decoder = new WireDecoder();
|
|
31
|
+
pending = new Map();
|
|
32
|
+
handshake = Promise.withResolvers();
|
|
33
|
+
handshakeId;
|
|
34
|
+
otherBuild = null;
|
|
35
|
+
preShell = null;
|
|
36
|
+
isRefused = false;
|
|
37
|
+
failure = null;
|
|
38
|
+
isEstablished = false;
|
|
39
|
+
isClosed = false;
|
|
40
|
+
nextId = 1;
|
|
41
|
+
clientName;
|
|
42
|
+
constructor(socket, identity, clientName, listener, settings) {
|
|
43
|
+
this.socket = socket;
|
|
44
|
+
this.identity = identity;
|
|
45
|
+
this.clientName = clientName;
|
|
46
|
+
this.listener = listener;
|
|
47
|
+
this.settings = settings;
|
|
48
|
+
this.reader = new FrameReader(settings.maximumFrameLength);
|
|
49
|
+
this.writer = new FrameWriter(settings.maximumFrameLength);
|
|
50
|
+
this.handshakeId = Resources.formatFirstRequestId(clientName);
|
|
51
|
+
socket.setEncoding(Resources.utf8Encoding);
|
|
52
|
+
socket.on(Resources.dataEvent, (chunk) => this.receive(chunk));
|
|
53
|
+
socket.on(Resources.errorEvent, () => socket.destroy());
|
|
54
|
+
socket.on(Resources.closeEvent, () => this.handleClosed());
|
|
55
|
+
}
|
|
56
|
+
get handover() {
|
|
57
|
+
return this.otherBuild;
|
|
58
|
+
}
|
|
59
|
+
get isRefusedAsMainProcess() {
|
|
60
|
+
return this.isRefused;
|
|
61
|
+
}
|
|
62
|
+
get preShellData() {
|
|
63
|
+
return this.preShell;
|
|
64
|
+
}
|
|
65
|
+
get isConnected() {
|
|
66
|
+
return !this.isClosed;
|
|
67
|
+
}
|
|
68
|
+
static async connectAsync(endpoint, token, identity, clientName, listener, settings = new ClientSettings()) {
|
|
69
|
+
ArgumentException.throwIfNullOrWhitespace(clientName, Resources.clientNameParameterName);
|
|
70
|
+
const socket = await RuntimeClient.openAsync(endpoint);
|
|
71
|
+
const client = new RuntimeClient(socket, identity, clientName, listener, settings);
|
|
72
|
+
await client.shakeHandsAsync(token);
|
|
73
|
+
return client;
|
|
74
|
+
}
|
|
75
|
+
callAsync(method, payload, timeoutMilliseconds = this.settings.callTimeout, signal, window, page) {
|
|
76
|
+
ArgumentOutOfRangeException.throwIfNotPositiveInteger(timeoutMilliseconds, Resources.timeoutMillisecondsParameterName);
|
|
77
|
+
if (this.isClosed)
|
|
78
|
+
return Promise.reject(RuntimeClient.createDisconnectedException());
|
|
79
|
+
const id = `${this.clientName}${Resources.requestIdSeparator}${this.nextId++}`;
|
|
80
|
+
if (signal?.aborted === true)
|
|
81
|
+
return Promise.resolve(Response.failure(id, new Failure(FailureCode.Cancelled, Resources.cancelled)));
|
|
82
|
+
let frame;
|
|
83
|
+
try {
|
|
84
|
+
frame = this.writer.write(new Request(id, method, payload, timeoutMilliseconds, window, page));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (!(error instanceof ProtocolException))
|
|
88
|
+
throw error;
|
|
89
|
+
return Promise.resolve(Response.failure(id, new Failure(error.code, error.message)));
|
|
90
|
+
}
|
|
91
|
+
const resolvers = Promise.withResolvers();
|
|
92
|
+
const cancel = () => this.send(new Cancel(id));
|
|
93
|
+
signal?.addEventListener(Resources.abortEvent, cancel, { once: true });
|
|
94
|
+
const timer = setTimeout(() => {
|
|
95
|
+
this.pending.get(id)?.fail(new CallUnansweredException(method.text));
|
|
96
|
+
}, timeoutMilliseconds + this.settings.answerGrace);
|
|
97
|
+
this.pending.set(id, new PendingCall(resolvers, timer, () => {
|
|
98
|
+
this.pending.delete(id);
|
|
99
|
+
signal?.removeEventListener(Resources.abortEvent, cancel);
|
|
100
|
+
}));
|
|
101
|
+
this.socket.write(frame);
|
|
102
|
+
return resolvers.promise;
|
|
103
|
+
}
|
|
104
|
+
stopAsync(policy) {
|
|
105
|
+
return this.callAsync(ShellMethods.stop, new StopRequest(policy).toJson());
|
|
106
|
+
}
|
|
107
|
+
moveAsideAsync() {
|
|
108
|
+
return this.callAsync(ShellMethods.moveAside, null);
|
|
109
|
+
}
|
|
110
|
+
close() {
|
|
111
|
+
this.socket.destroy();
|
|
112
|
+
}
|
|
113
|
+
static openAsync(endpoint) {
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
const socket = Object.isNull(endpoint.port) ? connect(String(endpoint.path)) : connect(endpoint.port, Resources.loopbackHost);
|
|
116
|
+
socket.once(Resources.errorEvent, (error) => reject(new RuntimeUnreachableException(endpoint.toString(), new ExceptionOptions(error))));
|
|
117
|
+
socket.once(Resources.connectEvent, () => resolve(socket));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
static createDisconnectedException() {
|
|
121
|
+
return new ConnectionClosedException();
|
|
122
|
+
}
|
|
123
|
+
async shakeHandsAsync(token) {
|
|
124
|
+
const timer = setTimeout(() => this.handshake.reject(new HandshakeTimedOutException()), this.settings.handshakeTimeout);
|
|
125
|
+
this.send(new Handshake(this.handshakeId, this.identity, token, this.clientName));
|
|
126
|
+
try {
|
|
127
|
+
await this.handshake.promise;
|
|
128
|
+
this.isEstablished = true;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
this.socket.destroy();
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
send(message) {
|
|
139
|
+
if (!this.isClosed)
|
|
140
|
+
this.socket.write(this.writer.write(message));
|
|
141
|
+
}
|
|
142
|
+
receive(chunk) {
|
|
143
|
+
try {
|
|
144
|
+
for (const frame of this.reader.read(chunk))
|
|
145
|
+
this.dispatch(this.decoder.decode(frame));
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
this.failure = error instanceof ProtocolException ? new Failure(error.code, error.message) : new Failure(FailureCode.InvalidMessage, Resources.invalidFrame);
|
|
149
|
+
this.socket.destroy();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
dispatch(message) {
|
|
153
|
+
if (message instanceof Response)
|
|
154
|
+
this.handleResponse(message);
|
|
155
|
+
else if (message instanceof Event && this.isEstablished)
|
|
156
|
+
this.listener.onEvent(message);
|
|
157
|
+
}
|
|
158
|
+
handleResponse(response) {
|
|
159
|
+
if (response.id === this.handshakeId) {
|
|
160
|
+
this.handleHandshake(response);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (Object.isNull(response.id)) {
|
|
164
|
+
const failure = response.failure;
|
|
165
|
+
this.handshake.reject(Object.isUndefined(failure) ? new HandshakeClosedException() : new ConnectionRefusedException(failure));
|
|
166
|
+
this.socket.destroy();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this.pending.get(response.id)?.complete(response);
|
|
170
|
+
}
|
|
171
|
+
handleHandshake(response) {
|
|
172
|
+
const failure = response.failure;
|
|
173
|
+
if (Object.isUndefined(failure)) {
|
|
174
|
+
const runtime = BuildIdentity.fromJson(response.payload);
|
|
175
|
+
if (Object.isNull(this.identity.findMismatch(runtime)))
|
|
176
|
+
this.handshake.resolve();
|
|
177
|
+
else
|
|
178
|
+
this.handshake.reject(new HandshakeIdentityMismatchException());
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if ((failure.code === FailureCode.BuildMismatch || failure.code === FailureCode.Unauthorized) && !Object.isUndefined(failure.details)) {
|
|
182
|
+
this.otherBuild = RuntimeHandover.fromJson(failure.details);
|
|
183
|
+
this.isRefused = failure.code === FailureCode.Unauthorized;
|
|
184
|
+
this.handshake.resolve();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (failure.code === FailureCode.PreShellData && !Object.isUndefined(failure.details)) {
|
|
188
|
+
this.preShell = PreShellData.fromJson(failure.details);
|
|
189
|
+
this.handshake.resolve();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.handshake.reject(new ConnectionRefusedException(failure));
|
|
193
|
+
}
|
|
194
|
+
handleClosed() {
|
|
195
|
+
this.isClosed = true;
|
|
196
|
+
this.handshake.reject(new HandshakeClosedException());
|
|
197
|
+
for (const call of [...this.pending.values()])
|
|
198
|
+
call.fail(RuntimeClient.createDisconnectedException());
|
|
199
|
+
if (this.isEstablished)
|
|
200
|
+
this.listener.onDisconnected(this.failure);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=runtime-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-client.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.runtime/src/services/client/runtime-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAe,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/G,OAAO,EACL,aAAa,EACb,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,EAEjB,OAAO,EACP,QAAQ,EACR,eAAe,EACf,YAAY,EAEZ,WAAW,EAEX,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,aAAa;IACP,MAAM,CAAS;IACf,QAAQ,CAAgB;IACxB,QAAQ,CAAyB;IACjC,QAAQ,CAAiB;IACzB,MAAM,CAAc;IACpB,MAAM,CAAc;IACpB,OAAO,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AO,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC;QACtD,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,2BAA2B,EAAE,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,aAAa;YACpB,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -0,0 +1,259 @@
|
|
|
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 { randomUUID } from "node:crypto";
|
|
9
|
+
import { mkdir, readFile, rename, rm } from "node:fs/promises";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import "@noldova/context.core";
|
|
13
|
+
import { FailureCode, RunningWork, StopPolicy } from "@noldova/desktop.protocol";
|
|
14
|
+
import { BuildRelation } from "../../enums/build-relation.js";
|
|
15
|
+
import { UpdateBarrierStatus } from "../../enums/update-barrier-status.js";
|
|
16
|
+
import { BuildMismatchException } from "../../exceptions/build-mismatch.exception.js";
|
|
17
|
+
import { ConnectionException } from "../../exceptions/connection.exception.js";
|
|
18
|
+
import { LaunchLimitReachedException } from "../../exceptions/launch-limit-reached.exception.js";
|
|
19
|
+
import { LaunchTimedOutException } from "../../exceptions/launch-timed-out.exception.js";
|
|
20
|
+
import { LaunchException } from "../../exceptions/launch.exception.js";
|
|
21
|
+
import { MainProcessRefusedAgainException } from "../../exceptions/main-process-refused-again.exception.js";
|
|
22
|
+
import { MoveAsideRefusedException } from "../../exceptions/move-aside-refused.exception.js";
|
|
23
|
+
import { NoRuntimeException } from "../../exceptions/no-runtime.exception.js";
|
|
24
|
+
import { PreShellDataFoundException } from "../../exceptions/pre-shell-data-found.exception.js";
|
|
25
|
+
import { RuntimeExitedWithoutReasonException } from "../../exceptions/runtime-exited-without-reason.exception.js";
|
|
26
|
+
import { RuntimeExitedException } from "../../exceptions/runtime-exited.exception.js";
|
|
27
|
+
import { RuntimeHandoverException } from "../../exceptions/runtime-handover.exception.js";
|
|
28
|
+
import { StopRefusedException } from "../../exceptions/stop-refused.exception.js";
|
|
29
|
+
import { StopTimedOutException } from "../../exceptions/stop-timed-out.exception.js";
|
|
30
|
+
import { UpdateInProgressException } from "../../exceptions/update-in-progress.exception.js";
|
|
31
|
+
import { WorkInProgressException } from "../../exceptions/work-in-progress.exception.js";
|
|
32
|
+
import { AppImageSource } from "../../models/app-image-source.js";
|
|
33
|
+
import { AttachOptions } from "../../models/attach-options.js";
|
|
34
|
+
import { Endpoint } from "../../models/endpoint.js";
|
|
35
|
+
import { ProductInfo } from "../../models/product-info.js";
|
|
36
|
+
import { StartedRuntime } from "../../models/started-runtime.js";
|
|
37
|
+
import { SystemErrorCode } from "../../models/system-error-code.js";
|
|
38
|
+
import { Resources } from "../../resources.js";
|
|
39
|
+
import { DiagnosticRedactor } from "../diagnostics/diagnostic-redactor.js";
|
|
40
|
+
import { StandardErrorCap } from "../diagnostics/standard-error-cap.js";
|
|
41
|
+
import { DiscoveryReader } from "../discovery/discovery.reader.js";
|
|
42
|
+
import { FolderWatch } from "../files/folder-watch.js";
|
|
43
|
+
import { ProcessPresence } from "../installation/process-presence.js";
|
|
44
|
+
import { OwnershipLock } from "../ownership/ownership-lock.js";
|
|
45
|
+
import { ChildProcessStarter } from "../process/child-process-starter.js";
|
|
46
|
+
import { PosixProcessApi } from "../process/posix-process-api.js";
|
|
47
|
+
import { AppImageCopyLaunch } from "./app-image-copy-launch.js";
|
|
48
|
+
import { AppImageExtraction } from "./app-image-extraction.js";
|
|
49
|
+
import { AppImageKeepalive } from "./app-image-keepalive.js";
|
|
50
|
+
import { BuildComparer } from "./build-comparer.js";
|
|
51
|
+
import { RuntimeClient } from "./runtime-client.js";
|
|
52
|
+
export class RuntimeLauncher {
|
|
53
|
+
settings;
|
|
54
|
+
identity;
|
|
55
|
+
starter;
|
|
56
|
+
installation;
|
|
57
|
+
presence;
|
|
58
|
+
log;
|
|
59
|
+
constructor(settings, identity, installation, log, starter = new ChildProcessStarter(), presence = ProcessPresence.create(process.platform)) {
|
|
60
|
+
this.settings = settings;
|
|
61
|
+
this.identity = identity;
|
|
62
|
+
this.starter = starter;
|
|
63
|
+
this.installation = installation;
|
|
64
|
+
this.log = log;
|
|
65
|
+
this.presence = presence;
|
|
66
|
+
}
|
|
67
|
+
async attachAsync(clientName, listener, policy = StopPolicy.IfIdle, options = new AttachOptions()) {
|
|
68
|
+
return RuntimeLauncher.requireCurrentData(await this.connectAsync(clientName, listener, policy, options));
|
|
69
|
+
}
|
|
70
|
+
async moveAsideAsync(clientName, listener, policy = StopPolicy.IfIdle) {
|
|
71
|
+
const client = await this.connectAsync(clientName, listener, policy, new AttachOptions());
|
|
72
|
+
if (Object.isNull(client.preShellData))
|
|
73
|
+
return client;
|
|
74
|
+
const response = await client.moveAsideAsync().finally(() => client.close());
|
|
75
|
+
const failure = response.failure;
|
|
76
|
+
if (!Object.isUndefined(failure))
|
|
77
|
+
throw new MoveAsideRefusedException(failure);
|
|
78
|
+
return this.attachAsync(clientName, listener, policy);
|
|
79
|
+
}
|
|
80
|
+
static requireCurrentData(client) {
|
|
81
|
+
const data = client.preShellData;
|
|
82
|
+
if (Object.isNull(data))
|
|
83
|
+
return client;
|
|
84
|
+
client.close();
|
|
85
|
+
throw new PreShellDataFoundException(data);
|
|
86
|
+
}
|
|
87
|
+
async connectAsync(clientName, listener, policy, options) {
|
|
88
|
+
const watch = FolderWatch.open(this.settings.dataDirectory.discoveryFolder, this.log);
|
|
89
|
+
try {
|
|
90
|
+
let deadline = Date.now() + this.settings.launchTimeout;
|
|
91
|
+
let limit = Date.now() + this.settings.launchLimit;
|
|
92
|
+
let started = null;
|
|
93
|
+
let refusals = 0;
|
|
94
|
+
let isRefusedBefore = false;
|
|
95
|
+
for (;;) {
|
|
96
|
+
const discovery = await DiscoveryReader.readAsync(this.settings.dataDirectory);
|
|
97
|
+
if (!Object.isNull(discovery) && OwnershipLock.isOwned(this.settings.dataDirectory)) {
|
|
98
|
+
const client = await this.tryConnectAsync(discovery, clientName, listener).catch(async (error) => {
|
|
99
|
+
if (refusals >= Resources.refusedTokenRetries || !await this.isRepublishedAsync(error, discovery))
|
|
100
|
+
throw error;
|
|
101
|
+
refusals++;
|
|
102
|
+
return null;
|
|
103
|
+
});
|
|
104
|
+
if (!Object.isNull(client)) {
|
|
105
|
+
await this.keepAsync(started, discovery).catch((error) => {
|
|
106
|
+
client.close();
|
|
107
|
+
throw error;
|
|
108
|
+
});
|
|
109
|
+
started = null;
|
|
110
|
+
const handover = client.handover;
|
|
111
|
+
if (Object.isNull(handover))
|
|
112
|
+
return client;
|
|
113
|
+
if (client.isRefusedAsMainProcess && isRefusedBefore) {
|
|
114
|
+
client.close();
|
|
115
|
+
throw new MainProcessRefusedAgainException();
|
|
116
|
+
}
|
|
117
|
+
isRefusedBefore ||= client.isRefusedAsMainProcess;
|
|
118
|
+
await this.resolveOtherBuildAsync(client, handover, policy, options.takeOver, watch);
|
|
119
|
+
deadline = Date.now() + this.settings.launchTimeout;
|
|
120
|
+
limit = Date.now() + this.settings.launchLimit;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (Object.isNull(started)) {
|
|
125
|
+
if (!options.start)
|
|
126
|
+
throw new NoRuntimeException(this.settings.dataDirectory.root);
|
|
127
|
+
await this.requireNoUpdateAsync();
|
|
128
|
+
started = await this.startAsync();
|
|
129
|
+
}
|
|
130
|
+
else if (!started.isRunning && !OwnershipLock.isOwned(this.settings.dataDirectory))
|
|
131
|
+
throw await this.describeExitAsync(started);
|
|
132
|
+
const timeout = this.readTimeout(deadline, limit);
|
|
133
|
+
if (!Object.isNull(timeout)) {
|
|
134
|
+
await RuntimeLauncher.forgetAsync(started);
|
|
135
|
+
throw timeout;
|
|
136
|
+
}
|
|
137
|
+
await watch.waitAsync((Date.now() < deadline ? deadline : limit) - Date.now(), () => this.isLost(started));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
watch[Symbol.dispose]();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
isLost(started) {
|
|
145
|
+
return (Object.isNull(started) || !started.isRunning) && !OwnershipLock.isOwned(this.settings.dataDirectory);
|
|
146
|
+
}
|
|
147
|
+
readTimeout(deadline, limit) {
|
|
148
|
+
if (Date.now() < deadline)
|
|
149
|
+
return null;
|
|
150
|
+
const isOwned = OwnershipLock.isOwned(this.settings.dataDirectory);
|
|
151
|
+
if (isOwned && Date.now() < limit)
|
|
152
|
+
return null;
|
|
153
|
+
return isOwned ? new LaunchLimitReachedException(this.settings.launchLimit) : new LaunchTimedOutException();
|
|
154
|
+
}
|
|
155
|
+
static async forgetAsync(started) {
|
|
156
|
+
if (!Object.isNull(started))
|
|
157
|
+
await rm(started.startLog, { force: true });
|
|
158
|
+
}
|
|
159
|
+
async keepAsync(started, discovery) {
|
|
160
|
+
if (Object.isNull(started) || started.processId !== discovery.processId) {
|
|
161
|
+
await RuntimeLauncher.forgetAsync(started);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const directory = this.settings.dataDirectory;
|
|
165
|
+
try {
|
|
166
|
+
await StandardErrorCap.keepAsync(directory.runtimeErrorsLog, directory.previousRuntimeErrorsLog, new DiagnosticRedactor(homedir(), [ProductInfo.current.name]));
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (!SystemErrorCode.isAny(error, Resources.errorsCapSkippedCodes))
|
|
170
|
+
throw error;
|
|
171
|
+
if (!SystemErrorCode.is(error, Resources.missingFileErrorCode))
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
await rename(started.startLog, directory.runtimeErrorsLog);
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
if (!SystemErrorCode.isAny(error, Resources.startLogKeptCodes))
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
async describeExitAsync(started) {
|
|
183
|
+
const text = await readFile(started.startLog, Resources.utf8Encoding);
|
|
184
|
+
await rm(started.startLog, { force: true });
|
|
185
|
+
await this.requireNoUpdateAsync().catch((error) => {
|
|
186
|
+
if (error instanceof UpdateInProgressException)
|
|
187
|
+
throw error;
|
|
188
|
+
});
|
|
189
|
+
const reason = new DiagnosticRedactor(homedir(), [ProductInfo.current.name]).redact(text.slice(-Resources.startLogTailLength).trim());
|
|
190
|
+
return String.isNullOrWhitespace(reason) ? new RuntimeExitedWithoutReasonException() : new RuntimeExitedException(reason);
|
|
191
|
+
}
|
|
192
|
+
async tryConnectAsync(discovery, clientName, listener) {
|
|
193
|
+
try {
|
|
194
|
+
return await RuntimeClient.connectAsync(Endpoint.parse(discovery.endpoint), discovery.token, this.identity, clientName, listener, this.settings.clientSettings);
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
if (error instanceof ConnectionException && Object.isNull(error.failure))
|
|
198
|
+
return null;
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async isRepublishedAsync(error, discovery) {
|
|
203
|
+
return error instanceof ConnectionException && error.failure?.code === FailureCode.Unauthorized &&
|
|
204
|
+
(await DiscoveryReader.readAsync(this.settings.dataDirectory))?.token !== discovery.token;
|
|
205
|
+
}
|
|
206
|
+
async resolveOtherBuildAsync(client, handover, policy, takeOver, watch) {
|
|
207
|
+
if (BuildComparer.compare(this.identity, handover.identity) === BuildRelation.Older) {
|
|
208
|
+
client.close();
|
|
209
|
+
throw new RuntimeHandoverException(handover);
|
|
210
|
+
}
|
|
211
|
+
if (!takeOver) {
|
|
212
|
+
client.close();
|
|
213
|
+
throw new BuildMismatchException(handover);
|
|
214
|
+
}
|
|
215
|
+
const response = await client.stopAsync(policy).finally(() => client.close());
|
|
216
|
+
const failure = response.failure;
|
|
217
|
+
if (!Object.isUndefined(failure)) {
|
|
218
|
+
if (failure.code === FailureCode.Conflict && !Object.isUndefined(failure.details))
|
|
219
|
+
throw new WorkInProgressException(RunningWork.fromJson(failure.details));
|
|
220
|
+
throw new StopRefusedException(failure);
|
|
221
|
+
}
|
|
222
|
+
const deadline = Date.now() + this.settings.stopTimeout;
|
|
223
|
+
while (OwnershipLock.isOwned(this.settings.dataDirectory)) {
|
|
224
|
+
if (Date.now() >= deadline)
|
|
225
|
+
throw new StopTimedOutException();
|
|
226
|
+
await watch.waitAsync(deadline - Date.now(), () => !OwnershipLock.isOwned(this.settings.dataDirectory));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async requireNoUpdateAsync() {
|
|
230
|
+
const status = await this.installation.checkAsync(this.identity.productVersion);
|
|
231
|
+
if (status !== UpdateBarrierStatus.None)
|
|
232
|
+
throw new UpdateInProgressException(status);
|
|
233
|
+
}
|
|
234
|
+
async startAsync() {
|
|
235
|
+
const directory = this.settings.dataDirectory;
|
|
236
|
+
const unique = randomUUID();
|
|
237
|
+
const startLogName = Resources.formatStartLogName(unique);
|
|
238
|
+
const launchArguments = [
|
|
239
|
+
this.settings.entryPath,
|
|
240
|
+
Resources.dataDirectoryArgument,
|
|
241
|
+
directory.root,
|
|
242
|
+
Resources.idleGraceArgument,
|
|
243
|
+
String(this.settings.idleGraceMilliseconds),
|
|
244
|
+
Resources.startLogArgument,
|
|
245
|
+
startLogName,
|
|
246
|
+
Resources.installationArgument,
|
|
247
|
+
this.installation.folder
|
|
248
|
+
];
|
|
249
|
+
const source = this.settings.platform === Resources.linuxPlatform ? AppImageSource.find(this.settings.environment, this.settings.executablePath) : null;
|
|
250
|
+
await mkdir(directory.logsFolder, { recursive: true });
|
|
251
|
+
const startLog = path.join(directory.logsFolder, startLogName);
|
|
252
|
+
const processId = await (Object.isNull(source)
|
|
253
|
+
? this.starter.startAsync(this.settings.executablePath, launchArguments, this.settings.environment, startLog)
|
|
254
|
+
: new AppImageCopyLaunch(this.starter, PosixProcessApi.create(), this.presence, AppImageKeepalive.open, AppImageExtraction.extractAsync, this.log)
|
|
255
|
+
.startAsync(source, this.settings.executablePath, launchArguments, this.settings.environment, startLog, path.join(directory.logsFolder, Resources.formatCopyRecordName(unique))));
|
|
256
|
+
return new StartedRuntime(processId, startLog);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=runtime-launcher.js.map
|