@adea-ai/app-framework 0.36.1 → 0.37.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 (175) hide show
  1. package/README.md +2 -0
  2. package/dist/appearance/appearance-host.js +2 -1
  3. package/dist/appearance/custom-theme-import.js +3 -1
  4. package/dist/appearance/custom-theme-library.d.ts +6 -185
  5. package/dist/appearance/custom-theme-library.js +3 -621
  6. package/dist/appearance/theme-library-mutation.d.ts +42 -0
  7. package/dist/appearance/theme-library-mutation.js +172 -0
  8. package/dist/appearance/theme-library-schema.d.ts +108 -0
  9. package/dist/appearance/theme-library-schema.js +189 -0
  10. package/dist/appearance/theme-library-store.d.ts +61 -0
  11. package/dist/appearance/theme-library-store.js +268 -0
  12. package/dist/appearance/theme-record-adapter.js +3 -1
  13. package/dist/appearance/theme-registry.js +2 -1
  14. package/dist/appearance/window-surface.d.ts +19 -0
  15. package/dist/appearance/window-surface.js +68 -1
  16. package/dist/cli/update-helper-cli.js +1 -1
  17. package/dist/cli/windows-installer-build-cli.d.ts +2 -0
  18. package/dist/cli/windows-installer-build-cli.js +14 -0
  19. package/dist/desktop/desktop-client.d.ts +1 -1
  20. package/dist/framework-source.json +1 -1
  21. package/dist/installer/installed-payload.js +2 -2
  22. package/dist/installer/{installer-archive.js → installer-archive-members.js} +2 -2
  23. package/dist/installer/installer-extraction.js +2 -2
  24. package/dist/installer/installer-fetch-guard.d.ts +1 -1
  25. package/dist/installer/installer-identity.js +2 -2
  26. package/dist/installer/installer-observation.d.ts +1 -1
  27. package/dist/installer/installer-observation.js +2 -2
  28. package/dist/installer/installer-upgrade-command.d.ts +2 -2
  29. package/dist/installer/installer-upgrade-command.js +5 -5
  30. package/dist/installer/linux-process-group.js +1 -1
  31. package/dist/installer/upgrade-asset-download.d.ts +1 -1
  32. package/dist/installer/upgrade-asset-download.js +2 -2
  33. package/dist/native/installer-archive.d.ts +42 -0
  34. package/dist/native/installer-archive.js +172 -0
  35. package/dist/native/posix-tree-removal.d.ts +1 -1
  36. package/dist/native/window-surface-store.d.ts +16 -0
  37. package/dist/native/window-surface-store.js +69 -0
  38. package/dist/native/windows-extractor-build.d.ts +95 -0
  39. package/dist/native/windows-extractor-build.js +326 -0
  40. package/dist/release/feed-release-cut.d.ts +1 -1
  41. package/dist/release/feed-state.d.ts +2 -2
  42. package/dist/release/feed-state.js +3 -3
  43. package/dist/release/github-release-cut.js +1 -1
  44. package/dist/release/github-release-promotion.js +1 -1
  45. package/dist/release/github-release-publisher.js +1 -1
  46. package/dist/release/github-release-qualification.js +1 -1
  47. package/dist/release/local-release.d.ts +2 -2
  48. package/dist/release/local-release.js +3 -3
  49. package/dist/release/release-artifact.d.ts +1 -1
  50. package/dist/release/release-artifact.js +2 -2
  51. package/dist/release/release-assets-plan.js +1 -1
  52. package/dist/release/release-config.d.ts +1 -1
  53. package/dist/release/release-config.js +1 -1
  54. package/dist/release/release-descriptor-staging.js +3 -3
  55. package/dist/release/release-finalize.js +1 -1
  56. package/dist/release/release-promotion.js +1 -1
  57. package/dist/release/release-publication.d.ts +1 -1
  58. package/dist/release/release-publication.js +2 -2
  59. package/dist/release/release-publish-command.js +2 -2
  60. package/dist/update-helper.bundle.js +18 -18
  61. package/dist/updates/channel-update-manager.d.ts +3 -3
  62. package/dist/updates/channel-update-manager.js +2 -2
  63. package/dist/updates/desktop-updater.d.ts +10 -83
  64. package/dist/updates/desktop-updater.js +14 -217
  65. package/dist/updates/{packaged-release-config.js → feed/packaged-release-config.js} +5 -5
  66. package/dist/updates/{release-feed.js → feed/release-feed.js} +2 -2
  67. package/dist/updates/{release-location.js → feed/release-location.js} +2 -2
  68. package/dist/updates/{release-version.js → feed/release-version.js} +1 -1
  69. package/dist/updates/{signed-release.js → feed/signed-release.js} +2 -2
  70. package/dist/updates/{update-discovery.js → feed/update-discovery.js} +1 -1
  71. package/dist/updates/helper/launch-gate-recovery.d.ts +8 -0
  72. package/dist/updates/{update-resume.js → helper/launch-gate-recovery.js} +13 -423
  73. package/dist/updates/helper/resume-staging.d.ts +22 -0
  74. package/dist/updates/helper/resume-staging.js +180 -0
  75. package/dist/updates/{update-helper.d.ts → helper/update-helper.d.ts} +1 -1
  76. package/dist/updates/{update-helper.js → helper/update-helper.js} +9 -9
  77. package/dist/updates/{update-resume.d.ts → helper/update-resume.d.ts} +4 -10
  78. package/dist/updates/helper/update-resume.js +252 -0
  79. package/dist/updates/{update-shutdown.js → helper/update-shutdown.js} +2 -2
  80. package/dist/updates/{update-arm.d.ts → install/update-arm.d.ts} +2 -2
  81. package/dist/updates/{update-arm.js → install/update-arm.js} +9 -9
  82. package/dist/updates/{update-download-cleanup.d.ts → install/update-download-cleanup.d.ts} +1 -1
  83. package/dist/updates/{update-download-cleanup.js → install/update-download-cleanup.js} +3 -3
  84. package/dist/updates/{update-download.d.ts → install/update-download.d.ts} +2 -2
  85. package/dist/updates/{update-download.js → install/update-download.js} +3 -3
  86. package/dist/updates/{update-extraction.d.ts → install/update-extraction.d.ts} +2 -2
  87. package/dist/updates/{update-extraction.js → install/update-extraction.js} +6 -6
  88. package/dist/updates/{update-handoff-plan.d.ts → install/update-handoff-plan.d.ts} +2 -2
  89. package/dist/updates/{update-handoff-plan.js → install/update-handoff-plan.js} +5 -5
  90. package/dist/updates/{update-marker.js → install/update-marker.js} +2 -2
  91. package/dist/updates/{update-swap-stage.d.ts → install/update-swap-stage.d.ts} +2 -2
  92. package/dist/updates/{update-swap-stage.js → install/update-swap-stage.js} +7 -6
  93. package/dist/updates/{update-swap.d.ts → install/update-swap.d.ts} +1 -1
  94. package/dist/updates/{update-swap.js → install/update-swap.js} +5 -5
  95. package/dist/updates/install-target.d.ts +8 -0
  96. package/dist/updates/install-target.js +27 -0
  97. package/dist/updates/{launch-environment.js → launch/launch-environment.js} +1 -1
  98. package/dist/updates/{packaged-launch-admission.js → launch/packaged-launch-admission.js} +4 -4
  99. package/dist/updates/{packaged-update-startup.d.ts → launch/packaged-update-startup.d.ts} +3 -3
  100. package/dist/updates/{packaged-update-startup.js → launch/packaged-update-startup.js} +10 -7
  101. package/dist/updates/{update-launch-gate.d.ts → launch/update-launch-gate.d.ts} +1 -1
  102. package/dist/updates/{update-launch-gate.js → launch/update-launch-gate.js} +9 -9
  103. package/dist/updates/{update-launch.d.ts → launch/update-launch.d.ts} +1 -1
  104. package/dist/updates/{update-launch.js → launch/update-launch.js} +2 -2
  105. package/dist/updates/{linux-process-state.js → locks/linux-process-state.js} +1 -1
  106. package/dist/updates/{native-file-lock.js → locks/native-file-lock.js} +1 -1
  107. package/dist/updates/{stable-file.js → locks/stable-file.js} +2 -2
  108. package/dist/updates/{update-download-lock.js → locks/update-download-lock.js} +1 -1
  109. package/dist/updates/{update-generation-lease.js → locks/update-generation-lease.js} +3 -3
  110. package/dist/updates/{update-inherited-launch-lease.d.ts → locks/update-inherited-launch-lease.d.ts} +1 -1
  111. package/dist/updates/{update-inherited-launch-lease.js → locks/update-inherited-launch-lease.js} +2 -2
  112. package/dist/updates/{update-instance-lease.js → locks/update-instance-lease.js} +2 -2
  113. package/dist/updates/{update-lock.js → locks/update-lock.js} +2 -2
  114. package/dist/updates/{update-process-fence.js → locks/update-process-fence.js} +3 -3
  115. package/dist/updates/{update-process-liveness.js → locks/update-process-liveness.js} +2 -2
  116. package/dist/updates/retained-client-assets.d.ts +60 -0
  117. package/dist/updates/retained-client-assets.js +116 -0
  118. package/dist/updates/retention/retention-cleanup.d.ts +103 -0
  119. package/dist/updates/retention/retention-cleanup.js +439 -0
  120. package/dist/updates/retention/retention-prune-progress.d.ts +27 -0
  121. package/dist/updates/retention/retention-prune-progress.js +203 -0
  122. package/dist/updates/retention/retirement-inventory.d.ts +93 -0
  123. package/dist/updates/retention/retirement-inventory.js +373 -0
  124. package/dist/updates/retention/retirement-records.d.ts +75 -0
  125. package/dist/updates/retention/retirement-records.js +309 -0
  126. package/dist/updates/{update-retention-marker.d.ts → retention/update-retention-marker.d.ts} +1 -1
  127. package/dist/updates/{update-retention-marker.js → retention/update-retention-marker.js} +3 -3
  128. package/dist/updates/{update-retention-plan.d.ts → retention/update-retention-plan.d.ts} +1 -1
  129. package/dist/updates/{update-retention-plan.js → retention/update-retention-plan.js} +2 -2
  130. package/dist/updates/{update-retention-sync.d.ts → retention/update-retention-sync.d.ts} +1 -1
  131. package/dist/updates/{update-retention-sync.js → retention/update-retention-sync.js} +2 -2
  132. package/dist/updates/retention/update-retirement.d.ts +26 -0
  133. package/dist/updates/retention/update-retirement.js +205 -0
  134. package/dist/updates/update-adapter.js +1 -1
  135. package/dist/updates/update-channel-store.d.ts +1 -1
  136. package/dist/updates/update-channel-store.js +2 -2
  137. package/dist/updates/update-manager.d.ts +4 -4
  138. package/dist/updates/update-manager.js +5 -5
  139. package/dist/updates/update-services.d.ts +15 -0
  140. package/dist/updates/update-services.js +77 -0
  141. package/dist/updates/update-state-store.d.ts +2 -2
  142. package/dist/updates/update-state-store.js +2 -2
  143. package/dist/views/appearance-surface.js +3 -1
  144. package/package.json +42 -29
  145. package/src/appearance/custom-theme-library.ts +42 -956
  146. package/src/appearance/theme-library-mutation.ts +288 -0
  147. package/src/appearance/theme-library-schema.ts +347 -0
  148. package/src/appearance/theme-library-store.ts +379 -0
  149. package/src/appearance/window-surface.ts +91 -5
  150. package/src/updates/update-adapter.ts +1 -1
  151. package/templates/application/src/bun/index.ts +15 -0
  152. package/templates/application/src/web/main.tsx +13 -1
  153. package/dist/updates/update-retirement.d.ts +0 -205
  154. package/dist/updates/update-retirement.js +0 -1485
  155. /package/dist/installer/{installer-archive.d.ts → installer-archive-members.d.ts} +0 -0
  156. /package/dist/updates/{packaged-release-config.d.ts → feed/packaged-release-config.d.ts} +0 -0
  157. /package/dist/updates/{release-feed.d.ts → feed/release-feed.d.ts} +0 -0
  158. /package/dist/updates/{release-location.d.ts → feed/release-location.d.ts} +0 -0
  159. /package/dist/updates/{release-version.d.ts → feed/release-version.d.ts} +0 -0
  160. /package/dist/updates/{signed-release.d.ts → feed/signed-release.d.ts} +0 -0
  161. /package/dist/updates/{update-discovery.d.ts → feed/update-discovery.d.ts} +0 -0
  162. /package/dist/updates/{update-shutdown.d.ts → helper/update-shutdown.d.ts} +0 -0
  163. /package/dist/updates/{update-marker.d.ts → install/update-marker.d.ts} +0 -0
  164. /package/dist/updates/{launch-environment.d.ts → launch/launch-environment.d.ts} +0 -0
  165. /package/dist/updates/{packaged-launch-admission.d.ts → launch/packaged-launch-admission.d.ts} +0 -0
  166. /package/dist/updates/{linux-process-state.d.ts → locks/linux-process-state.d.ts} +0 -0
  167. /package/dist/updates/{native-file-lock.d.ts → locks/native-file-lock.d.ts} +0 -0
  168. /package/dist/updates/{stable-file.d.ts → locks/stable-file.d.ts} +0 -0
  169. /package/dist/updates/{update-download-lock.d.ts → locks/update-download-lock.d.ts} +0 -0
  170. /package/dist/updates/{update-generation-lease.d.ts → locks/update-generation-lease.d.ts} +0 -0
  171. /package/dist/updates/{update-instance-lease.d.ts → locks/update-instance-lease.d.ts} +0 -0
  172. /package/dist/updates/{update-lock.d.ts → locks/update-lock.d.ts} +0 -0
  173. /package/dist/updates/{update-process-fence.d.ts → locks/update-process-fence.d.ts} +0 -0
  174. /package/dist/updates/{update-process-liveness.d.ts → locks/update-process-liveness.d.ts} +0 -0
  175. /package/src/updates/{release-version.ts → feed/release-version.ts} +0 -0
