@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.
- package/README.md +2 -0
- package/dist/appearance/appearance-host.js +2 -1
- package/dist/appearance/custom-theme-import.js +3 -1
- package/dist/appearance/custom-theme-library.d.ts +6 -185
- package/dist/appearance/custom-theme-library.js +3 -621
- package/dist/appearance/theme-library-mutation.d.ts +42 -0
- package/dist/appearance/theme-library-mutation.js +172 -0
- package/dist/appearance/theme-library-schema.d.ts +108 -0
- package/dist/appearance/theme-library-schema.js +189 -0
- package/dist/appearance/theme-library-store.d.ts +61 -0
- package/dist/appearance/theme-library-store.js +268 -0
- package/dist/appearance/theme-record-adapter.js +3 -1
- package/dist/appearance/theme-registry.js +2 -1
- package/dist/appearance/window-surface.d.ts +19 -0
- package/dist/appearance/window-surface.js +68 -1
- package/dist/cli/update-helper-cli.js +1 -1
- package/dist/cli/windows-installer-build-cli.d.ts +2 -0
- package/dist/cli/windows-installer-build-cli.js +14 -0
- package/dist/desktop/desktop-client.d.ts +1 -1
- package/dist/framework-source.json +1 -1
- package/dist/installer/installed-payload.js +2 -2
- package/dist/installer/{installer-archive.js → installer-archive-members.js} +2 -2
- package/dist/installer/installer-extraction.js +2 -2
- package/dist/installer/installer-fetch-guard.d.ts +1 -1
- package/dist/installer/installer-identity.js +2 -2
- package/dist/installer/installer-observation.d.ts +1 -1
- package/dist/installer/installer-observation.js +2 -2
- package/dist/installer/installer-upgrade-command.d.ts +2 -2
- package/dist/installer/installer-upgrade-command.js +5 -5
- package/dist/installer/linux-process-group.js +1 -1
- package/dist/installer/upgrade-asset-download.d.ts +1 -1
- package/dist/installer/upgrade-asset-download.js +2 -2
- package/dist/native/installer-archive.d.ts +42 -0
- package/dist/native/installer-archive.js +172 -0
- package/dist/native/posix-tree-removal.d.ts +1 -1
- package/dist/native/window-surface-store.d.ts +16 -0
- package/dist/native/window-surface-store.js +69 -0
- package/dist/native/windows-extractor-build.d.ts +95 -0
- package/dist/native/windows-extractor-build.js +326 -0
- package/dist/release/feed-release-cut.d.ts +1 -1
- package/dist/release/feed-state.d.ts +2 -2
- package/dist/release/feed-state.js +3 -3
- package/dist/release/github-release-cut.js +1 -1
- package/dist/release/github-release-promotion.js +1 -1
- package/dist/release/github-release-publisher.js +1 -1
- package/dist/release/github-release-qualification.js +1 -1
- package/dist/release/local-release.d.ts +2 -2
- package/dist/release/local-release.js +3 -3
- package/dist/release/release-artifact.d.ts +1 -1
- package/dist/release/release-artifact.js +2 -2
- package/dist/release/release-assets-plan.js +1 -1
- package/dist/release/release-config.d.ts +1 -1
- package/dist/release/release-config.js +1 -1
- package/dist/release/release-descriptor-staging.js +3 -3
- package/dist/release/release-finalize.js +1 -1
- package/dist/release/release-promotion.js +1 -1
- package/dist/release/release-publication.d.ts +1 -1
- package/dist/release/release-publication.js +2 -2
- package/dist/release/release-publish-command.js +2 -2
- package/dist/update-helper.bundle.js +18 -18
- package/dist/updates/channel-update-manager.d.ts +3 -3
- package/dist/updates/channel-update-manager.js +2 -2
- package/dist/updates/desktop-updater.d.ts +10 -83
- package/dist/updates/desktop-updater.js +14 -217
- package/dist/updates/{packaged-release-config.js → feed/packaged-release-config.js} +5 -5
- package/dist/updates/{release-feed.js → feed/release-feed.js} +2 -2
- package/dist/updates/{release-location.js → feed/release-location.js} +2 -2
- package/dist/updates/{release-version.js → feed/release-version.js} +1 -1
- package/dist/updates/{signed-release.js → feed/signed-release.js} +2 -2
- package/dist/updates/{update-discovery.js → feed/update-discovery.js} +1 -1
- package/dist/updates/helper/launch-gate-recovery.d.ts +8 -0
- package/dist/updates/{update-resume.js → helper/launch-gate-recovery.js} +13 -423
- package/dist/updates/helper/resume-staging.d.ts +22 -0
- package/dist/updates/helper/resume-staging.js +180 -0
- package/dist/updates/{update-helper.d.ts → helper/update-helper.d.ts} +1 -1
- package/dist/updates/{update-helper.js → helper/update-helper.js} +9 -9
- package/dist/updates/{update-resume.d.ts → helper/update-resume.d.ts} +4 -10
- package/dist/updates/helper/update-resume.js +252 -0
- package/dist/updates/{update-shutdown.js → helper/update-shutdown.js} +2 -2
- package/dist/updates/{update-arm.d.ts → install/update-arm.d.ts} +2 -2
- package/dist/updates/{update-arm.js → install/update-arm.js} +9 -9
- package/dist/updates/{update-download-cleanup.d.ts → install/update-download-cleanup.d.ts} +1 -1
- package/dist/updates/{update-download-cleanup.js → install/update-download-cleanup.js} +3 -3
- package/dist/updates/{update-download.d.ts → install/update-download.d.ts} +2 -2
- package/dist/updates/{update-download.js → install/update-download.js} +3 -3
- package/dist/updates/{update-extraction.d.ts → install/update-extraction.d.ts} +2 -2
- package/dist/updates/{update-extraction.js → install/update-extraction.js} +6 -6
- package/dist/updates/{update-handoff-plan.d.ts → install/update-handoff-plan.d.ts} +2 -2
- package/dist/updates/{update-handoff-plan.js → install/update-handoff-plan.js} +5 -5
- package/dist/updates/{update-marker.js → install/update-marker.js} +2 -2
- package/dist/updates/{update-swap-stage.d.ts → install/update-swap-stage.d.ts} +2 -2
- package/dist/updates/{update-swap-stage.js → install/update-swap-stage.js} +7 -6
- package/dist/updates/{update-swap.d.ts → install/update-swap.d.ts} +1 -1
- package/dist/updates/{update-swap.js → install/update-swap.js} +5 -5
- package/dist/updates/install-target.d.ts +8 -0
- package/dist/updates/install-target.js +27 -0
- package/dist/updates/{launch-environment.js → launch/launch-environment.js} +1 -1
- package/dist/updates/{packaged-launch-admission.js → launch/packaged-launch-admission.js} +4 -4
- package/dist/updates/{packaged-update-startup.d.ts → launch/packaged-update-startup.d.ts} +3 -3
- package/dist/updates/{packaged-update-startup.js → launch/packaged-update-startup.js} +10 -7
- package/dist/updates/{update-launch-gate.d.ts → launch/update-launch-gate.d.ts} +1 -1
- package/dist/updates/{update-launch-gate.js → launch/update-launch-gate.js} +9 -9
- package/dist/updates/{update-launch.d.ts → launch/update-launch.d.ts} +1 -1
- package/dist/updates/{update-launch.js → launch/update-launch.js} +2 -2
- package/dist/updates/{linux-process-state.js → locks/linux-process-state.js} +1 -1
- package/dist/updates/{native-file-lock.js → locks/native-file-lock.js} +1 -1
- package/dist/updates/{stable-file.js → locks/stable-file.js} +2 -2
- package/dist/updates/{update-download-lock.js → locks/update-download-lock.js} +1 -1
- package/dist/updates/{update-generation-lease.js → locks/update-generation-lease.js} +3 -3
- package/dist/updates/{update-inherited-launch-lease.d.ts → locks/update-inherited-launch-lease.d.ts} +1 -1
- package/dist/updates/{update-inherited-launch-lease.js → locks/update-inherited-launch-lease.js} +2 -2
- package/dist/updates/{update-instance-lease.js → locks/update-instance-lease.js} +2 -2
- package/dist/updates/{update-lock.js → locks/update-lock.js} +2 -2
- package/dist/updates/{update-process-fence.js → locks/update-process-fence.js} +3 -3
- package/dist/updates/{update-process-liveness.js → locks/update-process-liveness.js} +2 -2
- package/dist/updates/retained-client-assets.d.ts +60 -0
- package/dist/updates/retained-client-assets.js +116 -0
- package/dist/updates/retention/retention-cleanup.d.ts +103 -0
- package/dist/updates/retention/retention-cleanup.js +439 -0
- package/dist/updates/retention/retention-prune-progress.d.ts +27 -0
- package/dist/updates/retention/retention-prune-progress.js +203 -0
- package/dist/updates/retention/retirement-inventory.d.ts +93 -0
- package/dist/updates/retention/retirement-inventory.js +373 -0
- package/dist/updates/retention/retirement-records.d.ts +75 -0
- package/dist/updates/retention/retirement-records.js +309 -0
- package/dist/updates/{update-retention-marker.d.ts → retention/update-retention-marker.d.ts} +1 -1
- package/dist/updates/{update-retention-marker.js → retention/update-retention-marker.js} +3 -3
- package/dist/updates/{update-retention-plan.d.ts → retention/update-retention-plan.d.ts} +1 -1
- package/dist/updates/{update-retention-plan.js → retention/update-retention-plan.js} +2 -2
- package/dist/updates/{update-retention-sync.d.ts → retention/update-retention-sync.d.ts} +1 -1
- package/dist/updates/{update-retention-sync.js → retention/update-retention-sync.js} +2 -2
- package/dist/updates/retention/update-retirement.d.ts +26 -0
- package/dist/updates/retention/update-retirement.js +205 -0
- package/dist/updates/update-adapter.js +1 -1
- package/dist/updates/update-channel-store.d.ts +1 -1
- package/dist/updates/update-channel-store.js +2 -2
- package/dist/updates/update-manager.d.ts +4 -4
- package/dist/updates/update-manager.js +5 -5
- package/dist/updates/update-services.d.ts +15 -0
- package/dist/updates/update-services.js +77 -0
- package/dist/updates/update-state-store.d.ts +2 -2
- package/dist/updates/update-state-store.js +2 -2
- package/dist/views/appearance-surface.js +3 -1
- package/package.json +42 -29
- package/src/appearance/custom-theme-library.ts +42 -956
- package/src/appearance/theme-library-mutation.ts +288 -0
- package/src/appearance/theme-library-schema.ts +347 -0
- package/src/appearance/theme-library-store.ts +379 -0
- package/src/appearance/window-surface.ts +91 -5
- package/src/updates/update-adapter.ts +1 -1
- package/templates/application/src/bun/index.ts +15 -0
- package/templates/application/src/web/main.tsx +13 -1
- package/dist/updates/update-retirement.d.ts +0 -205
- package/dist/updates/update-retirement.js +0 -1485
- /package/dist/installer/{installer-archive.d.ts → installer-archive-members.d.ts} +0 -0
- /package/dist/updates/{packaged-release-config.d.ts → feed/packaged-release-config.d.ts} +0 -0
- /package/dist/updates/{release-feed.d.ts → feed/release-feed.d.ts} +0 -0
- /package/dist/updates/{release-location.d.ts → feed/release-location.d.ts} +0 -0
- /package/dist/updates/{release-version.d.ts → feed/release-version.d.ts} +0 -0
- /package/dist/updates/{signed-release.d.ts → feed/signed-release.d.ts} +0 -0
- /package/dist/updates/{update-discovery.d.ts → feed/update-discovery.d.ts} +0 -0
- /package/dist/updates/{update-shutdown.d.ts → helper/update-shutdown.d.ts} +0 -0
- /package/dist/updates/{update-marker.d.ts → install/update-marker.d.ts} +0 -0
- /package/dist/updates/{launch-environment.d.ts → launch/launch-environment.d.ts} +0 -0
- /package/dist/updates/{packaged-launch-admission.d.ts → launch/packaged-launch-admission.d.ts} +0 -0
- /package/dist/updates/{linux-process-state.d.ts → locks/linux-process-state.d.ts} +0 -0
- /package/dist/updates/{native-file-lock.d.ts → locks/native-file-lock.d.ts} +0 -0
- /package/dist/updates/{stable-file.d.ts → locks/stable-file.d.ts} +0 -0
- /package/dist/updates/{update-download-lock.d.ts → locks/update-download-lock.d.ts} +0 -0
- /package/dist/updates/{update-generation-lease.d.ts → locks/update-generation-lease.d.ts} +0 -0
- /package/dist/updates/{update-instance-lease.d.ts → locks/update-instance-lease.d.ts} +0 -0
- /package/dist/updates/{update-lock.d.ts → locks/update-lock.d.ts} +0 -0
- /package/dist/updates/{update-process-fence.d.ts → locks/update-process-fence.d.ts} +0 -0
- /package/dist/updates/{update-process-liveness.d.ts → locks/update-process-liveness.d.ts} +0 -0
- /package/src/updates/{release-version.ts → feed/release-version.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FeedRelease, ReleaseLedger } from '../updates/release-feed';
|
|
1
|
+
import type { FeedRelease, ReleaseLedger } from '../updates/feed/release-feed';
|
|
2
2
|
import { type GitRun } from './local-provenance';
|
|
3
3
|
import type { ReleaseCutProvider } from './release-cut';
|
|
4
4
|
import type { HistoryRewrite } from './release-config';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type FeedChannel, type FeedRelease, type ReleaseFeed, type ReleaseLedger } from '../updates/release-feed';
|
|
2
|
-
import { type FetchFunction } from '../updates/release-location';
|
|
1
|
+
import { type FeedChannel, type FeedRelease, type ReleaseFeed, type ReleaseLedger } from '../updates/feed/release-feed';
|
|
2
|
+
import { type FetchFunction } from '../updates/feed/release-location';
|
|
3
3
|
/** The published ledger, or an empty one before the app's first release. */
|
|
4
4
|
export declare function readFeedLedger(feed: ReleaseFeed, fetcher: FetchFunction): Promise<ReleaseLedger>;
|
|
5
5
|
/** A tag's published release.json, or null when none is published. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { verifyReleaseDescriptor, verifyReleaseStream } from "../updates/signed-release.js";
|
|
2
|
-
import { feedUrl, parseFeedRelease, parseReleaseLedger } from "../updates/release-feed.js";
|
|
1
|
+
import { verifyReleaseDescriptor, verifyReleaseStream } from "../updates/feed/signed-release.js";
|
|
2
|
+
import { feedUrl, parseFeedRelease, parseReleaseLedger } from "../updates/feed/release-feed.js";
|
|
3
3
|
import { discoveryPolicies } from "./release-config.js";
|
|
4
4
|
import { discardStream } from "../shared/discard-stream.js";
|
|
5
|
-
import { fetchReleaseLocation, readReleaseBytes } from "../updates/release-location.js";
|
|
5
|
+
import { fetchReleaseLocation, readReleaseBytes } from "../updates/feed/release-location.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
// src/release/feed-state.ts
|
|
8
8
|
var MAX_LEDGER_BYTES = 1048576;
|
|
@@ -3,7 +3,7 @@ import { containsAsciiControl } from "../desktop/string-policy.js";
|
|
|
3
3
|
import { githubCli } from "./github-cli.js";
|
|
4
4
|
import { verifyReleaseProvenance } from "./github-release-provenance.js";
|
|
5
5
|
import { lookupRelease } from "./github-release-lookup.js";
|
|
6
|
-
import { isRepositorySlug } from "../updates/signed-release.js";
|
|
6
|
+
import { isRepositorySlug } from "../updates/feed/signed-release.js";
|
|
7
7
|
import { qualifyGitHubRelease } from "./github-release-qualification.js";
|
|
8
8
|
import { workflowFile } from "./release-config.js";
|
|
9
9
|
// src/release/github-release-cut.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { githubCli } from "./github-cli.js";
|
|
2
|
-
import { assertRepositorySlug } from "../updates/signed-release.js";
|
|
2
|
+
import { assertRepositorySlug } from "../updates/feed/signed-release.js";
|
|
3
3
|
import { qualifyGitHubRelease } from "./github-release-qualification.js";
|
|
4
4
|
// src/release/github-release-promotion.ts
|
|
5
5
|
function normalizePromotionRelease(value) {
|
|
@@ -3,7 +3,7 @@ import { githubCli } from "./github-cli.js";
|
|
|
3
3
|
import { listGitHubReleaseAssets } from "./github-release-assets.js";
|
|
4
4
|
import { verifyReleaseProvenance } from "./github-release-provenance.js";
|
|
5
5
|
import { lookupRelease } from "./github-release-lookup.js";
|
|
6
|
-
import { isRepositorySlug } from "../updates/signed-release.js";
|
|
6
|
+
import { isRepositorySlug } from "../updates/feed/signed-release.js";
|
|
7
7
|
// src/release/github-release-publisher.ts
|
|
8
8
|
/** GitHub adapter; callers must run it in a trusted release job with GH_TOKEN. */
|
|
9
9
|
function createGitHubReleasePublisher(options) {
|
|
@@ -3,7 +3,7 @@ import { validateQualificationRun, validateReleaseQualification } from "./releas
|
|
|
3
3
|
import { listGitHubReleaseAssets } from "./github-release-assets.js";
|
|
4
4
|
import { verifyReleaseProvenance } from "./github-release-provenance.js";
|
|
5
5
|
import { lookupRelease } from "./github-release-lookup.js";
|
|
6
|
-
import { isRepositorySlug } from "../updates/signed-release.js";
|
|
6
|
+
import { isRepositorySlug } from "../updates/feed/signed-release.js";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
// src/release/github-release-qualification.ts
|
|
9
9
|
/** Verify immutable GitHub release assets and the exact successful workflow attempt. */
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* object keys and an ordered upload plan; the caller uploads it with its own credentials.
|
|
6
6
|
*/
|
|
7
7
|
import { type KeyObject } from 'node:crypto';
|
|
8
|
-
import { type FeedChannel } from '../updates/release-feed';
|
|
9
|
-
import type { FetchFunction } from '../updates/release-location';
|
|
8
|
+
import { type FeedChannel } from '../updates/feed/release-feed';
|
|
9
|
+
import type { FetchFunction } from '../updates/feed/release-location';
|
|
10
10
|
import { type GitRun } from './local-provenance';
|
|
11
11
|
import { type ReleasePlatform } from './release-config';
|
|
12
12
|
/** One object to upload, in plan order; the staged file is `<out>/<key>`. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { versionLessThan } from "../updates/release-version.js";
|
|
1
|
+
import { versionLessThan } from "../updates/feed/release-version.js";
|
|
2
2
|
import { errorCode, isGitSha, isRecord } from "../app/value-guards.js";
|
|
3
3
|
import { renameExclusive } from "../native/native-rename.js";
|
|
4
|
-
import { verifyReleaseDescriptor } from "../updates/signed-release.js";
|
|
5
|
-
import { feedAssetKey, feedChannelKey, feedIndexKey, feedReleaseKey, feedUrl, parseReleaseLedger } from "../updates/release-feed.js";
|
|
4
|
+
import { verifyReleaseDescriptor } from "../updates/feed/signed-release.js";
|
|
5
|
+
import { feedAssetKey, feedChannelKey, feedIndexKey, feedReleaseKey, feedUrl, parseReleaseLedger } from "../updates/feed/release-feed.js";
|
|
6
6
|
import { discoveryPolicies, parseReleaseConfig, platformPayloads, platformTargets } from "./release-config.js";
|
|
7
7
|
import { cutRelease, nextDevVersion } from "./release-cut.js";
|
|
8
8
|
import { resolveLocalProvenance } from "./local-provenance.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type KeyObject } from 'node:crypto';
|
|
2
|
-
import { type ReleaseDescriptor, type SignedRelease } from '../updates/signed-release';
|
|
2
|
+
import { type ReleaseDescriptor, type SignedRelease } from '../updates/feed/signed-release';
|
|
3
3
|
export type ReleaseArtifactIdentity = Omit<ReleaseDescriptor, 'schema' | 'asset'>;
|
|
4
4
|
/** Hash the actual staged archive without buffering it, then sign its provenance and its
|
|
5
5
|
* URL in the app's release feed (`feed` ends in `/`). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { signReleaseDescriptor } from "../updates/signed-release.js";
|
|
2
|
-
import { hashUnchangedFile } from "../updates/stable-file.js";
|
|
1
|
+
import { signReleaseDescriptor } from "../updates/feed/signed-release.js";
|
|
2
|
+
import { hashUnchangedFile } from "../updates/locks/stable-file.js";
|
|
3
3
|
import { open } from "node:fs/promises";
|
|
4
4
|
import { basename } from "node:path";
|
|
5
5
|
// src/release/release-artifact.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isGitSha } from "../app/value-guards.js";
|
|
2
2
|
import { githubCli, verifyWorkflowAttempt } from "./github-cli.js";
|
|
3
|
-
import { isRepositorySlug } from "../updates/signed-release.js";
|
|
3
|
+
import { isRepositorySlug } from "../updates/feed/signed-release.js";
|
|
4
4
|
import { hostedReleaseWorkflows, parseReleaseConfig } from "./release-config.js";
|
|
5
5
|
import { createGitHubReleaseCutProvider } from "./github-release-cut.js";
|
|
6
6
|
// src/release/release-assets-plan.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Requirements } from './release-qualification';
|
|
2
|
-
import { type ReleaseFeed } from '../updates/release-feed';
|
|
2
|
+
import { type ReleaseFeed } from '../updates/feed/release-feed';
|
|
3
3
|
/** The descriptor target each release platform publishes for. */
|
|
4
4
|
export declare const platformTargets: {
|
|
5
5
|
readonly 'macos-arm64': readonly ['darwin', 'arm64'];
|
|
@@ -2,7 +2,7 @@ import { isGitSha, isRecord } from "../app/value-guards.js";
|
|
|
2
2
|
import { containsAsciiControl } from "../desktop/string-policy.js";
|
|
3
3
|
import { assertSidecarNames } from "../native/app-bundle.js";
|
|
4
4
|
import { parseOfflinePolicy } from "./release-qualification.js";
|
|
5
|
-
import { parseReleaseFeed } from "../updates/release-feed.js";
|
|
5
|
+
import { parseReleaseFeed } from "../updates/feed/release-feed.js";
|
|
6
6
|
// src/release/release-config.ts
|
|
7
7
|
var strings = (value) => Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string" && item.length <= 200 && /^[A-Za-z0-9][A-Za-z0-9._{}-]*$/.test(item) && !item.replaceAll("{tag}", "").includes("{") && !item.replaceAll("{tag}", "").includes("}")) && new Set(value).size === value.length;
|
|
8
8
|
var appIdPattern = /^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+$/;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { errorCode, isRecord } from "../app/value-guards.js";
|
|
2
2
|
import { validateCommandReceipts, validateInstallerReceipt } from "./release-qualification.js";
|
|
3
|
-
import { signReleaseDescriptor, verifyReleaseDescriptor } from "../updates/signed-release.js";
|
|
4
|
-
import { feedUrl } from "../updates/release-feed.js";
|
|
3
|
+
import { signReleaseDescriptor, verifyReleaseDescriptor } from "../updates/feed/signed-release.js";
|
|
4
|
+
import { feedUrl } from "../updates/feed/release-feed.js";
|
|
5
5
|
import { discoveryPolicies, parseReleaseConfig, platformPayloads, platformTargets } from "./release-config.js";
|
|
6
6
|
import { planReleaseAssets } from "./release-assets-plan.js";
|
|
7
|
-
import { hashFileAt } from "../updates/stable-file.js";
|
|
7
|
+
import { hashFileAt } from "../updates/locks/stable-file.js";
|
|
8
8
|
import { commandReceiptName } from "../installer/command-qualification-command.js";
|
|
9
9
|
import { lstat, readFile, writeFile } from "node:fs/promises";
|
|
10
10
|
import { join, resolve } from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isGitSha } from "../app/value-guards.js";
|
|
2
2
|
import { githubCli } from "./github-cli.js";
|
|
3
3
|
import { lookupRelease } from "./github-release-lookup.js";
|
|
4
|
-
import { isRepositorySlug } from "../updates/signed-release.js";
|
|
4
|
+
import { isRepositorySlug } from "../updates/feed/signed-release.js";
|
|
5
5
|
import { qualifyGitHubRelease } from "./github-release-qualification.js";
|
|
6
6
|
import { hostedReleaseWorkflows, parseReleaseConfig } from "./release-config.js";
|
|
7
7
|
import { createGitHubReleaseCutProvider } from "./github-release-cut.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { versionLessThan } from "../updates/release-version.js";
|
|
1
|
+
import { versionLessThan } from "../updates/feed/release-version.js";
|
|
2
2
|
// src/release/release-promotion.ts
|
|
3
3
|
function order(a, b) {
|
|
4
4
|
return Date.parse(a.publishedAt) - Date.parse(b.publishedAt) || a.id - b.id;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReleaseTrust } from '../updates/signed-release';
|
|
1
|
+
import { type ReleaseTrust } from '../updates/feed/signed-release';
|
|
2
2
|
import { type Artifact, type CommandReceipt, type InstallerReceipt, type Qualification, type ReleaseIdentity, type Requirements } from './release-qualification';
|
|
3
3
|
export type RemoteReleaseState = {
|
|
4
4
|
tag: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { validateReleaseQualification } from "./release-qualification.js";
|
|
2
|
-
import { verifyReleaseDescriptor } from "../updates/signed-release.js";
|
|
2
|
+
import { verifyReleaseDescriptor } from "../updates/feed/signed-release.js";
|
|
3
3
|
import { releaseAssetNames } from "./release-config.js";
|
|
4
|
-
import { hashUnchangedFile, openUnchangedFile } from "../updates/stable-file.js";
|
|
4
|
+
import { hashUnchangedFile, openUnchangedFile } from "../updates/locks/stable-file.js";
|
|
5
5
|
import { lstat, mkdtemp, open, rm, writeFile } from "node:fs/promises";
|
|
6
6
|
import { join, resolve } from "node:path";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isGitSha, isRecord } from "../app/value-guards.js";
|
|
2
2
|
import { githubCli, verifyWorkflowAttempt } from "./github-cli.js";
|
|
3
|
-
import { assertRepositorySlug } from "../updates/signed-release.js";
|
|
4
|
-
import { feedUrl } from "../updates/release-feed.js";
|
|
3
|
+
import { assertRepositorySlug } from "../updates/feed/signed-release.js";
|
|
4
|
+
import { feedUrl } from "../updates/feed/release-feed.js";
|
|
5
5
|
import { discoveryPolicies, hostedReleaseWorkflows, parseReleaseConfig } from "./release-config.js";
|
|
6
6
|
import { publishQualifiedRelease } from "./release-publication.js";
|
|
7
7
|
import { commandReceiptName } from "../installer/command-qualification-command.js";
|
|
@@ -16,12 +16,12 @@ function errorCode(error) {
|
|
|
16
16
|
return typeof code === "string" ? code : undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
// src/updates/update-helper.ts
|
|
19
|
+
// src/updates/helper/update-helper.ts
|
|
20
20
|
import { constants as constants7 } from "fs";
|
|
21
21
|
import { lstat as lstat3, open as open7, realpath as realpath2 } from "fs/promises";
|
|
22
22
|
import { join as join9 } from "path";
|
|
23
23
|
|
|
24
|
-
// src/updates/update-marker.ts
|
|
24
|
+
// src/updates/install/update-marker.ts
|
|
25
25
|
import { randomUUID } from "crypto";
|
|
26
26
|
import { closeSync, constants, linkSync, openSync, unlinkSync, writeFileSync } from "fs";
|
|
27
27
|
import { link, open, unlink, writeFile } from "fs/promises";
|
|
@@ -82,11 +82,11 @@ async function readUpdateMarker(staging, name) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// src/updates/update-launch.ts
|
|
85
|
+
// src/updates/launch/update-launch.ts
|
|
86
86
|
import { spawn } from "child_process";
|
|
87
87
|
import { dirname, join as join2 } from "path";
|
|
88
88
|
|
|
89
|
-
// src/updates/launch-environment.ts
|
|
89
|
+
// src/updates/launch/launch-environment.ts
|
|
90
90
|
var INHERITED_LAUNCH_LEASE_ENV = "ADEA_INHERITED_LAUNCH_LEASE_FD";
|
|
91
91
|
|
|
92
92
|
// src/native/canonical-path.ts
|
|
@@ -95,7 +95,7 @@ function isCanonicalPath(value) {
|
|
|
95
95
|
return typeof value === "string" && isAbsolute(value) && resolve(value) === value && !value.includes("\x00");
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// src/updates/update-launch.ts
|
|
98
|
+
// src/updates/launch/update-launch.ts
|
|
99
99
|
function updateLauncherPath(platform, target) {
|
|
100
100
|
if (!isCanonicalPath(target))
|
|
101
101
|
throw new Error("Invalid update target");
|
|
@@ -123,7 +123,7 @@ async function launchInstalledApp(platform, target, env = process.env) {
|
|
|
123
123
|
child.unref();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// src/updates/update-process-fence.ts
|
|
126
|
+
// src/updates/locks/update-process-fence.ts
|
|
127
127
|
import { dlopen as dlopen2, FFIType as FFIType2, ptr as ptr2 } from "bun:ffi";
|
|
128
128
|
import { readFile, realpath } from "fs/promises";
|
|
129
129
|
import { isAbsolute as isAbsolute2 } from "path";
|
|
@@ -169,7 +169,7 @@ function windowsProcessImage(pid, options) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
// src/updates/linux-process-state.ts
|
|
172
|
+
// src/updates/locks/linux-process-state.ts
|
|
173
173
|
function linuxProcessIsExited(stat, pid) {
|
|
174
174
|
const prefix = `${pid} (`;
|
|
175
175
|
const end = stat.lastIndexOf(")");
|
|
@@ -184,7 +184,7 @@ function linuxProcessIsExited(stat, pid) {
|
|
|
184
184
|
return fields[0] === "Z" && threads === 1;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
// src/updates/update-process-fence.ts
|
|
187
|
+
// src/updates/locks/update-process-fence.ts
|
|
188
188
|
class UpdateProcessFenceCancelledError extends Error {
|
|
189
189
|
constructor() {
|
|
190
190
|
super("Update helper cancellation was requested");
|
|
@@ -306,7 +306,7 @@ async function waitForUpdateProcesses(options) {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
// src/updates/update-swap.ts
|
|
309
|
+
// src/updates/install/update-swap.ts
|
|
310
310
|
import { createHash } from "crypto";
|
|
311
311
|
import { constants as constants5 } from "fs";
|
|
312
312
|
import { lstat as lstat2, open as open5, readdir, readFile as readFile3, readlink } from "fs/promises";
|
|
@@ -409,10 +409,10 @@ import { constants as constants4 } from "fs";
|
|
|
409
409
|
import { open as open4, rename, unlink as unlink2, writeFile as writeFile3 } from "fs/promises";
|
|
410
410
|
import { join as join5 } from "path";
|
|
411
411
|
|
|
412
|
-
// src/updates/update-lock.ts
|
|
412
|
+
// src/updates/locks/update-lock.ts
|
|
413
413
|
import { basename, dirname as dirname2, join as join4 } from "path";
|
|
414
414
|
|
|
415
|
-
// src/updates/native-file-lock.ts
|
|
415
|
+
// src/updates/locks/native-file-lock.ts
|
|
416
416
|
import { constants as constants2 } from "fs";
|
|
417
417
|
import { open as open2 } from "fs/promises";
|
|
418
418
|
import { dlopen as dlopen4, FFIType as FFIType4, ptr as ptr4, read } from "bun:ffi";
|
|
@@ -574,7 +574,7 @@ async function tryAcquireWindows(path, mode) {
|
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
// src/updates/update-lock.ts
|
|
577
|
+
// src/updates/locks/update-lock.ts
|
|
578
578
|
function updateLockPath(target) {
|
|
579
579
|
if (!isCanonicalPath(target))
|
|
580
580
|
throw new Error("Invalid update lock target");
|
|
@@ -584,7 +584,7 @@ async function tryAcquireUpdateLock(target) {
|
|
|
584
584
|
return tryAcquireNativeFileLock(updateLockPath(target), "exclusive");
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
-
// src/updates/stable-file.ts
|
|
587
|
+
// src/updates/locks/stable-file.ts
|
|
588
588
|
import { constants as constants3 } from "fs";
|
|
589
589
|
import { lstat, open as open3 } from "fs/promises";
|
|
590
590
|
async function readSmallStateFile(path, maximum, message) {
|
|
@@ -718,7 +718,7 @@ async function replaceUpdateStageState(staging, state, durable) {
|
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
// src/updates/update-swap.ts
|
|
721
|
+
// src/updates/install/update-swap.ts
|
|
722
722
|
function updateStagingFor(target) {
|
|
723
723
|
if (!isCanonicalPath(target))
|
|
724
724
|
throw new Error("Invalid update target");
|
|
@@ -935,13 +935,13 @@ async function swapUpdateTreeWhileLocked(options, exchangeOperation = exchangeDi
|
|
|
935
935
|
throw new Error("Atomic update exchange did not preserve both app trees");
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
-
// src/updates/update-launch-gate.ts
|
|
938
|
+
// src/updates/launch/update-launch-gate.ts
|
|
939
939
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
940
940
|
import { constants as constants6 } from "fs";
|
|
941
941
|
import { open as open6, rename as rename2, unlink as unlink3 } from "fs/promises";
|
|
942
942
|
import { basename as basename4, dirname as dirname5, join as join8 } from "path";
|
|
943
943
|
|
|
944
|
-
// src/updates/update-instance-lease.ts
|
|
944
|
+
// src/updates/locks/update-instance-lease.ts
|
|
945
945
|
import { basename as basename3, dirname as dirname4, join as join7 } from "path";
|
|
946
946
|
function updateInstanceLeasePath(target) {
|
|
947
947
|
if (!isCanonicalPath(target))
|
|
@@ -957,7 +957,7 @@ async function tryAcquireUpdateInstanceLease(target, mode) {
|
|
|
957
957
|
return { mode, release: lock.release };
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
-
// src/updates/update-launch-gate.ts
|
|
960
|
+
// src/updates/launch/update-launch-gate.ts
|
|
961
961
|
var VERSION = /^\d+\.\d+\.\d+(?:-dev\.\d+)?$/;
|
|
962
962
|
var MAX_GATE_BYTES = 1024;
|
|
963
963
|
function validateTarget(target) {
|
|
@@ -1353,7 +1353,7 @@ async function waitForUpdateLaunchGateWriter(target, expected, options) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
1356
|
-
// src/updates/update-helper.ts
|
|
1356
|
+
// src/updates/helper/update-helper.ts
|
|
1357
1357
|
function parseUpdateHelperRequest(value) {
|
|
1358
1358
|
const data = value;
|
|
1359
1359
|
if (typeof value !== "object" || value === null || Array.isArray(value) || data.schema !== 1 && data.schema !== 2 && data.schema !== 3 || !isCanonicalPath(data.target) || !["macos-arm64", "windows-x64", "linux-x64", "linux-arm64"].includes(data.platform) || typeof data.version !== "string" || !/^\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(data.version) || !Array.isArray(data.processes) || data.schema === 2 && (typeof data.generation !== "string" || !/^[0-9a-f-]{36}$/i.test(data.generation) || data.helperOwner !== undefined && (typeof data.helperOwner !== "string" || !/^[0-9a-f-]{36}$/i.test(data.helperOwner))) || data.schema === 3 && (typeof data.generation !== "string" || !isUuid(data.generation) || typeof data.helperOwner !== "string" || !isUuid(data.helperOwner)) || !Number.isSafeInteger(data.processTimeoutMs) || data.processTimeoutMs < 1 || data.processTimeoutMs > 120000)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createUpdateManager } from './update-manager';
|
|
2
|
-
import { type UpdateChannel } from './release-version';
|
|
3
|
-
import type { ReleaseTrust } from './signed-release';
|
|
4
|
-
import type { FetchFunction } from './release-location';
|
|
2
|
+
import { type UpdateChannel } from './feed/release-version';
|
|
3
|
+
import type { ReleaseTrust } from './feed/signed-release';
|
|
4
|
+
import type { FetchFunction } from './feed/release-location';
|
|
5
5
|
type ManagerOptions = Parameters<typeof createUpdateManager>[0];
|
|
6
6
|
/** Re-read the persisted channel for every check and bind an approval to that choice. */
|
|
7
7
|
export declare function createChannelUpdateManager(options: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isUpdateChannel } from "./release-version.js";
|
|
2
|
-
import { selectUpdateDownloadDiscard } from "./update-download-cleanup.js";
|
|
1
|
+
import { isUpdateChannel } from "./feed/release-version.js";
|
|
2
|
+
import { selectUpdateDownloadDiscard } from "./install/update-download-cleanup.js";
|
|
3
3
|
import { createUpdateManager } from "./update-manager.js";
|
|
4
4
|
import { releaseChannelForUpdate } from "./update-channel-store.js";
|
|
5
5
|
// src/updates/channel-update-manager.ts
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { type createServiceRegistry } from '../app/service-registry';
|
|
2
1
|
import type { InstallerPlatform, InstallerRenderer } from '../installer/installer-layout';
|
|
3
2
|
import { createChannelUpdateManager } from './channel-update-manager';
|
|
4
|
-
import {
|
|
5
|
-
import type { ReleaseTrust } from './signed-release';
|
|
3
|
+
import type { UpdateChannel } from './feed/release-version';
|
|
4
|
+
import type { ReleaseTrust } from './feed/signed-release';
|
|
6
5
|
import type { UpdateState } from './update-adapter';
|
|
7
|
-
import type { UpdateResumeResult } from './update-resume';
|
|
8
|
-
import {
|
|
9
|
-
import { type UpdateShutdownTiming } from './update-shutdown';
|
|
6
|
+
import type { UpdateResumeResult } from './helper/update-resume';
|
|
7
|
+
import type { UpdateHealthAcknowledgement } from './retention/retirement-records';
|
|
8
|
+
import { type UpdateShutdownTiming } from './helper/update-shutdown';
|
|
10
9
|
import type { NativeUpdateState } from './update-state';
|
|
11
10
|
export type DesktopUpdatePhase = UpdateState['phase'];
|
|
12
11
|
/** The snapshot every update service returns. */
|
|
@@ -24,70 +23,6 @@ export type DesktopRelease = {
|
|
|
24
23
|
}>;
|
|
25
24
|
sidecars?: readonly string[];
|
|
26
25
|
};
|
|
27
|
-
/** The release platform this host runs on, or null where framework apps ship no build. */
|
|
28
|
-
export declare function updatePlatform(platform?: string, arch?: string): InstallerPlatform | null;
|
|
29
|
-
/**
|
|
30
|
-
* The installed app tree the swap replaces: the `.app` bundle on macOS, the
|
|
31
|
-
* app directory elsewhere. The host entry runs from `Resources/app/bun`.
|
|
32
|
-
*/
|
|
33
|
-
export declare function installTarget(entryDirectory: string, platform: InstallerPlatform): string;
|
|
34
|
-
/**
|
|
35
|
-
* Acquire the updater's retained generations and map their packaged client
|
|
36
|
-
* directories to manifests. The caller must already hold any required native
|
|
37
|
-
* launch admission lease and must retain the returned generation leases until
|
|
38
|
-
* the host and all response bodies are drained. This does not gate startup.
|
|
39
|
-
* `loadManifest` receives a retained client root while its lease is held.
|
|
40
|
-
*/
|
|
41
|
-
export declare function acquireRetainedDesktopClientAssets(options: {
|
|
42
|
-
entryDirectory: string;
|
|
43
|
-
currentVersion: string;
|
|
44
|
-
loadManifest(root: string): Promise<ReadonlyMap<string, string>>;
|
|
45
|
-
}): Promise<Readonly<{
|
|
46
|
-
status: 'none' | 'busy';
|
|
47
|
-
}> | {
|
|
48
|
-
status: 'unsupported';
|
|
49
|
-
retainedClientAssets?: undefined;
|
|
50
|
-
release?: undefined;
|
|
51
|
-
} | {
|
|
52
|
-
status: 'acquired';
|
|
53
|
-
retainedClientAssets: {
|
|
54
|
-
root: string;
|
|
55
|
-
immutableAssets: ReadonlyMap<string, string>;
|
|
56
|
-
}[];
|
|
57
|
-
release: () => Promise<void>;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Trusted startup variant for callers that must preserve normal pending staged
|
|
61
|
-
* updates while pinning retained generations. Resume and lease acquisition are
|
|
62
|
-
* serialized under the install lock; callers keep the returned lease through
|
|
63
|
-
* host shutdown and response draining.
|
|
64
|
-
*/
|
|
65
|
-
export declare function resumeAndAcquireRetainedDesktopClientAssets(options: {
|
|
66
|
-
entryDirectory: string;
|
|
67
|
-
currentVersion: string;
|
|
68
|
-
trust: ReleaseTrust;
|
|
69
|
-
loadManifest(root: string): Promise<ReadonlyMap<string, string>>;
|
|
70
|
-
}): Promise<Readonly<{
|
|
71
|
-
status: 'busy' | 'in-progress' | 'recovery-required';
|
|
72
|
-
}> | {
|
|
73
|
-
retainedClientAssets?: undefined;
|
|
74
|
-
release?: undefined;
|
|
75
|
-
status: 'unsupported';
|
|
76
|
-
resume?: undefined;
|
|
77
|
-
} | {
|
|
78
|
-
status: 'ready';
|
|
79
|
-
resume: UpdateResumeResult;
|
|
80
|
-
retainedClientAssets: readonly [];
|
|
81
|
-
release: () => Promise<void>;
|
|
82
|
-
} | {
|
|
83
|
-
status: 'ready';
|
|
84
|
-
resume: UpdateResumeResult;
|
|
85
|
-
retainedClientAssets: {
|
|
86
|
-
root: string;
|
|
87
|
-
immutableAssets: ReadonlyMap<string, string>;
|
|
88
|
-
}[];
|
|
89
|
-
release: () => Promise<void>;
|
|
90
|
-
}>;
|
|
91
26
|
/** Each channel's signed descriptor for `platform`, as the release workflows publish them. */
|
|
92
27
|
export declare function discoveryNames(platform: InstallerPlatform): Record<UpdateChannel, string>;
|
|
93
28
|
/**
|
|
@@ -106,8 +41,8 @@ export type UpdateInstallRequest = {
|
|
|
106
41
|
approved: boolean;
|
|
107
42
|
restart?: boolean;
|
|
108
43
|
};
|
|
109
|
-
export type { UpdateHealthAcknowledgement } from './
|
|
110
|
-
export type { UpdateShutdownTiming } from './update-shutdown';
|
|
44
|
+
export type { UpdateHealthAcknowledgement } from './retention/retirement-records';
|
|
45
|
+
export type { UpdateShutdownTiming } from './helper/update-shutdown';
|
|
111
46
|
export type UpdaterOptions = {
|
|
112
47
|
appName: string;
|
|
113
48
|
repository: string;
|
|
@@ -169,14 +104,6 @@ export declare function createDesktopUpdater(options: {
|
|
|
169
104
|
quit(timing?: UpdateShutdownTiming): void | Promise<void>;
|
|
170
105
|
log(line: string): void;
|
|
171
106
|
}): Promise<DesktopUpdater>;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export
|
|
175
|
-
/** The `desktop_update_install` argument. */
|
|
176
|
-
export declare function parseUpdateInstall(value: unknown): UpdateInstallRequest;
|
|
177
|
-
/** Register the `desktop_update_*` services the web client's update adapter calls. */
|
|
178
|
-
export declare function registerUpdateServices<Principal>(options: {
|
|
179
|
-
services: Services<Principal>;
|
|
180
|
-
updater: DesktopUpdater;
|
|
181
|
-
authorize(principal: Principal): boolean;
|
|
182
|
-
}): () => void;
|
|
107
|
+
export { updatePlatform, installTarget } from './install-target';
|
|
108
|
+
export { acquireRetainedDesktopClientAssets, resumeAndAcquireRetainedDesktopClientAssets, } from './retained-client-assets';
|
|
109
|
+
export { parseUpdateChannel, parseUpdateInstall, registerUpdateServices } from './update-services';
|