@noldova/desktop.runtime 0.0.0-stage → 0.0.1

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.
Files changed (893) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -2
  3. package/api/index.d.ts +16401 -0
  4. package/api/index.js +256 -0
  5. package/api/index.js.map +1 -0
  6. package/api/testing.d.ts +2128 -0
  7. package/api/testing.js +20 -0
  8. package/api/testing.js.map +1 -0
  9. package/enums/agent-control-failure.js +13 -0
  10. package/enums/agent-control-failure.js.map +1 -0
  11. package/enums/build-relation.js +14 -0
  12. package/enums/build-relation.js.map +1 -0
  13. package/enums/data-directory-state.js +14 -0
  14. package/enums/data-directory-state.js.map +1 -0
  15. package/enums/endpoint-kind.js +13 -0
  16. package/enums/endpoint-kind.js.map +1 -0
  17. package/enums/permission-decision.js +18 -0
  18. package/enums/permission-decision.js.map +1 -0
  19. package/enums/permission-detail-kind.js +15 -0
  20. package/enums/permission-detail-kind.js.map +1 -0
  21. package/enums/permission-option.js +16 -0
  22. package/enums/permission-option.js.map +1 -0
  23. package/enums/session-state.js +17 -0
  24. package/enums/session-state.js.map +1 -0
  25. package/enums/tool-abort-reason.js +16 -0
  26. package/enums/tool-abort-reason.js.map +1 -0
  27. package/enums/tool-content-kind.js +13 -0
  28. package/enums/tool-content-kind.js.map +1 -0
  29. package/enums/tool-failure-code.js +22 -0
  30. package/enums/tool-failure-code.js.map +1 -0
  31. package/enums/tool-risk.js +14 -0
  32. package/enums/tool-risk.js.map +1 -0
  33. package/enums/unknown-schema-failure.js +14 -0
  34. package/enums/unknown-schema-failure.js.map +1 -0
  35. package/enums/update-barrier-state.js +14 -0
  36. package/enums/update-barrier-state.js.map +1 -0
  37. package/enums/update-barrier-status.js +14 -0
  38. package/enums/update-barrier-status.js.map +1 -0
  39. package/enums/window-state-kind.js +13 -0
  40. package/enums/window-state-kind.js.map +1 -0
  41. package/exceptions/addon-incomplete.exception.js +17 -0
  42. package/exceptions/addon-incomplete.exception.js.map +1 -0
  43. package/exceptions/addon-load-failed.exception.js +17 -0
  44. package/exceptions/addon-load-failed.exception.js.map +1 -0
  45. package/exceptions/addon-load.exception.js +14 -0
  46. package/exceptions/addon-load.exception.js.map +1 -0
  47. package/exceptions/addon-missing.exception.js +19 -0
  48. package/exceptions/addon-missing.exception.js.map +1 -0
  49. package/exceptions/addon-unexpected-value.exception.js +17 -0
  50. package/exceptions/addon-unexpected-value.exception.js.map +1 -0
  51. package/exceptions/agent-control.exception.js +28 -0
  52. package/exceptions/agent-control.exception.js.map +1 -0
  53. package/exceptions/answerer-registered.exception.js +10 -0
  54. package/exceptions/answerer-registered.exception.js.map +1 -0
  55. package/exceptions/app-image-copy-unavailable.exception.js +17 -0
  56. package/exceptions/app-image-copy-unavailable.exception.js.map +1 -0
  57. package/exceptions/app-image-copy-unlisted.exception.js +17 -0
  58. package/exceptions/app-image-copy-unlisted.exception.js.map +1 -0
  59. package/exceptions/backup-verification.exception.js +15 -0
  60. package/exceptions/backup-verification.exception.js.map +1 -0
  61. package/exceptions/batch-argument-refused.exception.js +17 -0
  62. package/exceptions/batch-argument-refused.exception.js.map +1 -0
  63. package/exceptions/batch-system-root-missing.exception.js +15 -0
  64. package/exceptions/batch-system-root-missing.exception.js.map +1 -0
  65. package/exceptions/build-mismatch.exception.js +18 -0
  66. package/exceptions/build-mismatch.exception.js.map +1 -0
  67. package/exceptions/call-unanswered.exception.js +17 -0
  68. package/exceptions/call-unanswered.exception.js.map +1 -0
  69. package/exceptions/command-failed.exception.js +18 -0
  70. package/exceptions/command-failed.exception.js.map +1 -0
  71. package/exceptions/command-registered.exception.js +10 -0
  72. package/exceptions/command-registered.exception.js.map +1 -0
  73. package/exceptions/connection-closed.exception.js +16 -0
  74. package/exceptions/connection-closed.exception.js.map +1 -0
  75. package/exceptions/connection-refused.exception.js +14 -0
  76. package/exceptions/connection-refused.exception.js.map +1 -0
  77. package/exceptions/connection.exception.js +16 -0
  78. package/exceptions/connection.exception.js.map +1 -0
  79. package/exceptions/data-directory-owned.exception.js +18 -0
  80. package/exceptions/data-directory-owned.exception.js.map +1 -0
  81. package/exceptions/declaration-field-invalid.exception.js +10 -0
  82. package/exceptions/declaration-field-invalid.exception.js.map +1 -0
  83. package/exceptions/declaration-not-object.exception.js +8 -0
  84. package/exceptions/declaration-not-object.exception.js.map +1 -0
  85. package/exceptions/declarations-format.exception.js +14 -0
  86. package/exceptions/declarations-format.exception.js.map +1 -0
  87. package/exceptions/declarations-unreadable.exception.js +18 -0
  88. package/exceptions/declarations-unreadable.exception.js.map +1 -0
  89. package/exceptions/declarations-version-unsupported.exception.js +10 -0
  90. package/exceptions/declarations-version-unsupported.exception.js.map +1 -0
  91. package/exceptions/discovery-field-invalid.exception.js +10 -0
  92. package/exceptions/discovery-field-invalid.exception.js.map +1 -0
  93. package/exceptions/discovery-format.exception.js +14 -0
  94. package/exceptions/discovery-format.exception.js.map +1 -0
  95. package/exceptions/discovery-not-object.exception.js +8 -0
  96. package/exceptions/discovery-not-object.exception.js.map +1 -0
  97. package/exceptions/discovery-unreadable.exception.js +18 -0
  98. package/exceptions/discovery-unreadable.exception.js.map +1 -0
  99. package/exceptions/discovery-version-unsupported.exception.js +10 -0
  100. package/exceptions/discovery-version-unsupported.exception.js.map +1 -0
  101. package/exceptions/endpoint-unavailable.exception.js +15 -0
  102. package/exceptions/endpoint-unavailable.exception.js.map +1 -0
  103. package/exceptions/environment-unreadable.exception.js +15 -0
  104. package/exceptions/environment-unreadable.exception.js.map +1 -0
  105. package/exceptions/event-declared.exception.js +10 -0
  106. package/exceptions/event-declared.exception.js.map +1 -0
  107. package/exceptions/event-withdrawn.exception.js +10 -0
  108. package/exceptions/event-withdrawn.exception.js.map +1 -0
  109. package/exceptions/exit-code-unreadable.exception.js +17 -0
  110. package/exceptions/exit-code-unreadable.exception.js.map +1 -0
  111. package/exceptions/exit-wait-timed-out.exception.js +19 -0
  112. package/exceptions/exit-wait-timed-out.exception.js.map +1 -0
  113. package/exceptions/folder-not-private.exception.js +19 -0
  114. package/exceptions/folder-not-private.exception.js.map +1 -0
  115. package/exceptions/foreground-group-read-failed.exception.js +18 -0
  116. package/exceptions/foreground-group-read-failed.exception.js.map +1 -0
  117. package/exceptions/foreground-group-unreadable.exception.js +19 -0
  118. package/exceptions/foreground-group-unreadable.exception.js.map +1 -0
  119. package/exceptions/handshake-closed.exception.js +15 -0
  120. package/exceptions/handshake-closed.exception.js.map +1 -0
  121. package/exceptions/handshake-identity-mismatch.exception.js +15 -0
  122. package/exceptions/handshake-identity-mismatch.exception.js.map +1 -0
  123. package/exceptions/handshake-timed-out.exception.js +15 -0
  124. package/exceptions/handshake-timed-out.exception.js.map +1 -0
  125. package/exceptions/job-assignment-failed.exception.js +19 -0
  126. package/exceptions/job-assignment-failed.exception.js.map +1 -0
  127. package/exceptions/job-closed-before-exit.exception.js +17 -0
  128. package/exceptions/job-closed-before-exit.exception.js.map +1 -0
  129. package/exceptions/launch-descriptors-unavailable.exception.js +15 -0
  130. package/exceptions/launch-descriptors-unavailable.exception.js.map +1 -0
  131. package/exceptions/launch-limit-reached.exception.js +17 -0
  132. package/exceptions/launch-limit-reached.exception.js.map +1 -0
  133. package/exceptions/launch-shell-unavailable.exception.js +15 -0
  134. package/exceptions/launch-shell-unavailable.exception.js.map +1 -0
  135. package/exceptions/launch-start-failed.exception.js +17 -0
  136. package/exceptions/launch-start-failed.exception.js.map +1 -0
  137. package/exceptions/launch-timed-out.exception.js +15 -0
  138. package/exceptions/launch-timed-out.exception.js.map +1 -0
  139. package/exceptions/launch.exception.js +14 -0
  140. package/exceptions/launch.exception.js.map +1 -0
  141. package/exceptions/main-process-refused-again.exception.js +15 -0
  142. package/exceptions/main-process-refused-again.exception.js.map +1 -0
  143. package/exceptions/method-failure.exception.js +16 -0
  144. package/exceptions/method-failure.exception.js.map +1 -0
  145. package/exceptions/method-registered.exception.js +10 -0
  146. package/exceptions/method-registered.exception.js.map +1 -0
  147. package/exceptions/migration.exception.js +17 -0
  148. package/exceptions/migration.exception.js.map +1 -0
  149. package/exceptions/module-activation.exception.js +17 -0
  150. package/exceptions/module-activation.exception.js.map +1 -0
  151. package/exceptions/module-database.exception.js +17 -0
  152. package/exceptions/module-database.exception.js.map +1 -0
  153. package/exceptions/module-id-device.exception.js +10 -0
  154. package/exceptions/module-id-device.exception.js.map +1 -0
  155. package/exceptions/module-load.exception.js +15 -0
  156. package/exceptions/module-load.exception.js.map +1 -0
  157. package/exceptions/module-stopping.exception.js +19 -0
  158. package/exceptions/module-stopping.exception.js.map +1 -0
  159. package/exceptions/move-aside-refused.exception.js +17 -0
  160. package/exceptions/move-aside-refused.exception.js.map +1 -0
  161. package/exceptions/no-job-for-exit-code.exception.js +17 -0
  162. package/exceptions/no-job-for-exit-code.exception.js.map +1 -0
  163. package/exceptions/no-runtime.exception.js +17 -0
  164. package/exceptions/no-runtime.exception.js.map +1 -0
  165. package/exceptions/not-contributed.exception.js +14 -0
  166. package/exceptions/not-contributed.exception.js.map +1 -0
  167. package/exceptions/notification-command-not-allowed.exception.js +12 -0
  168. package/exceptions/notification-command-not-allowed.exception.js.map +1 -0
  169. package/exceptions/notification-kind-changed.exception.js +12 -0
  170. package/exceptions/notification-kind-changed.exception.js.map +1 -0
  171. package/exceptions/ownership-released.exception.js +15 -0
  172. package/exceptions/ownership-released.exception.js.map +1 -0
  173. package/exceptions/permission-access.exception.js +14 -0
  174. package/exceptions/permission-access.exception.js.map +1 -0
  175. package/exceptions/permissions-closed.exception.js +8 -0
  176. package/exceptions/permissions-closed.exception.js.map +1 -0
  177. package/exceptions/permissions-module-only.exception.js +10 -0
  178. package/exceptions/permissions-module-only.exception.js.map +1 -0
  179. package/exceptions/pre-shell-data-found.exception.js +18 -0
  180. package/exceptions/pre-shell-data-found.exception.js.map +1 -0
  181. package/exceptions/pre-shell-data.exception.js +19 -0
  182. package/exceptions/pre-shell-data.exception.js.map +1 -0
  183. package/exceptions/process-start-failed.exception.js +17 -0
  184. package/exceptions/process-start-failed.exception.js.map +1 -0
  185. package/exceptions/process-start.exception.js +14 -0
  186. package/exceptions/process-start.exception.js.map +1 -0
  187. package/exceptions/process-table-row-unreadable.exception.js +17 -0
  188. package/exceptions/process-table-row-unreadable.exception.js.map +1 -0
  189. package/exceptions/product-file.exception.js +18 -0
  190. package/exceptions/product-file.exception.js.map +1 -0
  191. package/exceptions/program-not-found.exception.js +17 -0
  192. package/exceptions/program-not-found.exception.js.map +1 -0
  193. package/exceptions/program-path-relative.exception.js +17 -0
  194. package/exceptions/program-path-relative.exception.js.map +1 -0
  195. package/exceptions/pseudo-terminal-batch-refused.exception.js +17 -0
  196. package/exceptions/pseudo-terminal-batch-refused.exception.js.map +1 -0
  197. package/exceptions/pseudo-terminal-command-line-batch-refused.exception.js +17 -0
  198. package/exceptions/pseudo-terminal-command-line-batch-refused.exception.js.map +1 -0
  199. package/exceptions/pseudo-terminal-command-line-refused.exception.js +17 -0
  200. package/exceptions/pseudo-terminal-command-line-refused.exception.js.map +1 -0
  201. package/exceptions/pseudo-terminal-command-line-with-arguments.exception.js +17 -0
  202. package/exceptions/pseudo-terminal-command-line-with-arguments.exception.js.map +1 -0
  203. package/exceptions/pseudo-terminals-undeclared.exception.js +19 -0
  204. package/exceptions/pseudo-terminals-undeclared.exception.js.map +1 -0
  205. package/exceptions/registration.exception.js +14 -0
  206. package/exceptions/registration.exception.js.map +1 -0
  207. package/exceptions/runtime-exited-without-reason.exception.js +15 -0
  208. package/exceptions/runtime-exited-without-reason.exception.js.map +1 -0
  209. package/exceptions/runtime-exited.exception.js +17 -0
  210. package/exceptions/runtime-exited.exception.js.map +1 -0
  211. package/exceptions/runtime-handover.exception.js +18 -0
  212. package/exceptions/runtime-handover.exception.js.map +1 -0
  213. package/exceptions/runtime-unreachable.exception.js +17 -0
  214. package/exceptions/runtime-unreachable.exception.js.map +1 -0
  215. package/exceptions/runtime.exception.js +14 -0
  216. package/exceptions/runtime.exception.js.map +1 -0
  217. package/exceptions/secret-not-owned.exception.js +12 -0
  218. package/exceptions/secret-not-owned.exception.js.map +1 -0
  219. package/exceptions/service-access.exception.js +14 -0
  220. package/exceptions/service-access.exception.js.map +1 -0
  221. package/exceptions/service-missing.exception.js +10 -0
  222. package/exceptions/service-missing.exception.js.map +1 -0
  223. package/exceptions/service-not-allowed.exception.js +12 -0
  224. package/exceptions/service-not-allowed.exception.js.map +1 -0
  225. package/exceptions/service-not-owned.exception.js +12 -0
  226. package/exceptions/service-not-owned.exception.js.map +1 -0
  227. package/exceptions/service-published.exception.js +10 -0
  228. package/exceptions/service-published.exception.js.map +1 -0
  229. package/exceptions/service-type-mismatch.exception.js +12 -0
  230. package/exceptions/service-type-mismatch.exception.js.map +1 -0
  231. package/exceptions/setting-needs-device.exception.js +11 -0
  232. package/exceptions/setting-needs-device.exception.js.map +1 -0
  233. package/exceptions/setting-not-readable.exception.js +12 -0
  234. package/exceptions/setting-not-readable.exception.js.map +1 -0
  235. package/exceptions/setting-not-writable.exception.js +12 -0
  236. package/exceptions/setting-not-writable.exception.js.map +1 -0
  237. package/exceptions/setting-scope-not-allowed.exception.js +13 -0
  238. package/exceptions/setting-scope-not-allowed.exception.js.map +1 -0
  239. package/exceptions/setting-scope-not-owned.exception.js +12 -0
  240. package/exceptions/setting-scope-not-owned.exception.js.map +1 -0
  241. package/exceptions/setting-unknown.exception.js +11 -0
  242. package/exceptions/setting-unknown.exception.js.map +1 -0
  243. package/exceptions/setting-value-invalid.exception.js +11 -0
  244. package/exceptions/setting-value-invalid.exception.js.map +1 -0
  245. package/exceptions/setting.exception.js +14 -0
  246. package/exceptions/setting.exception.js.map +1 -0
  247. package/exceptions/stop-refused.exception.js +17 -0
  248. package/exceptions/stop-refused.exception.js.map +1 -0
  249. package/exceptions/stop-timed-out.exception.js +15 -0
  250. package/exceptions/stop-timed-out.exception.js.map +1 -0
  251. package/exceptions/system-command.exception.js +14 -0
  252. package/exceptions/system-command.exception.js.map +1 -0
  253. package/exceptions/system-root-missing.exception.js +15 -0
  254. package/exceptions/system-root-missing.exception.js.map +1 -0
  255. package/exceptions/tool-endpoint.exception.js +15 -0
  256. package/exceptions/tool-endpoint.exception.js.map +1 -0
  257. package/exceptions/tool-failure.exception.js +16 -0
  258. package/exceptions/tool-failure.exception.js.map +1 -0
  259. package/exceptions/tool-registered.exception.js +10 -0
  260. package/exceptions/tool-registered.exception.js.map +1 -0
  261. package/exceptions/unknown-schema.exception.js +30 -0
  262. package/exceptions/unknown-schema.exception.js.map +1 -0
  263. package/exceptions/update-in-progress.exception.js +19 -0
  264. package/exceptions/update-in-progress.exception.js.map +1 -0
  265. package/exceptions/update-preparing.exception.js +19 -0
  266. package/exceptions/update-preparing.exception.js.map +1 -0
  267. package/exceptions/user-identity-unreadable.exception.js +17 -0
  268. package/exceptions/user-identity-unreadable.exception.js.map +1 -0
  269. package/exceptions/verbatim-batch-refused.exception.js +17 -0
  270. package/exceptions/verbatim-batch-refused.exception.js.map +1 -0
  271. package/exceptions/web-view-failure.exception.js +17 -0
  272. package/exceptions/web-view-failure.exception.js.map +1 -0
  273. package/exceptions/work-in-progress.exception.js +17 -0
  274. package/exceptions/work-in-progress.exception.js.map +1 -0
  275. package/interfaces/i-app-shortcuts.js +9 -0
  276. package/interfaces/i-app-shortcuts.js.map +1 -0
  277. package/interfaces/i-app-windows.js +9 -0
  278. package/interfaces/i-app-windows.js.map +1 -0
  279. package/interfaces/i-environment-source.js +9 -0
  280. package/interfaces/i-environment-source.js.map +1 -0
  281. package/interfaces/i-event-sink.js +9 -0
  282. package/interfaces/i-event-sink.js.map +1 -0
  283. package/interfaces/i-file-share-options.js +9 -0
  284. package/interfaces/i-file-share-options.js.map +1 -0
  285. package/interfaces/i-folder-protector.js +9 -0
  286. package/interfaces/i-folder-protector.js.map +1 -0
  287. package/interfaces/i-idle-participant.js +9 -0
  288. package/interfaces/i-idle-participant.js.map +1 -0
  289. package/interfaces/i-issued-grant.js +9 -0
  290. package/interfaces/i-issued-grant.js.map +1 -0
  291. package/interfaces/i-line-process-listener.js +9 -0
  292. package/interfaces/i-line-process-listener.js.map +1 -0
  293. package/interfaces/i-line-process-starter.js +9 -0
  294. package/interfaces/i-line-process-starter.js.map +1 -0
  295. package/interfaces/i-line-process.js +9 -0
  296. package/interfaces/i-line-process.js.map +1 -0
  297. package/interfaces/i-main-process-check.js +9 -0
  298. package/interfaces/i-main-process-check.js.map +1 -0
  299. package/interfaces/i-method-handler.js +9 -0
  300. package/interfaces/i-method-handler.js.map +1 -0
  301. package/interfaces/i-module-database.js +9 -0
  302. package/interfaces/i-module-database.js.map +1 -0
  303. package/interfaces/i-module-log.js +9 -0
  304. package/interfaces/i-module-log.js.map +1 -0
  305. package/interfaces/i-module-secrets.js +9 -0
  306. package/interfaces/i-module-secrets.js.map +1 -0
  307. package/interfaces/i-module-settings.js +9 -0
  308. package/interfaces/i-module-settings.js.map +1 -0
  309. package/interfaces/i-peer-process-api.js +9 -0
  310. package/interfaces/i-peer-process-api.js.map +1 -0
  311. package/interfaces/i-permission-answerer.js +9 -0
  312. package/interfaces/i-permission-answerer.js.map +1 -0
  313. package/interfaces/i-permission-detail.js +9 -0
  314. package/interfaces/i-permission-detail.js.map +1 -0
  315. package/interfaces/i-permission-request.js +9 -0
  316. package/interfaces/i-permission-request.js.map +1 -0
  317. package/interfaces/i-permissions-context.js +9 -0
  318. package/interfaces/i-permissions-context.js.map +1 -0
  319. package/interfaces/i-posix-process-addon.js +9 -0
  320. package/interfaces/i-posix-process-addon.js.map +1 -0
  321. package/interfaces/i-posix-process-api.js +9 -0
  322. package/interfaces/i-posix-process-api.js.map +1 -0
  323. package/interfaces/i-posix-process-table-api.js +9 -0
  324. package/interfaces/i-posix-process-table-api.js.map +1 -0
  325. package/interfaces/i-process-ender.js +9 -0
  326. package/interfaces/i-process-ender.js.map +1 -0
  327. package/interfaces/i-process-starter.js +9 -0
  328. package/interfaces/i-process-starter.js.map +1 -0
  329. package/interfaces/i-process-table.reader.js +9 -0
  330. package/interfaces/i-process-table.reader.js.map +1 -0
  331. package/interfaces/i-profile-watch.js +9 -0
  332. package/interfaces/i-profile-watch.js.map +1 -0
  333. package/interfaces/i-pseudo-terminal-exit.js +9 -0
  334. package/interfaces/i-pseudo-terminal-exit.js.map +1 -0
  335. package/interfaces/i-pseudo-terminal-handle.js +9 -0
  336. package/interfaces/i-pseudo-terminal-handle.js.map +1 -0
  337. package/interfaces/i-pseudo-terminal-library.js +9 -0
  338. package/interfaces/i-pseudo-terminal-library.js.map +1 -0
  339. package/interfaces/i-pseudo-terminal-options.js +9 -0
  340. package/interfaces/i-pseudo-terminal-options.js.map +1 -0
  341. package/interfaces/i-pseudo-terminal-start-options.js +9 -0
  342. package/interfaces/i-pseudo-terminal-start-options.js.map +1 -0
  343. package/interfaces/i-pseudo-terminal-subscription.js +9 -0
  344. package/interfaces/i-pseudo-terminal-subscription.js.map +1 -0
  345. package/interfaces/i-resolved-file.js +9 -0
  346. package/interfaces/i-resolved-file.js.map +1 -0
  347. package/interfaces/i-runtime-client-listener.js +9 -0
  348. package/interfaces/i-runtime-client-listener.js.map +1 -0
  349. package/interfaces/i-runtime-discovery-json.js +9 -0
  350. package/interfaces/i-runtime-discovery-json.js.map +1 -0
  351. package/interfaces/i-runtime-files.js +9 -0
  352. package/interfaces/i-runtime-files.js.map +1 -0
  353. package/interfaces/i-runtime-part-context.js +9 -0
  354. package/interfaces/i-runtime-part-context.js.map +1 -0
  355. package/interfaces/i-runtime-part-loader.js +9 -0
  356. package/interfaces/i-runtime-part-loader.js.map +1 -0
  357. package/interfaces/i-runtime-part.js +9 -0
  358. package/interfaces/i-runtime-part.js.map +1 -0
  359. package/interfaces/i-runtime-web-views.js +9 -0
  360. package/interfaces/i-runtime-web-views.js.map +1 -0
  361. package/interfaces/i-secret-backend.js +9 -0
  362. package/interfaces/i-secret-backend.js.map +1 -0
  363. package/interfaces/i-session-listener.js +9 -0
  364. package/interfaces/i-session-listener.js.map +1 -0
  365. package/interfaces/i-tool-call-options.js +9 -0
  366. package/interfaces/i-tool-call-options.js.map +1 -0
  367. package/interfaces/i-tool-call-permissions.js +9 -0
  368. package/interfaces/i-tool-call-permissions.js.map +1 -0
  369. package/interfaces/i-tool-deadline.js +9 -0
  370. package/interfaces/i-tool-deadline.js.map +1 -0
  371. package/interfaces/i-tool-descriptor.js +9 -0
  372. package/interfaces/i-tool-descriptor.js.map +1 -0
  373. package/interfaces/i-tool-endpoint-handler.js +9 -0
  374. package/interfaces/i-tool-endpoint-handler.js.map +1 -0
  375. package/interfaces/i-tool-endpoint.js +9 -0
  376. package/interfaces/i-tool-endpoint.js.map +1 -0
  377. package/interfaces/i-tool-handler.js +9 -0
  378. package/interfaces/i-tool-handler.js.map +1 -0
  379. package/interfaces/i-tool-hints.js +9 -0
  380. package/interfaces/i-tool-hints.js.map +1 -0
  381. package/interfaces/i-tool-limits.js +9 -0
  382. package/interfaces/i-tool-limits.js.map +1 -0
  383. package/interfaces/i-tool-risk-range.js +9 -0
  384. package/interfaces/i-tool-risk-range.js.map +1 -0
  385. package/interfaces/i-tool-schema.validator.js +2 -0
  386. package/interfaces/i-tool-schema.validator.js.map +1 -0
  387. package/interfaces/i-tool-session-host.js +9 -0
  388. package/interfaces/i-tool-session-host.js.map +1 -0
  389. package/interfaces/i-tools-context.js +9 -0
  390. package/interfaces/i-tools-context.js.map +1 -0
  391. package/interfaces/i-web-view-relay.js +9 -0
  392. package/interfaces/i-web-view-relay.js.map +1 -0
  393. package/interfaces/i-windows-peer-addon.js +9 -0
  394. package/interfaces/i-windows-peer-addon.js.map +1 -0
  395. package/interfaces/i-windows-process-addon.js +9 -0
  396. package/interfaces/i-windows-process-addon.js.map +1 -0
  397. package/interfaces/i-windows-process-api.js +9 -0
  398. package/interfaces/i-windows-process-api.js.map +1 -0
  399. package/interfaces/i-windows-signature.js +9 -0
  400. package/interfaces/i-windows-signature.js.map +1 -0
  401. package/models/app-image-copy-record.js +49 -0
  402. package/models/app-image-copy-record.js.map +1 -0
  403. package/models/app-image-source.js +48 -0
  404. package/models/app-image-source.js.map +1 -0
  405. package/models/attach-options.js +16 -0
  406. package/models/attach-options.js.map +1 -0
  407. package/models/capability-token.js +29 -0
  408. package/models/capability-token.js.map +1 -0
  409. package/models/caught-failure.js +15 -0
  410. package/models/caught-failure.js.map +1 -0
  411. package/models/client-closure.js +16 -0
  412. package/models/client-closure.js.map +1 -0
  413. package/models/client-settings.js +26 -0
  414. package/models/client-settings.js.map +1 -0
  415. package/models/connected-client.js +16 -0
  416. package/models/connected-client.js.map +1 -0
  417. package/models/data-directory-inspection.js +16 -0
  418. package/models/data-directory-inspection.js.map +1 -0
  419. package/models/endpoint.js +46 -0
  420. package/models/endpoint.js.map +1 -0
  421. package/models/event-channel.js +25 -0
  422. package/models/event-channel.js.map +1 -0
  423. package/models/granted-file.js +41 -0
  424. package/models/granted-file.js.map +1 -0
  425. package/models/image-size.js +22 -0
  426. package/models/image-size.js.map +1 -0
  427. package/models/kept-program.js +16 -0
  428. package/models/kept-program.js.map +1 -0
  429. package/models/launch-settings.js +44 -0
  430. package/models/launch-settings.js.map +1 -0
  431. package/models/migration.js +22 -0
  432. package/models/migration.js.map +1 -0
  433. package/models/module-activation.js +23 -0
  434. package/models/module-activation.js.map +1 -0
  435. package/models/module-declaration.js +203 -0
  436. package/models/module-declaration.js.map +1 -0
  437. package/models/notification-handle.js +24 -0
  438. package/models/notification-handle.js.map +1 -0
  439. package/models/owned-process.js +42 -0
  440. package/models/owned-process.js.map +1 -0
  441. package/models/packaged-path.js +14 -0
  442. package/models/packaged-path.js.map +1 -0
  443. package/models/peer-process.js +18 -0
  444. package/models/peer-process.js.map +1 -0
  445. package/models/pending-call.js +28 -0
  446. package/models/pending-call.js.map +1 -0
  447. package/models/permission-outcome.js +22 -0
  448. package/models/permission-outcome.js.map +1 -0
  449. package/models/permission-question.js +23 -0
  450. package/models/permission-question.js.map +1 -0
  451. package/models/permission-record.js +23 -0
  452. package/models/permission-record.js.map +1 -0
  453. package/models/permission-revocation.js +18 -0
  454. package/models/permission-revocation.js.map +1 -0
  455. package/models/process-ending.js +24 -0
  456. package/models/process-ending.js.map +1 -0
  457. package/models/process-exit.js +24 -0
  458. package/models/process-exit.js.map +1 -0
  459. package/models/process-killing.js +20 -0
  460. package/models/process-killing.js.map +1 -0
  461. package/models/process-launch-command.js +46 -0
  462. package/models/process-launch-command.js.map +1 -0
  463. package/models/process-launch.js +21 -0
  464. package/models/process-launch.js.map +1 -0
  465. package/models/process-record.js +41 -0
  466. package/models/process-record.js.map +1 -0
  467. package/models/process-request.js +40 -0
  468. package/models/process-request.js.map +1 -0
  469. package/models/process-settings.js +31 -0
  470. package/models/process-settings.js.map +1 -0
  471. package/models/process-table-entry.js +30 -0
  472. package/models/process-table-entry.js.map +1 -0
  473. package/models/process-table.js +55 -0
  474. package/models/process-table.js.map +1 -0
  475. package/models/product-info.js +68 -0
  476. package/models/product-info.js.map +1 -0
  477. package/models/pseudo-terminal-console.js +41 -0
  478. package/models/pseudo-terminal-console.js.map +1 -0
  479. package/models/pseudo-terminal-exit.js +24 -0
  480. package/models/pseudo-terminal-exit.js.map +1 -0
  481. package/models/pseudo-terminal-request.js +44 -0
  482. package/models/pseudo-terminal-request.js.map +1 -0
  483. package/models/pseudo-terminal.js +104 -0
  484. package/models/pseudo-terminal.js.map +1 -0
  485. package/models/refusal.js +16 -0
  486. package/models/refusal.js.map +1 -0
  487. package/models/registered-tool.js +22 -0
  488. package/models/registered-tool.js.map +1 -0
  489. package/models/registration.js +17 -0
  490. package/models/registration.js.map +1 -0
  491. package/models/remembered-permission.js +26 -0
  492. package/models/remembered-permission.js.map +1 -0
  493. package/models/request-context.js +27 -0
  494. package/models/request-context.js.map +1 -0
  495. package/models/running-process.js +25 -0
  496. package/models/running-process.js.map +1 -0
  497. package/models/running-program.js +26 -0
  498. package/models/running-program.js.map +1 -0
  499. package/models/running-tool-call.js +111 -0
  500. package/models/running-tool-call.js.map +1 -0
  501. package/models/runtime-build.js +17 -0
  502. package/models/runtime-build.js.map +1 -0
  503. package/models/runtime-command.js +39 -0
  504. package/models/runtime-command.js.map +1 -0
  505. package/models/runtime-discovery.js +85 -0
  506. package/models/runtime-discovery.js.map +1 -0
  507. package/models/runtime-options.js +63 -0
  508. package/models/runtime-options.js.map +1 -0
  509. package/models/server-settings.js +34 -0
  510. package/models/server-settings.js.map +1 -0
  511. package/models/started-runtime.js +29 -0
  512. package/models/started-runtime.js.map +1 -0
  513. package/models/system-error-code.js +29 -0
  514. package/models/system-error-code.js.map +1 -0
  515. package/models/terminal-size.js +19 -0
  516. package/models/terminal-size.js.map +1 -0
  517. package/models/tool-call.js +65 -0
  518. package/models/tool-call.js.map +1 -0
  519. package/models/tool-content.js +44 -0
  520. package/models/tool-content.js.map +1 -0
  521. package/models/tool-descriptor.js +104 -0
  522. package/models/tool-descriptor.js.map +1 -0
  523. package/models/tool-failure.js +39 -0
  524. package/models/tool-failure.js.map +1 -0
  525. package/models/tool-result.js +22 -0
  526. package/models/tool-result.js.map +1 -0
  527. package/models/tool-session.js +29 -0
  528. package/models/tool-session.js.map +1 -0
  529. package/models/tool-turns.js +31 -0
  530. package/models/tool-turns.js.map +1 -0
  531. package/models/update-barrier.js +39 -0
  532. package/models/update-barrier.js.map +1 -0
  533. package/models/watched-pseudo-terminal-handle.js +118 -0
  534. package/models/watched-pseudo-terminal-handle.js.map +1 -0
  535. package/models/web-view-protocol-event.js +20 -0
  536. package/models/web-view-protocol-event.js.map +1 -0
  537. package/models/windows-device-names.js +15 -0
  538. package/models/windows-device-names.js.map +1 -0
  539. package/models/work-item.js +29 -0
  540. package/models/work-item.js.map +1 -0
  541. package/native/darwin-arm64/posix-process.node +0 -0
  542. package/native/darwin-x64/posix-process.node +0 -0
  543. package/native/linux-arm64/posix-process.node +0 -0
  544. package/native/linux-x64/posix-process.node +0 -0
  545. package/native/win32-arm64/windows-process.node +0 -0
  546. package/native/win32-x64/windows-process.node +0 -0
  547. package/package.json +53 -3
  548. package/resources.js +1784 -0
  549. package/resources.js.map +1 -0
  550. package/services/app-surface/app-shortcuts-changed-method.js +24 -0
  551. package/services/app-surface/app-shortcuts-changed-method.js.map +1 -0
  552. package/services/app-surface/app-surface.js +57 -0
  553. package/services/app-surface/app-surface.js.map +1 -0
  554. package/services/app-surface/app-windows-changed-method.js +24 -0
  555. package/services/app-surface/app-windows-changed-method.js.map +1 -0
  556. package/services/app-surface/main-window-changed-method.js +24 -0
  557. package/services/app-surface/main-window-changed-method.js.map +1 -0
  558. package/services/app-surface/main-window-method.js +10 -0
  559. package/services/app-surface/main-window-method.js.map +1 -0
  560. package/services/app-surface/module-app-shortcuts.js +27 -0
  561. package/services/app-surface/module-app-shortcuts.js.map +1 -0
  562. package/services/app-surface/module-app-windows.js +24 -0
  563. package/services/app-surface/module-app-windows.js.map +1 -0
  564. package/services/app-surface/reported-list.js +61 -0
  565. package/services/app-surface/reported-list.js.map +1 -0
  566. package/services/client/app-image-copy-launch.js +187 -0
  567. package/services/client/app-image-copy-launch.js.map +1 -0
  568. package/services/client/app-image-extraction.js +39 -0
  569. package/services/client/app-image-extraction.js.map +1 -0
  570. package/services/client/app-image-keepalive.js +63 -0
  571. package/services/client/app-image-keepalive.js.map +1 -0
  572. package/services/client/build-comparer.js +25 -0
  573. package/services/client/build-comparer.js.map +1 -0
  574. package/services/client/runtime-client.js +203 -0
  575. package/services/client/runtime-client.js.map +1 -0
  576. package/services/client/runtime-launcher.js +259 -0
  577. package/services/client/runtime-launcher.js.map +1 -0
  578. package/services/commands/shell-commands.js +18 -0
  579. package/services/commands/shell-commands.js.map +1 -0
  580. package/services/commands/system-command.js +31 -0
  581. package/services/commands/system-command.js.map +1 -0
  582. package/services/data-directory/data-directory-inspector.js +49 -0
  583. package/services/data-directory/data-directory-inspector.js.map +1 -0
  584. package/services/data-directory/data-directory-locator.js +25 -0
  585. package/services/data-directory/data-directory-locator.js.map +1 -0
  586. package/services/data-directory/data-directory.js +85 -0
  587. package/services/data-directory/data-directory.js.map +1 -0
  588. package/services/database/backup-guard.js +64 -0
  589. package/services/database/backup-guard.js.map +1 -0
  590. package/services/database/database-backup.js +122 -0
  591. package/services/database/database-backup.js.map +1 -0
  592. package/services/database/migrated-database.js +198 -0
  593. package/services/database/migrated-database.js.map +1 -0
  594. package/services/database/module-database.js +21 -0
  595. package/services/database/module-database.js.map +1 -0
  596. package/services/database/shell-database.js +25 -0
  597. package/services/database/shell-database.js.map +1 -0
  598. package/services/database/shell-migrations.js +22 -0
  599. package/services/database/shell-migrations.js.map +1 -0
  600. package/services/database/update-backup.js +57 -0
  601. package/services/database/update-backup.js.map +1 -0
  602. package/services/diagnostics/diagnostic-redactor.js +75 -0
  603. package/services/diagnostics/diagnostic-redactor.js.map +1 -0
  604. package/services/diagnostics/log-file.js +56 -0
  605. package/services/diagnostics/log-file.js.map +1 -0
  606. package/services/diagnostics/log-text.js +15 -0
  607. package/services/diagnostics/log-text.js.map +1 -0
  608. package/services/diagnostics/standard-error-cap.js +107 -0
  609. package/services/diagnostics/standard-error-cap.js.map +1 -0
  610. package/services/discovery/discovery-publisher.js +64 -0
  611. package/services/discovery/discovery-publisher.js.map +1 -0
  612. package/services/discovery/discovery.reader.js +44 -0
  613. package/services/discovery/discovery.reader.js.map +1 -0
  614. package/services/discovery/folder-protector-factory.js +19 -0
  615. package/services/discovery/folder-protector-factory.js.map +1 -0
  616. package/services/discovery/mac-folder-protector.js +37 -0
  617. package/services/discovery/mac-folder-protector.js.map +1 -0
  618. package/services/discovery/posix-folder-protector.js +15 -0
  619. package/services/discovery/posix-folder-protector.js.map +1 -0
  620. package/services/discovery/windows-folder-protector.js +57 -0
  621. package/services/discovery/windows-folder-protector.js.map +1 -0
  622. package/services/endpoint/client-closures.js +27 -0
  623. package/services/endpoint/client-closures.js.map +1 -0
  624. package/services/endpoint/client-session.js +120 -0
  625. package/services/endpoint/client-session.js.map +1 -0
  626. package/services/endpoint/main-process-check.js +48 -0
  627. package/services/endpoint/main-process-check.js.map +1 -0
  628. package/services/endpoint/runtime-server.js +355 -0
  629. package/services/endpoint/runtime-server.js.map +1 -0
  630. package/services/endpoint/window-closed-method.js +19 -0
  631. package/services/endpoint/window-closed-method.js.map +1 -0
  632. package/services/environment/current-environment.js +43 -0
  633. package/services/environment/current-environment.js.map +1 -0
  634. package/services/environment/line-process-starter.js +21 -0
  635. package/services/environment/line-process-starter.js.map +1 -0
  636. package/services/environment/line-process.js +83 -0
  637. package/services/environment/line-process.js.map +1 -0
  638. package/services/environment/login-shell-environment.js +162 -0
  639. package/services/environment/login-shell-environment.js.map +1 -0
  640. package/services/environment/profile-watch.js +247 -0
  641. package/services/environment/profile-watch.js.map +1 -0
  642. package/services/environment/windows-environment.js +181 -0
  643. package/services/environment/windows-environment.js.map +1 -0
  644. package/services/files/discard-file-grants-method.js +24 -0
  645. package/services/files/discard-file-grants-method.js.map +1 -0
  646. package/services/files/end-file-grants-method.js +25 -0
  647. package/services/files/end-file-grants-method.js.map +1 -0
  648. package/services/files/file-grant-table.js +154 -0
  649. package/services/files/file-grant-table.js.map +1 -0
  650. package/services/files/file-identity.js +14 -0
  651. package/services/files/file-identity.js.map +1 -0
  652. package/services/files/file-presence.js +26 -0
  653. package/services/files/file-presence.js.map +1 -0
  654. package/services/files/file-renamer.js +35 -0
  655. package/services/files/file-renamer.js.map +1 -0
  656. package/services/files/folder-watch.js +117 -0
  657. package/services/files/folder-watch.js.map +1 -0
  658. package/services/files/grant-file-method.js +24 -0
  659. package/services/files/grant-file-method.js.map +1 -0
  660. package/services/files/module-files.js +68 -0
  661. package/services/files/module-files.js.map +1 -0
  662. package/services/files/resolve-file-share-method.js +23 -0
  663. package/services/files/resolve-file-share-method.js.map +1 -0
  664. package/services/installation/device-folder.js +24 -0
  665. package/services/installation/device-folder.js.map +1 -0
  666. package/services/installation/installation.js +207 -0
  667. package/services/installation/installation.js.map +1 -0
  668. package/services/installation/process-presence.js +45 -0
  669. package/services/installation/process-presence.js.map +1 -0
  670. package/services/lifetime/app-image-copy-cleanup.js +78 -0
  671. package/services/lifetime/app-image-copy-cleanup.js.map +1 -0
  672. package/services/lifetime/idle-monitor.js +47 -0
  673. package/services/lifetime/idle-monitor.js.map +1 -0
  674. package/services/lifetime/move-aside-method.js +18 -0
  675. package/services/lifetime/move-aside-method.js.map +1 -0
  676. package/services/lifetime/quit-answered-method.js +19 -0
  677. package/services/lifetime/quit-answered-method.js.map +1 -0
  678. package/services/lifetime/quit-method.js +17 -0
  679. package/services/lifetime/quit-method.js.map +1 -0
  680. package/services/lifetime/quit-relay.js +91 -0
  681. package/services/lifetime/quit-relay.js.map +1 -0
  682. package/services/lifetime/runtime-host.js +405 -0
  683. package/services/lifetime/runtime-host.js.map +1 -0
  684. package/services/lifetime/runtime-log.js +74 -0
  685. package/services/lifetime/runtime-log.js.map +1 -0
  686. package/services/lifetime/stop-method.js +39 -0
  687. package/services/lifetime/stop-method.js.map +1 -0
  688. package/services/lifetime/update-method.js +24 -0
  689. package/services/lifetime/update-method.js.map +1 -0
  690. package/services/lifetime/update-preparation.js +167 -0
  691. package/services/lifetime/update-preparation.js.map +1 -0
  692. package/services/lifetime/update-saved-method.js +19 -0
  693. package/services/lifetime/update-saved-method.js.map +1 -0
  694. package/services/modules/commands-method.js +17 -0
  695. package/services/modules/commands-method.js.map +1 -0
  696. package/services/modules/dependency-states.js +33 -0
  697. package/services/modules/dependency-states.js.map +1 -0
  698. package/services/modules/module-context.js +206 -0
  699. package/services/modules/module-context.js.map +1 -0
  700. package/services/modules/module-declaration.reader.js +46 -0
  701. package/services/modules/module-declaration.reader.js.map +1 -0
  702. package/services/modules/module-host.js +287 -0
  703. package/services/modules/module-host.js.map +1 -0
  704. package/services/modules/module-log.js +25 -0
  705. package/services/modules/module-log.js.map +1 -0
  706. package/services/modules/modules-method.js +17 -0
  707. package/services/modules/modules-method.js.map +1 -0
  708. package/services/modules/package-runtime-part-loader.js +33 -0
  709. package/services/modules/package-runtime-part-loader.js.map +1 -0
  710. package/services/modules/run-command-method.js +28 -0
  711. package/services/modules/run-command-method.js.map +1 -0
  712. package/services/native/native-addon.js +65 -0
  713. package/services/native/native-addon.js.map +1 -0
  714. package/services/notifications/clear-notifications-method.js +18 -0
  715. package/services/notifications/clear-notifications-method.js.map +1 -0
  716. package/services/notifications/dismiss-notification-method.js +19 -0
  717. package/services/notifications/dismiss-notification-method.js.map +1 -0
  718. package/services/notifications/mark-notifications-read-method.js +18 -0
  719. package/services/notifications/mark-notifications-read-method.js.map +1 -0
  720. package/services/notifications/notification-center.js +87 -0
  721. package/services/notifications/notification-center.js.map +1 -0
  722. package/services/notifications/notification-policy.js +54 -0
  723. package/services/notifications/notification-policy.js.map +1 -0
  724. package/services/notifications/notification-settings.js +32 -0
  725. package/services/notifications/notification-settings.js.map +1 -0
  726. package/services/notifications/notifications-method.js +21 -0
  727. package/services/notifications/notifications-method.js.map +1 -0
  728. package/services/notifications/post-notification-method.js +26 -0
  729. package/services/notifications/post-notification-method.js.map +1 -0
  730. package/services/ownership/ownership-lock.js +73 -0
  731. package/services/ownership/ownership-lock.js.map +1 -0
  732. package/services/permissions/module-permissions.js +36 -0
  733. package/services/permissions/module-permissions.js.map +1 -0
  734. package/services/permissions/permission-center.js +172 -0
  735. package/services/permissions/permission-center.js.map +1 -0
  736. package/services/permissions/permission-request-checker.js +146 -0
  737. package/services/permissions/permission-request-checker.js.map +1 -0
  738. package/services/permissions/remembered-permission-store.js +52 -0
  739. package/services/permissions/remembered-permission-store.js.map +1 -0
  740. package/services/process/batch-command-line.js +32 -0
  741. package/services/process/batch-command-line.js.map +1 -0
  742. package/services/process/child-process-starter.js +68 -0
  743. package/services/process/child-process-starter.js.map +1 -0
  744. package/services/process/foreground-process-group.reader.js +64 -0
  745. package/services/process/foreground-process-group.reader.js.map +1 -0
  746. package/services/process/linux-process-folder.js +55 -0
  747. package/services/process/linux-process-folder.js.map +1 -0
  748. package/services/process/posix-peer-process-api.js +95 -0
  749. package/services/process/posix-peer-process-api.js.map +1 -0
  750. package/services/process/posix-process-api.js +50 -0
  751. package/services/process/posix-process-api.js.map +1 -0
  752. package/services/process/posix-process-ender.js +199 -0
  753. package/services/process/posix-process-ender.js.map +1 -0
  754. package/services/process/posix-process-table.reader.js +24 -0
  755. package/services/process/posix-process-table.reader.js.map +1 -0
  756. package/services/process/posix-responsibility-api.js +38 -0
  757. package/services/process/posix-responsibility-api.js.map +1 -0
  758. package/services/process/process-clock.js +38 -0
  759. package/services/process/process-clock.js.map +1 -0
  760. package/services/process/process-ender-factory.js +22 -0
  761. package/services/process/process-ender-factory.js.map +1 -0
  762. package/services/process/process-environment.js +53 -0
  763. package/services/process/process-environment.js.map +1 -0
  764. package/services/process/process-record-store.js +35 -0
  765. package/services/process/process-record-store.js.map +1 -0
  766. package/services/process/process-signals.js +56 -0
  767. package/services/process/process-signals.js.map +1 -0
  768. package/services/process/process-supervisor.js +489 -0
  769. package/services/process/process-supervisor.js.map +1 -0
  770. package/services/process/program-launch-resolver.js +88 -0
  771. package/services/process/program-launch-resolver.js.map +1 -0
  772. package/services/process/program-locator.js +95 -0
  773. package/services/process/program-locator.js.map +1 -0
  774. package/services/process/programs-method.js +17 -0
  775. package/services/process/programs-method.js.map +1 -0
  776. package/services/process/windows-peer-process-api.js +52 -0
  777. package/services/process/windows-peer-process-api.js.map +1 -0
  778. package/services/process/windows-process-api.js +69 -0
  779. package/services/process/windows-process-api.js.map +1 -0
  780. package/services/process/windows-process-ender.js +137 -0
  781. package/services/process/windows-process-ender.js.map +1 -0
  782. package/services/process/windows-process-job.js +63 -0
  783. package/services/process/windows-process-job.js.map +1 -0
  784. package/services/process/windows-process-killer.js +58 -0
  785. package/services/process/windows-process-killer.js.map +1 -0
  786. package/services/process/windows-process-table.reader.js +46 -0
  787. package/services/process/windows-process-table.reader.js.map +1 -0
  788. package/services/recent-commands/recent-commands-method.js +18 -0
  789. package/services/recent-commands/recent-commands-method.js.map +1 -0
  790. package/services/recent-commands/recent-commands-store.js +29 -0
  791. package/services/recent-commands/recent-commands-store.js.map +1 -0
  792. package/services/recent-commands/record-command-method.js +21 -0
  793. package/services/recent-commands/record-command-method.js.map +1 -0
  794. package/services/registry/command-registry.js +51 -0
  795. package/services/registry/command-registry.js.map +1 -0
  796. package/services/registry/event-registry.js +34 -0
  797. package/services/registry/event-registry.js.map +1 -0
  798. package/services/registry/method-registry.js +26 -0
  799. package/services/registry/method-registry.js.map +1 -0
  800. package/services/registry/service-registry.js +26 -0
  801. package/services/registry/service-registry.js.map +1 -0
  802. package/services/runtime-entry.js +87 -0
  803. package/services/runtime-entry.js.map +1 -0
  804. package/services/secrets/machine-secret-backend.js +121 -0
  805. package/services/secrets/machine-secret-backend.js.map +1 -0
  806. package/services/secrets/module-secrets.js +37 -0
  807. package/services/secrets/module-secrets.js.map +1 -0
  808. package/services/secrets/remove-secret-method.js +19 -0
  809. package/services/secrets/remove-secret-method.js.map +1 -0
  810. package/services/secrets/save-secret-method.js +20 -0
  811. package/services/secrets/save-secret-method.js.map +1 -0
  812. package/services/secrets/secret-answered-method.js +19 -0
  813. package/services/secrets/secret-answered-method.js.map +1 -0
  814. package/services/secrets/secret-status-method.js +18 -0
  815. package/services/secrets/secret-status-method.js.map +1 -0
  816. package/services/secrets/secret-table.js +26 -0
  817. package/services/secrets/secret-table.js.map +1 -0
  818. package/services/settings/module-settings.js +69 -0
  819. package/services/settings/module-settings.js.map +1 -0
  820. package/services/settings/setting-read-method.js +18 -0
  821. package/services/settings/setting-read-method.js.map +1 -0
  822. package/services/settings/setting-reset-method.js +20 -0
  823. package/services/settings/setting-reset-method.js.map +1 -0
  824. package/services/settings/setting-write-method.js +20 -0
  825. package/services/settings/setting-write-method.js.map +1 -0
  826. package/services/settings/settings-read-method.js +18 -0
  827. package/services/settings/settings-read-method.js.map +1 -0
  828. package/services/settings/settings.service.js +162 -0
  829. package/services/settings/settings.service.js.map +1 -0
  830. package/services/settings/shell-settings.js +78 -0
  831. package/services/settings/shell-settings.js.map +1 -0
  832. package/services/tools/agent-control.js +49 -0
  833. package/services/tools/agent-control.js.map +1 -0
  834. package/services/tools/image-size.reader.js +35 -0
  835. package/services/tools/image-size.reader.js.map +1 -0
  836. package/services/tools/image-size.resources.js +24 -0
  837. package/services/tools/image-size.resources.js.map +1 -0
  838. package/services/tools/module-tools.js +77 -0
  839. package/services/tools/module-tools.js.map +1 -0
  840. package/services/tools/tool-endpoint.js +131 -0
  841. package/services/tools/tool-endpoint.js.map +1 -0
  842. package/services/tools/tool-registry.js +386 -0
  843. package/services/tools/tool-registry.js.map +1 -0
  844. package/services/tools/tool-result.validator.js +93 -0
  845. package/services/tools/tool-result.validator.js.map +1 -0
  846. package/services/tools/tool-schema.resources.js +45 -0
  847. package/services/tools/tool-schema.resources.js.map +1 -0
  848. package/services/tools/tool-schema.validator.js +232 -0
  849. package/services/tools/tool-schema.validator.js.map +1 -0
  850. package/services/web-views/module-web-view-relay.js +33 -0
  851. package/services/web-views/module-web-view-relay.js.map +1 -0
  852. package/services/web-views/module-web-views.js +46 -0
  853. package/services/web-views/module-web-views.js.map +1 -0
  854. package/services/web-views/web-view-answered-method.js +19 -0
  855. package/services/web-views/web-view-answered-method.js.map +1 -0
  856. package/services/web-views/web-view-center.js +119 -0
  857. package/services/web-views/web-view-center.js.map +1 -0
  858. package/services/web-views/web-view-events-method.js +19 -0
  859. package/services/web-views/web-view-events-method.js.map +1 -0
  860. package/services/window-state/window-state-read-method.js +20 -0
  861. package/services/window-state/window-state-read-method.js.map +1 -0
  862. package/services/window-state/window-state-store.js +24 -0
  863. package/services/window-state/window-state-store.js.map +1 -0
  864. package/services/window-state/window-state-write-method.js +22 -0
  865. package/services/window-state/window-state-write-method.js.map +1 -0
  866. package/services/work/work-method.js +17 -0
  867. package/services/work/work-method.js.map +1 -0
  868. package/services/work/work-tracker.js +56 -0
  869. package/services/work/work-tracker.js.map +1 -0
  870. package/testing/models/fake-app-shortcuts.js +18 -0
  871. package/testing/models/fake-app-shortcuts.js.map +1 -0
  872. package/testing/models/fake-app-windows.js +17 -0
  873. package/testing/models/fake-app-windows.js.map +1 -0
  874. package/testing/models/fake-module-database.js +17 -0
  875. package/testing/models/fake-module-database.js.map +1 -0
  876. package/testing/models/fake-module-log.js +12 -0
  877. package/testing/models/fake-module-log.js.map +1 -0
  878. package/testing/models/fake-module-secrets.js +15 -0
  879. package/testing/models/fake-module-secrets.js.map +1 -0
  880. package/testing/models/fake-module-settings.js +23 -0
  881. package/testing/models/fake-module-settings.js.map +1 -0
  882. package/testing/models/fake-permissions-context.js +28 -0
  883. package/testing/models/fake-permissions-context.js.map +1 -0
  884. package/testing/models/fake-runtime-files.js +13 -0
  885. package/testing/models/fake-runtime-files.js.map +1 -0
  886. package/testing/models/fake-runtime-part-context.js +70 -0
  887. package/testing/models/fake-runtime-part-context.js.map +1 -0
  888. package/testing/models/fake-runtime-web-views.js +26 -0
  889. package/testing/models/fake-runtime-web-views.js.map +1 -0
  890. package/testing/models/fake-tools-context.js +72 -0
  891. package/testing/models/fake-tools-context.js.map +1 -0
  892. package/testing/models/fake-web-view-relay.js +17 -0
  893. 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,U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C,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5D,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAAC,IAAY;QAC7C,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;QAC3F,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACrF,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;YACxC,OAAO,WAAW,CAAC;QACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;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,i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KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7G,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAsB;QAChD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,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,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;QACxJ,MAAM,OAAO,CAAC,GAAG,CAAC,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M,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC;YACtH,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,MAAc;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC;QACd,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;QACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;gBACO,CAAC;YACP,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,47 @@
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 { 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.desktop.runtime/src/services/lifetime/idle-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,WAAW;IACL,iBAAiB,CAAS;IAC1B,WAAW,CAAmB;IACvC,KAAK,GAA0B,IAAI,CAAC;IACpC,UAAU,GAAY,KAAK,CAAC;IAEpC,YAAmB,iBAAyB,EAAE,WAA6B;QACzE,2BAA2B,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAE3G,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,KAAK;QACV,IAAI,IAAI,CAAC,UAAU;YACjB,OAAO;QACT,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM;YACzB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAEO,MAAM;QACZ,IAAI,MAAM,CAAC,MAAM,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;IACtB,QAAQ,CAAe;IACvB,KAAK,GAA0D,IAAI,GAAG,EAAE,CAAC;IACzE,qBAAqB,GAAgB,IAAI,GAAG,EAAE,CAAC;IACxD,aAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;IAEvD,YAAmB,MAAqB,EAAE,QAAsB;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,YAAY,CAAC,OAAuB;QACzC,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAA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