@@ -1,21 +1,22 @@
1
- import { isUpdateChannel } from "./release-version.js";
2
- import { errorCode } from "../app/value-guards.js";
3
- import { isCanonicalPath } from "../native/canonical-path.js";
4
1
  import { ServiceError } from "../app/service-registry.js";
5
- import { feedUrl, parseReleaseFeed } from "./release-feed.js";
6
- import { acknowledgeRetiredUpdateHealthy, acquireRetainedUpdateTrees, findPendingUpdateHealthAcknowledgement } from "./update-retirement.js";
7
- import { stageUpdateSwap } from "./update-swap-stage.js";
8
- import { downloadVerifiedRelease } from "./update-download.js";
9
- import { completeOwnedUpdateDownload, createOwnedUpdateDownload, initializeOwnedUpdateDownloadRoot } from "./update-download-cleanup.js";
2
+ import { feedUrl, parseReleaseFeed } from "./feed/release-feed.js";
3
+ import { findPendingUpdateHealthAcknowledgement } from "./retention/retirement-inventory.js";
4
+ import { acknowledgeRetiredUpdateHealthy } from "./retention/update-retirement.js";
5
+ import { stageUpdateSwap } from "./install/update-swap-stage.js";
6
+ import { downloadVerifiedRelease } from "./install/update-download.js";
7
+ import { completeOwnedUpdateDownload, createOwnedUpdateDownload, initializeOwnedUpdateDownloadRoot } from "./install/update-download-cleanup.js";
10
8
  import { UpdatePreflightError } from "./update-preflight-error.js";
