@adea-ai/app-framework 0.37.0 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/create-application.js +1 -1
- package/dist/appearance/appearance-host.js +3 -2
- 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/cli/framework-update-cli.js +1 -1
- package/dist/cli/macos-signing-cli.js +1 -1
- package/dist/cli/release-assets-plan-cli.js +1 -1
- package/dist/cli/release-cut-cli.js +2 -2
- package/dist/cli/release-descriptor-staging-cli.js +2 -2
- package/dist/cli/release-promote-cli.js +1 -1
- package/dist/cli/release-publish-cli.js +1 -1
- package/dist/cli/release-sign-cli.js +1 -1
- package/dist/cli/release-step-cli.js +1 -1
- package/dist/cli/update-helper-cli.js +1 -1
- package/dist/cli/windows-installer-build-cli.js +1 -1
- package/dist/cli/windows-runtime-patch-cli.js +1 -1
- package/dist/desktop/client-assets.js +1 -1
- package/dist/desktop/desktop-client.d.ts +1 -1
- package/dist/desktop/desktop-gateway.js +2 -2
- package/dist/desktop/desktop-host.js +6 -6
- package/dist/desktop/desktop-stream.js +1 -1
- package/dist/framework-source.json +1 -1
- package/dist/installer/command-qualification-command.js +2 -2
- package/dist/installer/installed-payload.js +4 -4
- package/dist/installer/{installer-archive.js → installer-archive-members.js} +2 -2
- package/dist/installer/installer-ci-worker.js +2 -2
- package/dist/installer/installer-extraction.js +3 -3
- 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 +5 -5
- package/dist/installer/installer-process-cleanup.js +1 -1
- package/dist/installer/installer-qualification-command.js +3 -3
- package/dist/installer/installer-renderer-evidence.js +1 -1
- package/dist/installer/installer-upgrade-command.d.ts +2 -2
- package/dist/installer/installer-upgrade-command.js +7 -7
- 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/desktop-build.js +1 -1
- package/dist/native/posix-tree-removal.d.ts +1 -1
- package/dist/native/secure-window.js +1 -1
- package/dist/native/windows-build-hook.js +1 -1
- package/dist/native/windows-extractor-build.js +1 -1
- 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 +4 -4
- package/dist/release/github-release-cut.js +3 -3
- package/dist/release/github-release-promotion.js +2 -2
- 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 +7 -7
- package/dist/release/qualification-run.js +1 -1
- package/dist/release/release-artifact.d.ts +1 -1
- package/dist/release/release-artifact.js +2 -2
- package/dist/release/release-assets-plan.js +2 -2
- package/dist/release/release-config.d.ts +1 -1
- package/dist/release/release-config.js +3 -3
- package/dist/release/release-cut-command.js +1 -1
- package/dist/release/release-descriptor-staging.js +5 -5
- package/dist/release/release-finalize.js +3 -3
- package/dist/release/release-promotion-command.js +2 -2
- package/dist/release/release-promotion.js +1 -1
- package/dist/release/release-publication.d.ts +1 -1
- package/dist/release/release-publication.js +3 -3
- package/dist/release/release-publish-command.js +4 -4
- package/dist/release/release-steps.js +2 -2
- package/dist/release/retained-release-build.js +2 -2
- package/dist/shell/app-utilities.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 +16 -219
- 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} +3 -3
- 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} +10 -10
- 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 +3 -3
- 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 +4 -2
- package/package.json +47 -47
- 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/updates/update-adapter.ts +1 -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
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { toUiVariant } from "./theme-library-schema.js";
|
|
2
|
+
import { defaultPreferenceStorage, quarantineRecord } from "@adea-ai/ui/lib/preference-store";
|
|
3
|
+
// src/appearance/theme-library-store.ts
|
|
4
|
+
var CUSTOM_THEME_LIBRARY_STORAGE_KEY = "appearance.library";
|
|
5
|
+
/**
|
|
6
|
+
* Where an unreadable library is quarantined. It is its own key: the library and
|
|
7
|
+
* the appearance preference used to share `appearance.recovery`, so one could
|
|
8
|
+
* overwrite the other's capture.
|
|
9
|
+
*/
|
|
10
|
+
var CUSTOM_THEME_LIBRARY_RECOVERY_KEY = "appearance.library.recovery";
|
|
11
|
+
var CUSTOM_THEME_LIBRARY_VERSION = 1;
|
|
12
|
+
var CUSTOM_THEME_ID_PREFIX = "custom-";
|
|
13
|
+
var libraryHost = globalThis;
|
|
14
|
+
function library() {
|
|
15
|
+
const existing = libraryHost.__ADEA_THEME_LIBRARY__;
|
|
16
|
+
if (existing && Array.isArray(existing.themes) && existing.listeners) return existing;
|
|
17
|
+
const created = {
|
|
18
|
+
themes: [],
|
|
19
|
+
listeners: existing?.listeners ?? /* @__PURE__ */ new Set(),
|
|
20
|
+
atomicMutationDepth: 0
|
|
21
|
+
};
|
|
22
|
+
libraryHost.__ADEA_THEME_LIBRARY__ = created;
|
|
23
|
+
return created;
|
|
24
|
+
}
|
|
25
|
+
function replaceThemes(themes) {
|
|
26
|
+
const state = library();
|
|
27
|
+
state.themes = Object.freeze([...themes]);
|
|
28
|
+
state.uiVariants = void 0;
|
|
29
|
+
}
|
|
30
|
+
/** The imported themes' stored variants, in import order. */
|
|
31
|
+
function customThemeVariants() {
|
|
32
|
+
return library().themes.map((theme) => theme.variant);
|
|
33
|
+
}
|
|
34
|
+
/** Find one stored variant without projecting the rest of the imported library. */
|
|
35
|
+
function customThemeVariantById(id) {
|
|
36
|
+
return library().themes.find((theme) => theme.variant.id === id)?.variant;
|
|
37
|
+
}
|
|
38
|
+
/** The imported themes as shared-provider variants: what the provider's `themes` takes. */
|
|
39
|
+
function customUiVariants() {
|
|
40
|
+
const state = library();
|
|
41
|
+
state.uiVariants ??= Object.freeze(state.themes.map(toUiVariant));
|
|
42
|
+
return state.uiVariants;
|
|
43
|
+
}
|
|
44
|
+
function handlePersistentLibraryChange(event) {
|
|
45
|
+
if (event.key !== "appearance.library" && event.key !== null) return;
|
|
46
|
+
const storage = defaultPreferenceStorage();
|
|
47
|
+
if (!storage || event.storageArea !== storage) return;
|
|
48
|
+
readCustomThemeLibrary(storage);
|
|
49
|
+
}
|
|
50
|
+
function observePersistentLibraryChanges() {
|
|
51
|
+
const state = library();
|
|
52
|
+
if (state.storageEventTarget || typeof window === "undefined") return;
|
|
53
|
+
const target = window;
|
|
54
|
+
const listener = handlePersistentLibraryChange;
|
|
55
|
+
state.storageEventTarget = target;
|
|
56
|
+
state.storageEventListener = listener;
|
|
57
|
+
target.addEventListener("storage", listener);
|
|
58
|
+
}
|
|
59
|
+
function subscribeCustomThemes(listener) {
|
|
60
|
+
observePersistentLibraryChanges();
|
|
61
|
+
const { listeners } = library();
|
|
62
|
+
listeners.add(listener);
|
|
63
|
+
return () => listeners.delete(listener);
|
|
64
|
+
}
|
|
65
|
+
function notifyCustomThemes() {
|
|
66
|
+
const { listeners } = library();
|
|
67
|
+
for (const listener of [...listeners]) {
|
|
68
|
+
if (!listeners.has(listener)) continue;
|
|
69
|
+
try {
|
|
70
|
+
Promise.resolve(listener()).catch(() => {});
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function isCustomThemeId(id) {
|
|
75
|
+
return id.startsWith(CUSTOM_THEME_ID_PREFIX);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Replace the in-memory imported-theme set and tell subscribers. Durable mutations
|
|
79
|
+
* must use `mutateCustomThemeLibrary`; this deprecated synchronous API fails closed
|
|
80
|
+
* when a storage adapter is supplied because it cannot acquire the shared lock.
|
|
81
|
+
*
|
|
82
|
+
* @deprecated Use `mutateCustomThemeLibrary` for persisted read/modify/write operations.
|
|
83
|
+
*/
|
|
84
|
+
function setCustomThemes(themes, storage) {
|
|
85
|
+
if ((library().atomicMutationDepth ?? 0) > 0) return false;
|
|
86
|
+
if (storage) return false;
|
|
87
|
+
replaceThemes(namespaceCustomThemes(themes));
|
|
88
|
+
notifyCustomThemes();
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
function namespaceCustomThemes(themes) {
|
|
92
|
+
return themes.map((theme) => {
|
|
93
|
+
if (isCustomThemeId(theme.id)) return theme;
|
|
94
|
+
const id = `${CUSTOM_THEME_ID_PREFIX}${theme.id}`;
|
|
95
|
+
return {
|
|
96
|
+
...theme,
|
|
97
|
+
id,
|
|
98
|
+
variant: {
|
|
99
|
+
...theme.variant,
|
|
100
|
+
id
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
106
|
+
var fields = (value, names) => object(value) && names.every((name) => typeof value[name] === "string");
|
|
107
|
+
function isStoredTheme(entry) {
|
|
108
|
+
if (!object(entry) || !object(entry.variant)) return false;
|
|
109
|
+
const theme = entry;
|
|
110
|
+
const variant = entry.variant;
|
|
111
|
+
return typeof theme.id === "string" && typeof theme.name === "string" && (theme.appearance === "light" || theme.appearance === "dark") && typeof theme.importedAt === "string" && fields(variant, [
|
|
112
|
+
"id",
|
|
113
|
+
"familyId",
|
|
114
|
+
"familyName",
|
|
115
|
+
"name"
|
|
116
|
+
]) && (variant.appearance === "light" || variant.appearance === "dark") && fields(variant.colors, [
|
|
117
|
+
"background",
|
|
118
|
+
"foreground",
|
|
119
|
+
"card",
|
|
120
|
+
"cardForeground",
|
|
121
|
+
"popover",
|
|
122
|
+
"popoverForeground",
|
|
123
|
+
"primary",
|
|
124
|
+
"primaryForeground",
|
|
125
|
+
"secondary",
|
|
126
|
+
"secondaryForeground",
|
|
127
|
+
"muted",
|
|
128
|
+
"mutedForeground",
|
|
129
|
+
"accent",
|
|
130
|
+
"accentForeground",
|
|
131
|
+
"destructive",
|
|
132
|
+
"destructiveAction",
|
|
133
|
+
"destructiveActionForeground",
|
|
134
|
+
"success",
|
|
135
|
+
"border",
|
|
136
|
+
"input",
|
|
137
|
+
"ring"
|
|
138
|
+
]) && fields(variant.terminal, [
|
|
139
|
+
"background",
|
|
140
|
+
"foreground",
|
|
141
|
+
"cursor",
|
|
142
|
+
"selection"
|
|
143
|
+
]) && object(variant.terminal) && Array.isArray(variant.terminal.ansi) && variant.terminal.ansi.length === 16 && variant.terminal.ansi.every((color) => typeof color === "string") && fields(variant.editor, [
|
|
144
|
+
"keyword",
|
|
145
|
+
"string",
|
|
146
|
+
"number",
|
|
147
|
+
"comment",
|
|
148
|
+
"function",
|
|
149
|
+
"variable",
|
|
150
|
+
"type",
|
|
151
|
+
"tag",
|
|
152
|
+
"attribute",
|
|
153
|
+
"operator",
|
|
154
|
+
"heading",
|
|
155
|
+
"link",
|
|
156
|
+
"diffAdd",
|
|
157
|
+
"diffDelete",
|
|
158
|
+
"diffHunk",
|
|
159
|
+
"searchMatch"
|
|
160
|
+
]) && fields(variant.charts, [
|
|
161
|
+
"chart1",
|
|
162
|
+
"chart2",
|
|
163
|
+
"chart3",
|
|
164
|
+
"chart4",
|
|
165
|
+
"chart5",
|
|
166
|
+
"chart6"
|
|
167
|
+
]) && object(theme.flatTokens) && Object.values(theme.flatTokens).every((value) => typeof value === "string") && Array.isArray(theme.notes) && theme.notes.every((note) => typeof note === "string");
|
|
168
|
+
}
|
|
169
|
+
function parseLibrary(raw) {
|
|
170
|
+
let value;
|
|
171
|
+
try {
|
|
172
|
+
value = JSON.parse(raw);
|
|
173
|
+
} catch {
|
|
174
|
+
return {
|
|
175
|
+
themes: [],
|
|
176
|
+
reason: "corrupt_json"
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (!object(value) || value.version !== 1 || !Array.isArray(value.themes)) return {
|
|
180
|
+
themes: [],
|
|
181
|
+
reason: "unsupported_record"
|
|
182
|
+
};
|
|
183
|
+
const themes = value.themes.filter(isStoredTheme);
|
|
184
|
+
return themes.length === value.themes.length ? { themes } : {
|
|
185
|
+
themes,
|
|
186
|
+
reason: "unsupported_record"
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function preserveLibrary(storage, raw, reason) {
|
|
190
|
+
if (!storage.getItem("appearance.library.recovery")) quarantineRecord(storage, CUSTOM_THEME_LIBRARY_RECOVERY_KEY, raw, reason);
|
|
191
|
+
const saved = storage.getItem(CUSTOM_THEME_LIBRARY_RECOVERY_KEY);
|
|
192
|
+
try {
|
|
193
|
+
const capture = saved && JSON.parse(saved);
|
|
194
|
+
return object(capture) && capture.schemaVersion === 1 && capture.raw === raw;
|
|
195
|
+
} catch {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Read the stored library. A malformed document starts an empty library and
|
|
201
|
+
* quarantines the raw bytes into the library's own recovery key, mirroring the
|
|
202
|
+
* appearance-preference recovery contract; individual invalid records are dropped,
|
|
203
|
+
* not fatal.
|
|
204
|
+
*/
|
|
205
|
+
function readCustomThemeLibrary(storage) {
|
|
206
|
+
if (!storage) return [];
|
|
207
|
+
const result = tryReadCustomThemeLibrary(storage);
|
|
208
|
+
if (result?.changed) notifyCustomThemes();
|
|
209
|
+
return result?.themes ?? [];
|
|
210
|
+
}
|
|
211
|
+
function sameThemeValue(left, right) {
|
|
212
|
+
if (Object.is(left, right)) return true;
|
|
213
|
+
if (!left || !right || typeof left !== "object" || typeof right !== "object") return false;
|
|
214
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
215
|
+
if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
|
|
216
|
+
if (Object.getPrototypeOf(left) !== Array.prototype) return false;
|
|
217
|
+
if (Reflect.ownKeys(left).length !== left.length + 1) return false;
|
|
218
|
+
for (let index = 0; index < left.length; index++) {
|
|
219
|
+
const entry = Object.getOwnPropertyDescriptor(left, index);
|
|
220
|
+
if (!entry || !entry.enumerable || !("value" in entry)) return false;
|
|
221
|
+
if (!sameThemeValue(entry.value, right[index])) return false;
|
|
222
|
+
}
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
if (Object.getPrototypeOf(left) !== Object.prototype) return false;
|
|
226
|
+
const leftKeys = Object.keys(left);
|
|
227
|
+
const rightKeys = Object.keys(right);
|
|
228
|
+
if (leftKeys.length !== rightKeys.length || Reflect.ownKeys(left).length !== leftKeys.length) return false;
|
|
229
|
+
const rightRecord = right;
|
|
230
|
+
return leftKeys.every((key) => {
|
|
231
|
+
const entry = Object.getOwnPropertyDescriptor(left, key);
|
|
232
|
+
return !!entry && "value" in entry && Object.hasOwn(rightRecord, key) && sameThemeValue(entry.value, rightRecord[key]);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/** A failed read must not be confused with a successfully read empty library. */
|
|
236
|
+
function tryReadCustomThemeLibrary(storage) {
|
|
237
|
+
const state = library();
|
|
238
|
+
const previousThemes = state.themes;
|
|
239
|
+
try {
|
|
240
|
+
const raw = storage.getItem(CUSTOM_THEME_LIBRARY_STORAGE_KEY);
|
|
241
|
+
const { themes, reason } = raw ? parseLibrary(raw) : { themes: [] };
|
|
242
|
+
if (raw && reason) preserveLibrary(storage, raw, reason);
|
|
243
|
+
let changed = true;
|
|
244
|
+
try {
|
|
245
|
+
changed = !sameThemeValue(previousThemes, themes);
|
|
246
|
+
} catch {}
|
|
247
|
+
if (storage.getItem("appearance.library") !== raw || library() !== state || state.themes !== previousThemes) return void 0;
|
|
248
|
+
if (changed) replaceThemes(themes);
|
|
249
|
+
return {
|
|
250
|
+
themes: changed ? themes : previousThemes,
|
|
251
|
+
changed
|
|
252
|
+
};
|
|
253
|
+
} catch {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Synchronous legacy removal for the in-memory library. Passing storage fails closed;
|
|
259
|
+
* use `removeCustomThemeAtomically` for persisted removals.
|
|
260
|
+
*
|
|
261
|
+
* @deprecated Use `removeCustomThemeAtomically` for persisted removals.
|
|
262
|
+
*/
|
|
263
|
+
function removeCustomTheme(id, storage) {
|
|
264
|
+
if (storage) return false;
|
|
265
|
+
const themes = library().themes;
|
|
266
|
+
return setCustomThemes(themes.filter((theme) => theme.id !== id), storage);
|
|
267
|
+
}
|
|
268
|
+
export { CUSTOM_THEME_LIBRARY_RECOVERY_KEY, CUSTOM_THEME_LIBRARY_STORAGE_KEY, CUSTOM_THEME_LIBRARY_VERSION, customThemeVariantById, customThemeVariants, customUiVariants, library, namespaceCustomThemes, notifyCustomThemes, parseLibrary, preserveLibrary, readCustomThemeLibrary, removeCustomTheme, replaceThemes, setCustomThemes, subscribeCustomThemes };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "./appearance-preferences.js";
|
|
2
|
-
import {
|
|
2
|
+
import { storedVariantRecord } from "./theme-library-schema.js";
|
|
3
|
+
import { customThemeVariantById, customThemeVariants } from "./theme-library-store.js";
|
|
4
|
+
import "./custom-theme-library.js";
|
|
3
5
|
import { themeRegistry } from "./theme-registry.js";
|
|
4
6
|
import { accentRolesForSelection, themeRecordById, themeRecords, tokensAsHex } from "@adea-ai/ui/lib/themes";
|
|
5
7
|
import { getAccent } from "@adea-ai/ui/lib/accent-presets";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { customUiVariants } from "./
|
|
1
|
+
import { customUiVariants } from "./theme-library-store.js";
|
|
2
|
+
import "./custom-theme-library.js";
|
|
2
3
|
import { builtinThemes } from "@adea-ai/ui/lib/themes";
|
|
3
4
|
// src/appearance/theme-registry.ts
|
|
4
5
|
var registriesByCustomVariants = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { runCli } from "./cli-runner.js";
|
|
3
2
|
import { applyFrameworkUpdate, resolveFrameworkRelease } from "../release/framework-update.js";
|
|
4
3
|
import { withFrameworkUpdateLock } from "../release/framework-update-lock.js";
|
|
4
|
+
import { runCli } from "./cli-runner.js";
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
6
|
// src/cli/framework-update-cli.ts
|
|
7
7
|
await runCli((error) => `App-framework update failed. ${error.message}`, async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { runCli } from "./cli-runner.js";
|
|
3
2
|
import { verifyMacosBundleSigning } from "../release/macos-signing.js";
|
|
3
|
+
import { runCli } from "./cli-runner.js";
|
|
4
4
|
// src/cli/macos-signing-cli.ts
|
|
5
5
|
await runCli("Unable to check the app signing; run it on macOS with codesign.", async () => {
|
|
6
6
|
const [app, flag, ...extra] = process.argv.slice(2);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { planReleaseAssets } from "../release/release-assets-plan.js";
|
|
3
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
4
4
|
// src/cli/release-assets-plan-cli.ts
|
|
5
5
|
await runCli("Unable to plan release assets; check release provenance and the trusted workflow.", async () => {
|
|
6
6
|
const [tag, path, ...extra] = process.argv.slice(2);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, redactedErrorMessage, runCli } from "./cli-runner.js";
|
|
3
|
-
import { gitCli } from "../release/local-provenance.js";
|
|
4
2
|
import { runReleaseCutCommand } from "../release/release-cut-command.js";
|
|
3
|
+
import { gitCli } from "../release/local-provenance.js";
|
|
5
4
|
import { hostReleasePlatform, runLocalReleaseCut } from "../release/local-release.js";
|
|
5
|
+
import { readJsonFile, redactedErrorMessage, runCli } from "./cli-runner.js";
|
|
6
6
|
// src/cli/release-cut-cli.ts
|
|
7
7
|
var local = process.argv[2] === "--local";
|
|
8
8
|
await runCli((error) => `Unable to cut the release: ${redactedErrorMessage(error)}. Check the trusted workflow or local checkout and release configuration.`, async () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { gitCli } from "../release/local-provenance.js";
|
|
4
|
-
import { stageReleaseDescriptors } from "../release/release-descriptor-staging.js";
|
|
5
3
|
import { hostReleasePlatform, localTagProvenance, stageLocalDescriptors } from "../release/local-release.js";
|
|
4
|
+
import { stageReleaseDescriptors } from "../release/release-descriptor-staging.js";
|
|
5
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
6
6
|
import { createPrivateKey } from "node:crypto";
|
|
7
7
|
// src/cli/release-descriptor-staging-cli.ts
|
|
8
8
|
var local = process.argv[2] === "--local";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { gitCli, originRepository } from "../release/local-provenance.js";
|
|
4
3
|
import { runLocalPromotion } from "../release/local-release.js";
|
|
5
4
|
import { runPromotionCommand } from "../release/release-promotion-command.js";
|
|
5
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
6
6
|
// src/cli/release-promote-cli.ts
|
|
7
7
|
var local = process.argv[2] === "--local";
|
|
8
8
|
await runCli("Unable to promote the release; check the trusted workflow or feed and release configuration.", async () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { gitCli } from "../release/local-provenance.js";
|
|
4
3
|
import { hostReleasePlatform, localTagProvenance, stageLocalRelease } from "../release/local-release.js";
|
|
5
4
|
import { runReleasePublishCommand } from "../release/release-publish-command.js";
|
|
5
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
6
6
|
// src/cli/release-publish-cli.ts
|
|
7
7
|
var local = process.argv[2] === "--local";
|
|
8
8
|
await runCli("Unable to publish release artifacts; check the trusted workflow or local checkout, receipts, signing configuration and staged bytes.", async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { signReleaseArtifact } from "../release/release-artifact.js";
|
|
3
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
4
4
|
import { createPrivateKey } from "node:crypto";
|
|
5
5
|
// src/cli/release-sign-cli.ts
|
|
6
6
|
await runCli("Unable to sign release artifact; check the identity, archive and signing key.", async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
3
2
|
import { inspectStagedStep, qualifyStep, qualifyUpgradeStep, releasePlatform, selectRetainedStep, stageBuildStep } from "../release/release-steps.js";
|
|
3
|
+
import { readJsonFile, runCli } from "./cli-runner.js";
|
|
4
4
|
// src/cli/release-step-cli.ts
|
|
5
5
|
await runCli((error) => `Release step failed: ${error instanceof Error ? error.message : String(error)}`, async () => {
|
|
6
6
|
const args = process.argv.slice(2);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { redactedErrorMessage, runCli } from "./cli-runner.js";
|
|
3
2
|
import { buildPatchedWindowsInstaller } from "../native/windows-extractor-build.js";
|
|
3
|
+
import { redactedErrorMessage, runCli } from "./cli-runner.js";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
// src/cli/windows-installer-build-cli.ts
|
|
6
6
|
await runCli((error) => `Unable to build the patched Windows installer: ${redactedErrorMessage(error)}`, async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { runCli } from "./cli-runner.js";
|
|
3
2
|
import { SECURE_WINDOWS_WRAPPER_SHA256, patchPinnedWindowsRuntime } from "../native/windows-runtime-patch.js";
|
|
3
|
+
import { runCli } from "./cli-runner.js";
|
|
4
4
|
import { readFile, stat, writeFile } from "node:fs/promises";
|
|
5
5
|
// src/cli/windows-runtime-patch-cli.ts
|
|
6
6
|
await runCli("Unable to patch the pinned unsigned Windows runtime.", async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CLIENT_ASSET_ASSET_PATTERN, CLIENT_ASSET_CHUNK_PATTERN, CLIENT_ASSET_MANIFEST_FILE, clientAssetAssetEvidenceKey, clientAssetChunkEvidenceKey, createClientAssetManifest, parseClientAssetManifest, snapshotClientAssetAllowlist } from "./client-asset-manifest.js";
|
|
2
1
|
import { createClientAssetFileLimit, createClientAssetStream, createClientAssetVerificationCache, verifyClientAssetCached, verifyClientAssetDigest } from "./client-asset-stream.js";
|
|
2
|
+
import { CLIENT_ASSET_ASSET_PATTERN, CLIENT_ASSET_CHUNK_PATTERN, CLIENT_ASSET_MANIFEST_FILE, clientAssetAssetEvidenceKey, clientAssetChunkEvidenceKey, createClientAssetManifest, parseClientAssetManifest, snapshotClientAssetAllowlist } from "./client-asset-manifest.js";
|
|
3
3
|
import { open, readFile, realpath, stat } from "node:fs/promises";
|
|
4
4
|
import { extname, join, posix, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceResult } from '../app/service-registry';
|
|
2
|
-
import type { FetchFunction } from '../updates/release-location';
|
|
2
|
+
import type { FetchFunction } from '../updates/feed/release-location';
|
|
3
3
|
type Bootstrap = (signal?: AbortSignal) => Promise<{
|
|
4
4
|
bootstrap: string;
|
|
5
5
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MAX_SERVICE_BODY_BYTES } from "../app/service-registry.js";
|
|
2
|
-
import { createChannelProofVerifier } from "./channel-proof.js";
|
|
3
1
|
import { createLoopbackPolicy, matchesLoopbackOrigin } from "./loopback-policy.js";
|
|
2
|
+
import { createChannelProofVerifier } from "./channel-proof.js";
|
|
3
|
+
import { MAX_SERVICE_BODY_BYTES } from "../app/service-registry.js";
|
|
4
4
|
import { isValidGatewayTimeoutMs } from "./gateway-limits.js";
|
|
5
5
|
// src/desktop/desktop-gateway.ts
|
|
6
6
|
var response = (status) => new Response(null, {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { errorCode } from "../app/value-guards.js";
|
|
2
|
-
import {
|
|
2
|
+
import { publishDesktopPort } from "./desktop-port-file.js";
|
|
3
3
|
import { createClientAssetFileLimit, createClientAssetVerificationCache } from "./client-asset-stream.js";
|
|
4
4
|
import { createClientAssetResolver } from "./client-assets.js";
|
|
5
|
-
import {
|
|
6
|
-
import { createLoopbackPolicy, matchesLoopbackOrigin } from "./loopback-policy.js";
|
|
7
|
-
import { isValidGatewayTimeoutMs } from "./gateway-limits.js";
|
|
5
|
+
import { createChannelAuthority } from "./channel-handshake.js";
|
|
8
6
|
import { createDesktopGateway } from "./desktop-gateway.js";
|
|
9
|
-
import { DESKTOP_STREAM_BACKPRESSURE_LIMIT, sendDesktopStreamPayload } from "./desktop-host-websocket.js";
|
|
10
|
-
import { publishDesktopPort } from "./desktop-port-file.js";
|
|
11
7
|
import { createNativeWindowGrant } from "../native/window-bootstrap.js";
|
|
12
8
|
import { createSecureWindow } from "../native/secure-window.js";
|
|
13
9
|
import { createDesktopStreams } from "./desktop-stream.js";
|
|
10
|
+
import { DESKTOP_STREAM_BACKPRESSURE_LIMIT, sendDesktopStreamPayload } from "./desktop-host-websocket.js";
|
|
11
|
+
import { createLoopbackPolicy, matchesLoopbackOrigin } from "./loopback-policy.js";
|
|
12
|
+
import { isValidGatewayTimeoutMs } from "./gateway-limits.js";
|
|
13
|
+
import { ClientResponseLifecycleClosedError, createClientResponseLifecycleTracker } from "./client-response-lifecycle.js";
|
|
14
14
|
import { lstatSync, readFileSync } from "node:fs";
|
|
15
15
|
// src/desktop/desktop-host.ts
|
|
16
16
|
var DesktopPortInUseError = class extends Error {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createChannelProofVerifier } from "./channel-proof.js";
|
|
2
1
|
import { typedArrayBuffer, typedArrayByteLength, typedArrayByteOffset } from "./typed-array-intrinsics.js";
|
|
2
|
+
import { createChannelProofVerifier } from "./channel-proof.js";
|
|
3
3
|
import { types } from "node:util";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
5
|
// src/desktop/desktop-stream.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.37.
|
|
1
|
+
{"version":"0.37.2","commit":"54bc60527c162b7a41ee4714e14760c78e88168d"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { errorCode } from "../app/value-guards.js";
|
|
2
2
|
import { assertInstallerContext } from "./installer-layout.js";
|
|
3
|
-
import { validateCommandReceipt } from "../release/release-qualification.js";
|
|
4
|
-
import { parseReleaseConfig } from "../release/release-config.js";
|
|
5
3
|
import { qualifyCommandArtifact } from "./command-artifact.js";
|
|
6
4
|
import { planQualificationRun } from "../release/qualification-run.js";
|
|
5
|
+
import { parseReleaseConfig } from "../release/release-config.js";
|
|
6
|
+
import { validateCommandReceipt } from "../release/release-qualification.js";
|
|
7
7
|
import { fileIdentity } from "../release/release-publication.js";
|
|
8
8
|
import { lstat, writeFile } from "node:fs/promises";
|
|
9
9
|
import { join, resolve } from "node:path";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assertArchiveUnchanged, findArchiveMember, isWithin } from "./installer-archive-members.js";
|
|
2
2
|
import { runnerTemp } from "./hosted-runner.js";
|
|
3
|
-
import {
|
|
4
|
-
import { hashFileAt } from "../updates/stable-file.js";
|
|
3
|
+
import { hashFileAt } from "../updates/locks/stable-file.js";
|
|
5
4
|
import { assertNativeExecutable } from "./native-executable.js";
|
|
6
|
-
import {
|
|
5
|
+
import { assertBuildMetadata, assertInstallerContext, assertPayloadLayout, assertPortableAppName } from "./installer-layout.js";
|
|
6
|
+
import { assertSidecarNames, sidecarBundlePath } from "../native/app-bundle.js";
|
|
7
7
|
import { lstat, open, realpath, rm } from "node:fs/promises";
|
|
8
8
|
import { join, resolve } from "node:path";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { sameFile } from "../updates/stable-file.js";
|
|
2
1
|
import { assertNativeExecutable } from "./native-executable.js";
|
|
2
|
+
import { sameFile } from "../updates/locks/stable-file.js";
|
|
3
3
|
import { lstat, open } from "node:fs/promises";
|
|
4
4
|
import { isAbsolute, relative, sep } from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
|
-
// src/installer/installer-archive.ts
|
|
6
|
+
// src/installer/installer-archive-members.ts
|
|
7
7
|
var EMBEDDED_ARCHIVE_MARKER = Buffer.from("ELECTROBUN_ARCHIVE_V1");
|
|
8
8
|
/** Whether `path` lies strictly inside `root`, judged lexically. */
|
|
9
9
|
function isWithin(root, path) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { parseOfflinePolicy } from "../release/release-qualification.js";
|
|
2
|
-
import { installInstallerRendererProbe } from "./installer-renderer-evidence.js";
|
|
3
1
|
import { installInstallerFetchGuard } from "./installer-fetch-guard.js";
|
|
2
|
+
import { installInstallerRendererProbe } from "./installer-renderer-evidence.js";
|
|
3
|
+
import { parseOfflinePolicy } from "../release/release-qualification.js";
|
|
4
4
|
import { awaitInstallerWorkerPermit, interceptInstallerWorker } from "./installer-worker-guard.js";
|
|
5
5
|
import { isAbsolute } from "node:path";
|
|
6
6
|
import { writeFileSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { assertEmbeddedArchive, assertInstallerExecutable, extractArchiveMember, findArchiveMember, isWithin } from "./installer-archive-members.js";
|
|
1
2
|
import { runnerTemp } from "./hosted-runner.js";
|
|
3
|
+
import { hashFileAt } from "../updates/locks/stable-file.js";
|
|
2
4
|
import { assertInstallerContext, assertInstallerLayout, assertPortableAppName } from "./installer-layout.js";
|
|
3
|
-
import {
|
|
4
|
-
import { assertEmbeddedArchive, assertInstallerExecutable, extractArchiveMember, findArchiveMember, isWithin } from "./installer-archive.js";
|
|
5
|
+
import { verifyInstallerPayload } from "./installer-identity.js";
|
|
5
6
|
import { cleanupInstallerDirectoryAfterFailure, defaultInstallerImageMountIo, withInstallerImageRetries } from "./installer-image-mount.js";
|
|
6
7
|
import { runInstallerCommand } from "./installer-command.js";
|
|
7
|
-
import { verifyInstallerPayload } from "./installer-identity.js";
|
|
8
8
|
import { chmod, lstat, mkdir, mkdtemp, readdir, realpath } from "node:fs/promises";
|
|
9
9
|
import { join, resolve, win32 } from "node:path";
|
|
10
10
|
// src/installer/installer-extraction.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchFunction } from '../updates/release-location';
|
|
1
|
+
import type { FetchFunction } from '../updates/feed/release-location';
|
|
2
2
|
/** CI preflight only: block external fetches while recording unexpected activity.
|
|
3
3
|
* This does not intercept sockets, subprocesses, or webview networking. */
|
|
4
4
|
export declare function installInstallerFetchGuard(options: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { assertEmbeddedArchive, assertInstallerExecutable, extractArchiveMember, findArchiveMember, isWithin, normalizeArchiveMember } from "./installer-archive-members.js";
|
|
2
|
+
import { hashFileAt } from "../updates/locks/stable-file.js";
|
|
1
3
|
import { assertInstallerContext, assertInstallerHost, assertInstallerLayout, assertPortableAppName } from "./installer-layout.js";
|
|
2
|
-
import { hashFileAt } from "../updates/stable-file.js";
|
|
3
|
-
import { assertEmbeddedArchive, assertInstallerExecutable, extractArchiveMember, findArchiveMember, isWithin, normalizeArchiveMember } from "./installer-archive.js";
|
|
4
4
|
import { InstallerImageLifecycleError, cleanupInstallerDirectoryAfterFailure, defaultInstallerImageMountIo, installerImageMountState, withInstallerImageRetries } from "./installer-image-mount.js";
|
|
5
5
|
import { runInstallerCommand } from "./installer-command.js";
|
|
6
6
|
import { lstat, mkdtemp, readdir, realpath } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type InstallerPlatform, type InstallerRenderer } from './installer-layout';
|
|
2
2
|
import { type InstallerRendererObservation } from './installer-renderer-evidence';
|
|
3
3
|
import { type Artifact, type OfflinePolicy, type RendererEvidence } from '../release/release-qualification';
|
|
4
|
-
import type { ReleaseTrust, VerifiedRelease } from '../updates/signed-release';
|
|
4
|
+
import type { ReleaseTrust, VerifiedRelease } from '../updates/feed/signed-release';
|
|
5
5
|
/** Whether the runner should start the installed app on this loop iteration.
|
|
6
6
|
*
|
|
7
7
|
* Electrobun's Windows and Linux extractors (since 2.0.1, `launchInstalledApp` in
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { errorCode } from "../app/value-guards.js";
|
|
2
|
-
import { assertInstallerContext, assertPortableAppName } from "./installer-layout.js";
|
|
3
|
-
import { parseOfflinePolicy } from "../release/release-qualification.js";
|
|
4
|
-
import { verifyInstallerPayload } from "./installer-identity.js";
|
|
5
2
|
import { preflightInstallerRuntime, prepareInstallerCiBootstrap } from "./installer-ci-bootstrap.js";
|
|
6
3
|
import { prepareInstallerExecution } from "./installer-extraction.js";
|
|
4
|
+
import { verifyInstallerPayload } from "./installer-identity.js";
|
|
5
|
+
import { assertInstallerContext, assertPortableAppName } from "./installer-layout.js";
|
|
7
6
|
import { assertInstallerRendererObservation } from "./installer-renderer-evidence.js";
|
|
8
7
|
import { extractCandidateRuntime, verifyInstalledPayload } from "./installed-payload.js";
|
|
8
|
+
import { parseOfflinePolicy } from "../release/release-qualification.js";
|
|
9
9
|
import { terminateGuardedWorker } from "./installer-process-cleanup.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { stageUpdateSwap } from "../updates/install/update-swap-stage.js";
|
|
11
|
+
import { swapUpdateTree } from "../updates/install/update-swap.js";
|
|
12
12
|
import { chmod, lstat, mkdir, readFile, realpath, writeFile } from "node:fs/promises";
|
|
13
13
|
import { delimiter, dirname, join } from "node:path";
|
|
14
14
|
import { randomBytes } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertInstallerContext } from "./installer-layout.js";
|
|
2
1
|
import { windowsProcessImage } from "../native/windows-process.js";
|
|
2
|
+
import { assertInstallerContext } from "./installer-layout.js";
|
|
3
3
|
import { realpath } from "node:fs/promises";
|
|
4
4
|
import { execFile } from "node:child_process";
|
|
5
5
|
import { promisify } from "node:util";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { errorCode } from "../app/value-guards.js";
|
|
2
|
-
import { validateInstallerReceipt } from "../release/release-qualification.js";
|
|
3
|
-
import { parseReleaseConfig } from "../release/release-config.js";
|
|
4
|
-
import { planQualificationRun } from "../release/qualification-run.js";
|
|
5
2
|
import { observeInstalledApp } from "./installer-observation.js";
|
|
3
|
+
import { planQualificationRun } from "../release/qualification-run.js";
|
|
4
|
+
import { parseReleaseConfig } from "../release/release-config.js";
|
|
5
|
+
import { validateInstallerReceipt } from "../release/release-qualification.js";
|
|
6
6
|
import { lstat, writeFile } from "node:fs/promises";
|
|
7
7
|
import { join, resolve } from "node:path";
|
|
8
8
|
// src/installer/installer-qualification-command.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assertHostedRunner } from "./hosted-runner.js";
|
|
2
1
|
import { parseOfflinePolicy } from "../release/release-qualification.js";
|
|
3
2
|
import { discardStream } from "../shared/discard-stream.js";
|
|
3
|
+
import { assertHostedRunner } from "./hosted-runner.js";
|
|
4
4
|
// src/installer/installer-renderer-evidence.ts
|
|
5
5
|
function safeScriptString(value) {
|
|
6
6
|
return JSON.stringify(value).replaceAll("<", "\\u003c").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { InstallerPlatform, InstallerRenderer } from './installer-layout';
|
|
2
2
|
import type { RendererEvidence } from '../release/release-qualification';
|
|
3
|
-
import type { FetchFunction } from '../updates/release-location';
|
|
4
|
-
import { type ReleaseDescriptor } from '../updates/signed-release';
|
|
3
|
+
import type { FetchFunction } from '../updates/feed/release-location';
|
|
4
|
+
import { type ReleaseDescriptor } from '../updates/feed/signed-release';
|
|
5
5
|
export type UpgradeReceipt = {
|
|
6
6
|
schema: 1;
|
|
7
7
|
tag: string;
|