11
9
  import { createUpdateChannelStore, releaseChannelForUpdate } from "./update-channel-store.js";
12
10
  import { createChannelUpdateManager } from "./channel-update-manager.js";
13
11
  import { UpdateCleanupPendingError, findUpdateCleanupTerminalError } from "./update-cleanup-error.js";
14
- import { armUpdateHelper } from "./update-arm.js";
15
- import { resumeUpdate, resumeUpdateWithRetainedTrees } from "./update-resume.js";
16
- import { scheduleUpdateShutdown } from "./update-shutdown.js";
17
- import { lstat, mkdir, readlink, realpath } from "node:fs/promises";
18
- import { basename, dirname, join, relative, resolve } from "node:path";
12
+ import { armUpdateHelper } from "./install/update-arm.js";
13
+ import { resumeUpdate } from "./helper/update-resume.js";
14
+ import { scheduleUpdateShutdown } from "./helper/update-shutdown.js";
15
+ import { installTarget, updatePlatform } from "./install-target.js";
16
+ import { acquireRetainedDesktopClientAssets, canonicalTargetForRecovery, resumeAndAcquireRetainedDesktopClientAssets } from "./retained-client-assets.js";
17
+ import { parseUpdateChannel, parseUpdateInstall, registerUpdateServices } from "./update-services.js";
18
+ import { mkdir, realpath } from "node:fs/promises";
19
+ import { join } from "node:path";
19
20
  // src/updates/desktop-updater.ts
20
21
  /**
21
22
  * The desktop host's signed updater, the same for every framework app: the
@@ -35,137 +36,6 @@ var MAX_EXPANDED_BYTES = 4294967296;
35
36
  var QUIT_DELAY_MS = 250;
36
37
  /** Allows a just-relaunched app to wait briefly for its detached updater helper to exit. */
37
38
  var HEALTH_ACK_HELPER_WAIT_MS = 5e3;
38
- /** The release platform this host runs on, or null where framework apps ship no build. */
39
- function updatePlatform(platform = process.platform, arch = process.arch) {
40
- if (platform === "darwin" && arch === "arm64") return "macos-arm64";
41
- if (platform === "win32" && arch === "x64") return "windows-x64";
42
- if (platform === "linux" && arch === "x64") return "linux-x64";
43
- if (platform === "linux" && arch === "arm64") return "linux-arm64";
44
- return null;
45
- }
46
- /**
47
- * The installed app tree the swap replaces: the `.app` bundle on macOS, the
48
- * app directory elsewhere. The host entry runs from `Resources/app/bun`.
49
- */
50
- function installTarget(entryDirectory, platform) {
51
- return resolve(entryDirectory, ...platform === "macos-arm64" ? [
52
- "..",
53
- "..",
54
- "..",
55
- ".."
56
- ] : [
57
- "..",
58
- "..",
59
- ".."
60
- ]);
61
- }
62
- /** Preserve interrupted-swap recovery when the installed target is temporarily absent. */
63
- async function canonicalTargetForRecovery(target, seen = /* @__PURE__ */ new Set()) {
64
- if (seen.has(target) || seen.size >= 16) throw new Error("Invalid install target symlink chain");
65
- seen.add(target);
66
- try {
67
- return await realpath(target);
68
- } catch (error) {
69
- if (errorCode(error) !== "ENOENT") throw error;
70
- const info = await lstat(target).then((value) => value, (statError) => {
71
- if (errorCode(statError) === "ENOENT") return void 0;
72
- throw statError;
73
- });
74
- if (info?.isSymbolicLink()) return canonicalTargetForRecovery(resolve(dirname(target), await readlink(target)), seen);
75
- if (info) throw error;
76
- return join(await realpath(dirname(target)), basename(target));
77
- }
78
- }
79
- /**
80
- * Validate a packaged entry directory and locate its install root plus the
81
- * client directory relative to it, which every retained generation shares.
82
- */
83
- async function packagedClientLayout(options, platform) {
84
- if (!isCanonicalPath(options.entryDirectory) || typeof options.loadManifest !== "function") throw new Error("Invalid packaged client asset lookup");
85
- const lexicalTarget = installTarget(options.entryDirectory, platform);
86
- const clientRelative = relative(lexicalTarget, resolve(options.entryDirectory, "..", "client"));
87
- if (clientRelative !== join(...platform === "macos-arm64" ? ["Contents"] : [], "Resources", "app", "client")) throw new Error("Invalid packaged client asset layout");
88
- return {
89
- target: await realpath(lexicalTarget),
90
- clientRelative
91
- };
92
- }
93
- /**
94
- * Load every retained generation's client manifest while its lease is held. The
95
- * loads run concurrently; all of them settle before a failure releases the
96
- * leases, so no load still reads a tree that may be pruned. A loader that
97
- * throws synchronously is treated as a rejected load.
98
- */
99
- async function loadRetainedClientAssets(trees, clientRelative, loadManifest, release) {
100
- const roots = trees.map(({ tree }) => join(tree, clientRelative));
101
- const loaded = await Promise.allSettled(roots.map((root) => Promise.resolve().then(() => loadManifest(root))));
102
- const failed = loaded.find((outcome) => outcome.status === "rejected");
103
- if (!failed) return roots.map((root, index) => ({
104
- root,
105
- immutableAssets: loaded[index].value
106
- }));
107
- try {
108
- await release();
109
- } catch (releaseError) {
110
- throw new AggregateError([failed.reason, releaseError], "Retained client asset preparation failed", { cause: releaseError });
111
- }
112
- throw failed.reason;
113
- }
114
- /**
115
- * Acquire the updater's retained generations and map their packaged client
116
- * directories to manifests. The caller must already hold any required native
117
- * launch admission lease and must retain the returned generation leases until
118
- * the host and all response bodies are drained. This does not gate startup.
119
- * `loadManifest` receives a retained client root while its lease is held.
120
- */
121
- async function acquireRetainedDesktopClientAssets(options) {
122
- const platform = updatePlatform();
123
- if (!platform) return { status: "unsupported" };
124
- const { target, clientRelative } = await packagedClientLayout(options, platform);
125
- const retained = await acquireRetainedUpdateTrees({
126
- target,
127
- currentVersion: options.currentVersion
128
- });
129
- if (retained.status !== "acquired") return retained;
130
- return {
131
- status: "acquired",
132
- retainedClientAssets: await loadRetainedClientAssets(retained.trees, clientRelative, options.loadManifest, retained.release),
133
- release: retained.release
134
- };
135
- }
136
- /**
137
- * Trusted startup variant for callers that must preserve normal pending staged
138
- * updates while pinning retained generations. Resume and lease acquisition are
139
- * serialized under the install lock; callers keep the returned lease through
140
- * host shutdown and response draining.
141
- */
142
- async function resumeAndAcquireRetainedDesktopClientAssets(options) {
143
- const platform = updatePlatform();
144
- if (!platform) return { status: "unsupported" };
145
- const { target, clientRelative } = await packagedClientLayout(options, platform);
146
- const result = await resumeUpdateWithRetainedTrees({
147
- target,
148
- trust: options.trust,
149
- currentVersion: options.currentVersion
150
- });
151
- if (result.status !== "ready") return result;
152
- if (result.retained.status !== "acquired") {
153
- if (result.retained.status === "busy") return { status: "busy" };
154
- return {
155
- status: "ready",
156
- resume: result.resume,
157
- retainedClientAssets: [],
158
- release: async () => {}
159
- };
160
- }
161
- const retainedClientAssets = await loadRetainedClientAssets(result.retained.trees, clientRelative, options.loadManifest, result.retained.release);
162
- return {
163
- status: "ready",
164
- resume: result.resume,
165
- retainedClientAssets,
166
- release: result.retained.release
167
- };
168
- }
169
39
  /** Each channel's signed descriptor for `platform`, as the release workflows publish them. */
170
40
  function discoveryNames(platform) {
171
41
  return {
@@ -579,77 +449,4 @@ async function createDesktopUpdater(options) {
579
449
  }
580
450
  });
581
451
  }
582
- function record(value, keys) {
583
- if (typeof value !== "object" || value === null || Array.isArray(value) || Object.keys(value).some((key) => !keys.includes(key))) throw new Error("Invalid input");
584
- return value;
585
- }
586
- function parseNone(value) {
587
- if (value !== void 0 && value !== null) record(value, []);
588
- return null;
589
- }
590
- /** The `desktop_update_channel_save` argument. */
591
- function parseUpdateChannel(value) {
592
- const { channel } = record(value, ["channel"]);
593
- if (!isUpdateChannel(channel)) throw new Error("Invalid input");
594
- return channel;
595
- }
596
- /** The `desktop_update_install` argument. */
597
- function parseUpdateInstall(value) {
598
- const { expectedVersion, approved, restart } = record(value, [
599
- "expectedVersion",
600
- "approved",
601
- "restart"
602
- ]);
603
- if (typeof expectedVersion !== "string" || expectedVersion.length > 64 || typeof approved !== "boolean" || restart !== void 0 && typeof restart !== "boolean") throw new Error("Invalid input");
604
- return {
605
- expectedVersion,
606
- approved,
607
- ...restart === void 0 ? {} : { restart }
608
- };
609
- }
610
- /** Pass a service error through; give any other failure the update error code. */
611
- function failure(error) {
612
- if (error instanceof ServiceError) throw error;
613
- throw new ServiceError("update_failed", error instanceof Error ? error.message : String(error));
614
- }
615
- /** Register the `desktop_update_*` services the web client's update adapter calls. */
616
- function registerUpdateServices(options) {
617
- const { services, updater } = options;
618
- const authorize = (principal) => options.authorize(principal);
619
- const unregister = [
620
- services.register("desktop_update_status", {
621
- parse: parseNone,
622
- authorize,
623
- run: () => updater.status().catch(failure)
624
- }),
625
- services.register("desktop_update_channel", {
626
- parse: parseNone,
627
- authorize,
628
- run: () => updater.channel().catch(failure)
629
- }),
630
- services.register("desktop_update_channel_save", {
631
- parse: parseUpdateChannel,
632
- authorize,
633
- run: (_principal, channel) => updater.saveChannel(channel).catch(failure)
634
- }),
635
- services.register("desktop_update_check", {
636
- parse: parseNone,
637
- authorize,
638
- run: () => updater.check().catch(failure)
639
- }),
640
- services.register("desktop_update_install", {
641
- parse: parseUpdateInstall,
642
- authorize,
643
- run: (_principal, request) => updater.install(request).catch(failure)
644
- }),
645
- services.register("desktop_update_cancel", {
646
- parse: parseNone,
647
- authorize,
648
- run: () => updater.cancel()
649
- })
650
- ];
651
- return () => {
652
- for (const remove of unregister) remove();
653
- };
654
- }
655
452
  export { acquireRetainedDesktopClientAssets, createDesktopUpdater, createUpdater, discoveryNames, installTarget, parseUpdateChannel, parseUpdateInstall, registerUpdateServices, resumeAndAcquireRetainedDesktopClientAssets, updatePlatform, updateTrust };
@@ -1,11 +1,11 @@
1
- import { isRecord } from "../app/value-guards.js";
2
- import { isCanonicalPath } from "../native/canonical-path.js";
1
+ import { isRecord } from "../../app/value-guards.js";
2
+ import { isCanonicalPath } from "../../native/canonical-path.js";
3
3
  import { isRepositorySlug } from "./signed-release.js";
4
- import { parseReleaseConfig } from "../release/release-config.js";
5
- import { openUnchangedFile, sameFile } from "./stable-file.js";
4
+ import { parseReleaseConfig } from "../../release/release-config.js";
5
+ import { openUnchangedFile, sameFile } from "../locks/stable-file.js";
6
6
  import { lstat } from "node:fs/promises";
7
7
  import { join } from "node:path";
8
- // src/updates/packaged-release-config.ts
8
+ // src/updates/feed/packaged-release-config.ts
9
9
  var MAX_CONFIG_BYTES = 262144;
10
10
  /** Read only the release identity and public keys shipped beside the Bun entry. */
11
11
  async function readPackagedReleaseConfig(entryDirectory, identity) {
@@ -1,5 +1,5 @@
1
- import { isGitSha, isRecord, isSha256Hex } from "../app/value-guards.js";
2
- // src/updates/release-feed.ts
1
+ import { isGitSha, isRecord, isSha256Hex } from "../../app/value-guards.js";
2
+ // src/updates/feed/release-feed.ts
3
3
  /** Ledger entries kept; the oldest fall off a full ledger. */
4
4
  var MAX_LEDGER_RELEASES = 500;
5
5
  var MAX_RELEASE_ASSETS = 256;
@@ -1,5 +1,5 @@
1
- import { discardStream } from "../shared/discard-stream.js";
2
- // src/updates/release-location.ts
1
+ import { discardStream } from "../../shared/discard-stream.js";
2
+ // src/updates/feed/release-location.ts
3
3
  /** `value` as a URL inside `scope`: the same https origin, under its path prefix, with no
4
4
  * credentials, port, fragment or dot segments. */
5
5
  function releaseUrl(value, scope) {
@@ -1,4 +1,4 @@
1
- // src/updates/release-version.ts
1
+ // src/updates/feed/release-version.ts
2
2
  function isUpdateChannel(value) {
3
3
  return value === "stable" || value === "pre-release" || value === "dev";
4
4
  }
@@ -1,6 +1,6 @@
1
- import { isGitSha, isRecord, isSha256Hex } from "../app/value-guards.js";
1
+ import { isGitSha, isRecord, isSha256Hex } from "../../app/value-guards.js";
2
2
  import { createHash, createPublicKey, sign, timingSafeEqual, verify } from "node:crypto";
3
- // src/updates/signed-release.ts
3
+ // src/updates/feed/signed-release.ts
4
4
  var verifiedDescriptors = /* @__PURE__ */ new WeakMap();
5
5
  /** A GitHub `owner/name` slug that is safe to place in API and download paths. */
6
6
  function isRepositorySlug(value) {
@@ -3,7 +3,7 @@ import { isRepositorySlug, verifyReleaseDescriptor } from "./signed-release.js";
3
3
  import { parseFeedRelease, parseReleaseLedger } from "./release-feed.js";
4
4
  import { fetchReleaseLocation, readReleaseBytes, readReleaseJson } from "./release-location.js";
5
5
  import { createHash } from "node:crypto";
6
- // src/updates/update-discovery.ts
6
+ // src/updates/feed/update-discovery.ts
7
7
  var MAX_POINTER_BYTES = 262144;
8
8
  var MAX_LEDGER_BYTES = 1048576;
9
9
  /** Discover and authenticate the app's channel descriptor without trusting feed metadata as an update. */
@@ -0,0 +1,8 @@
1
+ import { type ReleaseTrust } from '../feed/signed-release';
2
+ import { type UpdateLaunchGateRecoveryResult } from '../launch/update-launch-gate';
3
+ /**
4
+ * Reconcile only the schema-3 journal bound to the exact persisted gate. The
5
+ * caller deliberately opts into this operation; generated unmanaged startup
6
+ * reaches it through `recoverPackagedUpdateLaunchGate` before launch admission.
7
+ */
8
+ export declare function recoverUpdateLaunchGate(target: string, trust: ReleaseTrust): Promise<UpdateLaunchGateRecoveryResult>;