@adea-ai/app-framework-release-tools 0.1.0 → 0.2.0

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/index.js CHANGED
@@ -97,6 +97,149 @@ function sidecarBundlePath(name, platform) {
97
97
  return `Resources/app/${SIDECAR_DIRECTORY}/${sidecarFileName(name, platform)}`;
98
98
  }
99
99
 
100
+ // ../../src/updates/feed/arch-package-policy.ts
101
+ var packageName = /^[a-z0-9][a-z0-9@+._-]{0,63}$/;
102
+ var executableName = /^[a-z][a-z0-9-]{0,63}$/;
103
+ var licenseToken = /^[A-Za-z0-9][A-Za-z0-9.+:-]{0,63}$/;
104
+ var category = /^[A-Za-z][A-Za-z0-9-]{0,31}$/;
105
+ var relative = /^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/;
106
+ var optdependsEntry = /^[a-z0-9][a-z0-9@+._-]{0,63}(?:: [^<>\r\n]{1,128})?$/;
107
+ function assert(condition, message) {
108
+ if (!condition)
109
+ throw new Error(message);
110
+ }
111
+ function text(value, maximum) {
112
+ return typeof value === "string" && value.length > 0 && value.length <= maximum && !containsAsciiControl(value) && value.trim() === value;
113
+ }
114
+ function httpsUrl(value) {
115
+ if (typeof value !== "string" || value.length > 300)
116
+ return false;
117
+ let url;
118
+ try {
119
+ url = new URL(value);
120
+ } catch {
121
+ return false;
122
+ }
123
+ return url.protocol === "https:" && (url.href === value || url.pathname === "/" && url.href === `${value}/`) && !url.username && !url.password && !url.port && !url.search && !url.hash;
124
+ }
125
+ function sourceTemplate(value) {
126
+ if (typeof value !== "string" || !value.includes("{tag}"))
127
+ return false;
128
+ const rest = value.replaceAll("{tag}", "");
129
+ return !rest.includes("{") && !rest.includes("}") && httpsUrl(value.replaceAll("{tag}", "v1.0.0"));
130
+ }
131
+ function tokenList(value, options) {
132
+ assert(Array.isArray(value) && value.length >= options.minimum && value.length <= options.maximum && value.every((item) => typeof item === "string" && item.length <= 200 && options.pattern.test(item) && !containsAsciiControl(item)) && new Set(value).size === value.length, options.message);
133
+ return [...value];
134
+ }
135
+ function bundlePath(value, suffix) {
136
+ return typeof value === "string" && value.length <= 200 && relative.test(value) && !value.split("/").some((part) => part === "." || part === "..") && (suffix === undefined || value.endsWith(suffix));
137
+ }
138
+ var policyKeys = new Set([
139
+ "pkgname",
140
+ "pkgdesc",
141
+ "maintainer",
142
+ "url",
143
+ "license",
144
+ "depends",
145
+ "optdepends",
146
+ "provides",
147
+ "conflicts",
148
+ "executable",
149
+ "setuid",
150
+ "desktop",
151
+ "icon",
152
+ "licenseSource",
153
+ "links",
154
+ "channel",
155
+ "repository"
156
+ ]);
157
+ function parseArchPackage(value) {
158
+ assert(isRecord(value) && Object.keys(value).every((key) => policyKeys.has(key)), "Invalid Arch package configuration");
159
+ const policy = value;
160
+ const desktop = policy.desktop;
161
+ const links = policy.links ?? [];
162
+ assert(typeof policy.pkgname === "string" && packageName.test(policy.pkgname) && policy.pkgname.endsWith("-bin"), "Arch package name must be a lowercase pkgname ending in -bin");
163
+ assert(text(policy.pkgdesc, 256), "Invalid Arch package description");
164
+ assert(text(policy.maintainer, 128) && /^[^<>\r\n]{1,64} <[^<>\r\n]{3,64}>$/.test(policy.maintainer), "Invalid Arch package maintainer");
165
+ assert(httpsUrl(policy.url), "Invalid Arch package URL");
166
+ assert(text(policy.executable, 64) && executableName.test(policy.executable), "Invalid Arch executable");
167
+ assert(policy.icon === undefined || bundlePath(policy.icon, ".svg"), "Invalid Arch package icon");
168
+ assert(policy.licenseSource === undefined || sourceTemplate(policy.licenseSource), "Invalid Arch license source");
169
+ assert(isRecord(desktop) && Object.keys(desktop).every((key) => ["name", "comment", "categories"].includes(key)) && text(desktop.name, 64) && (desktop.comment === undefined || text(desktop.comment, 128)) && "categories" in desktop, "Invalid Arch desktop entry");
170
+ assert(Array.isArray(links) && links.length <= 8 && links.every((link, index) => isRecord(link) && Object.keys(link).length === 2 && text(link.name, 64) && executableName.test(link.name) && link.name !== policy.executable && links.findIndex((item) => isRecord(item) && item.name === link.name) === index && bundlePath(link.target)), "Invalid Arch package links");
171
+ assert(policy.channel === undefined || policy.channel === "stable" || policy.channel === "daily", "Invalid Arch package channel");
172
+ const repository = policy.repository;
173
+ assert(repository === undefined || isRecord(repository) && Object.keys(repository).length === 3 && typeof repository.name === "string" && /^[a-z][a-z0-9-]{0,31}$/.test(repository.name) && httpsUrl(repository.base) && repository.base.endsWith("/") && httpsUrl(repository.publicKey), "Invalid Arch package repository");
174
+ return {
175
+ pkgname: policy.pkgname,
176
+ pkgdesc: policy.pkgdesc,
177
+ maintainer: policy.maintainer,
178
+ url: policy.url,
179
+ license: tokenList(policy.license, {
180
+ maximum: 8,
181
+ minimum: 1,
182
+ pattern: licenseToken,
183
+ message: "Invalid Arch package license"
184
+ }),
185
+ depends: tokenList(policy.depends, {
186
+ maximum: 64,
187
+ minimum: 1,
188
+ pattern: packageName,
189
+ message: "Invalid Arch package dependencies"
190
+ }),
191
+ optdepends: tokenList(policy.optdepends ?? [], {
192
+ maximum: 32,
193
+ minimum: 0,
194
+ pattern: optdependsEntry,
195
+ message: "Invalid Arch optional dependencies"
196
+ }),
197
+ provides: tokenList(policy.provides ?? [], {
198
+ maximum: 16,
199
+ minimum: 0,
200
+ pattern: packageName,
201
+ message: "Invalid Arch package provides"
202
+ }),
203
+ conflicts: tokenList(policy.conflicts ?? [], {
204
+ maximum: 16,
205
+ minimum: 0,
206
+ pattern: packageName,
207
+ message: "Invalid Arch package conflicts"
208
+ }),
209
+ executable: policy.executable,
210
+ setuid: tokenList(policy.setuid ?? [], {
211
+ maximum: 8,
212
+ minimum: 0,
213
+ pattern: /^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+$/,
214
+ message: "Invalid Arch setuid executables"
215
+ }),
216
+ desktop: {
217
+ name: desktop.name,
218
+ ...desktop.comment === undefined ? {} : { comment: desktop.comment },
219
+ categories: tokenList(desktop.categories, {
220
+ maximum: 8,
221
+ minimum: 1,
222
+ pattern: category,
223
+ message: "Invalid Arch desktop categories"
224
+ })
225
+ },
226
+ ...policy.icon === undefined ? {} : { icon: policy.icon },
227
+ ...policy.licenseSource === undefined ? {} : { licenseSource: policy.licenseSource },
228
+ links: links.map((link) => ({
229
+ name: link.name,
230
+ target: link.target
231
+ })),
232
+ channel: policy.channel ?? "stable",
233
+ ...repository === undefined ? {} : {
234
+ repository: {
235
+ name: repository.name,
236
+ base: repository.base,
237
+ publicKey: repository.publicKey
238
+ }
239
+ }
240
+ };
241
+ }
242
+
100
243
  // ../../src/updates/feed/release-feed.ts
101
244
  var MAX_LEDGER_RELEASES = 500;
102
245
  var MAX_RELEASE_ASSETS = 256;
@@ -182,19 +325,19 @@ function parseReleaseLedger(value, app) {
182
325
  }
183
326
 
184
327
  // ../../src/updates/feed/release-config-contract.ts
185
- function assert(condition, message) {
328
+ function assert2(condition, message) {
186
329
  if (!condition)
187
330
  throw new Error(message);
188
331
  }
189
332
  function parseOfflinePolicy(value) {
190
- assert(typeof value === "object" && value !== null && !Array.isArray(value), "Invalid offline policy");
333
+ assert2(typeof value === "object" && value !== null && !Array.isArray(value), "Invalid offline policy");
191
334
  const policy = value;
192
- assert(typeof policy.marker === "string" && policy.marker.trim().length > 0 && policy.marker.length <= 256 && !containsAsciiControl(policy.marker), "Invalid offline marker");
335
+ assert2(typeof policy.marker === "string" && policy.marker.trim().length > 0 && policy.marker.length <= 256 && !containsAsciiControl(policy.marker), "Invalid offline marker");
193
336
  if (policy.kind === "standalone") {
194
- assert(Object.keys(policy).length === 2, "Invalid standalone offline policy");
337
+ assert2(Object.keys(policy).length === 2, "Invalid standalone offline policy");
195
338
  return { kind: "standalone", marker: policy.marker };
196
339
  }
197
- assert(policy.kind === "local-bootstrap" && Object.keys(policy).length === 3 && typeof policy.path === "string" && policy.path.length <= 256 && /^\/(?:[A-Za-z0-9_~-]+\/)*[A-Za-z0-9_~-]+$/.test(policy.path) && !policy.path.startsWith("/__framework/"), "Invalid bootstrap offline policy");
340
+ assert2(policy.kind === "local-bootstrap" && Object.keys(policy).length === 3 && typeof policy.path === "string" && policy.path.length <= 256 && /^\/(?:[A-Za-z0-9_~-]+\/)*[A-Za-z0-9_~-]+$/.test(policy.path) && !policy.path.startsWith("/__framework/"), "Invalid bootstrap offline policy");
198
341
  return { kind: "local-bootstrap", marker: policy.marker, path: policy.path };
199
342
  }
200
343
  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;
@@ -289,6 +432,7 @@ function parseReleaseConfig(config) {
289
432
  if (!/^[a-z0-9-]+$/.test(platform) || !strings(assets))
290
433
  throw new Error("Invalid release platform configuration");
291
434
  const platformSnapshot = Object.fromEntries(Object.entries(platforms).map(([platform, assets]) => [platform, [...assets]]));
435
+ const archPackage = config.archPackage === undefined ? undefined : parseArchPackage(config.archPackage);
292
436
  const commandArtifacts = parseCommandArtifacts(config.commandArtifacts, Object.keys(platforms));
293
437
  const appIds = [config.appId, ...commandArtifacts.map((artifact) => artifact.appId)];
294
438
  if (new Set(appIds).size !== appIds.length)
@@ -333,6 +477,7 @@ function parseReleaseConfig(config) {
333
477
  sidecars,
334
478
  releaseWorkflows,
335
479
  feed,
480
+ archPackage,
336
481
  commandArtifacts,
337
482
  requirements
338
483
  };
@@ -853,7 +998,7 @@ function normalizePromotionRelease(value) {
853
998
  }
854
999
 
855
1000
  // ../../src/release/release-qualification.ts
856
- function assert2(condition, message) {
1001
+ function assert3(condition, message) {
857
1002
  if (!condition)
858
1003
  throw new Error(message);
859
1004
  }
@@ -861,19 +1006,19 @@ function expectedAssets(requirements) {
861
1006
  if (Object.hasOwn(requirements, "offlinePolicy"))
862
1007
  parseOfflinePolicy(requirements.offlinePolicy);
863
1008
  const platforms = Object.entries(requirements.platforms);
864
- assert2(platforms.length > 0, "Missing platforms");
1009
+ assert3(platforms.length > 0, "Missing platforms");
865
1010
  const names = [
866
1011
  ...platforms.flatMap(([platform, artifacts]) => {
867
- assert2(/^[a-z0-9-]+$/.test(platform) && artifacts.length > 0, "Invalid platform requirements");
1012
+ assert3(/^[a-z0-9-]+$/.test(platform) && artifacts.length > 0, "Invalid platform requirements");
868
1013
  return artifacts;
869
1014
  }),
870
1015
  ...Object.entries(requirements.commandArtifacts ?? {}).flatMap(([kind, byPlatform]) => {
871
- assert2(/^[a-z][a-z0-9-]{0,31}$/.test(kind) && Object.keys(byPlatform).length === platforms.length && platforms.every(([platform]) => typeof byPlatform[platform] === "string"), "Invalid command artifact requirements");
1016
+ assert3(/^[a-z][a-z0-9-]{0,31}$/.test(kind) && Object.keys(byPlatform).length === platforms.length && platforms.every(([platform]) => typeof byPlatform[platform] === "string"), "Invalid command artifact requirements");
872
1017
  return Object.values(byPlatform);
873
1018
  }),
874
1019
  ...requirements.releaseAssets
875
1020
  ];
876
- assert2(names.length > 0 && names.every((name) => /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) && new Set(names).size === names.length, "Invalid or duplicate asset requirements");
1021
+ assert3(names.length > 0 && names.every((name) => /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) && new Set(names).size === names.length, "Invalid or duplicate asset requirements");
877
1022
  return names;
878
1023
  }
879
1024
  function matches(saved, uploaded) {
@@ -881,74 +1026,74 @@ function matches(saved, uploaded) {
881
1026
  }
882
1027
  function uniqueAsset(assets, name) {
883
1028
  const found = assets.filter((asset) => asset.name === name);
884
- assert2(found.length === 1, `Missing or duplicate asset: ${name}`);
1029
+ assert3(found.length === 1, `Missing or duplicate asset: ${name}`);
885
1030
  return found[0];
886
1031
  }
887
1032
  function checkRenderer(value, offlinePolicy) {
888
1033
  const port = Number(value?.origin?.split(":").at(-1));
889
1034
  const common = value && port >= 1024 && port <= 65535 && /^http:\/\/127\.0\.0\.1:[1-9]\d{3,4}$/.test(value.origin) && value.samples === 2 && value.guardInstalled === true && value.offlineObserved === true && value.unexpectedActivity === false && Number.isFinite(value.elapsedMs) && value.elapsedMs >= 3000 && value.visible === true && ["interactive", "complete"].includes(value.readyState) && Number.isFinite(value.width) && value.width >= 100 && Number.isFinite(value.height) && value.height >= 100 && Number.isSafeInteger(value.interactiveElements) && value.interactiveElements >= 1 && Number.isSafeInteger(value.textLength) && value.textLength >= 1;
890
1035
  if (!offlinePolicy) {
891
- assert2(common && value.method === "native-dom-raf-v1" && value.bootstrapDenied === true, "Incomplete native renderer evidence");
1036
+ assert3(common && value.method === "native-dom-raf-v1" && value.bootstrapDenied === true, "Incomplete native renderer evidence");
892
1037
  return;
893
1038
  }
894
- assert2(value && value.offlinePolicy, "Incomplete native renderer evidence");
1039
+ assert3(value && value.offlinePolicy, "Incomplete native renderer evidence");
895
1040
  const policy = parseOfflinePolicy(offlinePolicy), observed = parseOfflinePolicy(value.offlinePolicy);
896
- assert2(common && value.method === "native-dom-raf-v2" && value.markerObserved === true && value.browserNetworkRestricted === true && observed.kind === policy.kind && observed.marker === policy.marker && (policy.kind === "standalone" ? value.bootstrapDenied === false : observed.kind === "local-bootstrap" && observed.path === policy.path && value.bootstrapDenied === true), "Incomplete native renderer evidence");
1041
+ assert3(common && value.method === "native-dom-raf-v2" && value.markerObserved === true && value.browserNetworkRestricted === true && observed.kind === policy.kind && observed.marker === policy.marker && (policy.kind === "standalone" ? value.bootstrapDenied === false : observed.kind === "local-bootstrap" && observed.path === policy.path && value.bootstrapDenied === true), "Incomplete native renderer evidence");
897
1042
  }
898
1043
  function validateInstallerReceipt(identity, entry, platform, names, assets, offlinePolicy) {
899
1044
  assertIdentity(identity, platform);
900
- assert2(Array.isArray(names) && new Set(names).size === names.length, "Invalid installer receipt context");
901
- assert2(entry && entry.platform === platform && entry.schema === 2 && entry.installed === true && entry.launched === true && entry.rendererReady === true && ["tag", "sourceSha", "workflowSha", "runId", "runAttempt"].every((key) => entry[key] === identity[key]), "Installer identity mismatch");
1045
+ assert3(Array.isArray(names) && new Set(names).size === names.length, "Invalid installer receipt context");
1046
+ assert3(entry && entry.platform === platform && entry.schema === 2 && entry.installed === true && entry.launched === true && entry.rendererReady === true && ["tag", "sourceSha", "workflowSha", "runId", "runAttempt"].every((key) => entry[key] === identity[key]), "Installer identity mismatch");
902
1047
  checkRenderer(entry.rendererEvidence, offlinePolicy);
903
- assert2(Array.isArray(entry.assets) && names.length > 0 && entry.assets.length === names.length, "Incorrect installer asset count");
1048
+ assert3(Array.isArray(entry.assets) && names.length > 0 && entry.assets.length === names.length, "Incorrect installer asset count");
904
1049
  for (const name of names)
905
- assert2(matches(uniqueAsset(entry.assets, name), uniqueAsset(assets, name)), `Installer asset mismatch: ${name}`);
1050
+ assert3(matches(uniqueAsset(entry.assets, name), uniqueAsset(assets, name)), `Installer asset mismatch: ${name}`);
906
1051
  return true;
907
1052
  }
908
1053
  function assertIdentity(identity, platform) {
909
- assert2(/^v\d+\.\d+\.\d+$/.test(identity.tag) && isGitSha(identity.sourceSha) && isGitSha(identity.workflowSha) && /^[1-9]\d{0,19}$/.test(identity.runId) && Number.isSafeInteger(identity.runAttempt) && identity.runAttempt > 0 && /^[a-z0-9-]+$/.test(platform), "Invalid receipt context");
1054
+ assert3(/^v\d+\.\d+\.\d+$/.test(identity.tag) && isGitSha(identity.sourceSha) && isGitSha(identity.workflowSha) && /^[1-9]\d{0,19}$/.test(identity.runId) && Number.isSafeInteger(identity.runAttempt) && identity.runAttempt > 0 && /^[a-z0-9-]+$/.test(platform), "Invalid receipt context");
910
1055
  }
911
1056
  function validateCommandReceipt(identity, entry, kind, platform, name, assets) {
912
1057
  assertIdentity(identity, platform);
913
- assert2(entry && entry.schema === 1 && entry.kind === kind && entry.platform === platform && entry.installed === true && entry.versionMatched === true && entry.probesPassed === true && entry.serviceStarted === true && entry.serviceStopped === (platform === "windows-x64" ? "process-tree" : "sigterm") && Object.keys(entry).length === 14 && ["tag", "sourceSha", "workflowSha", "runId", "runAttempt"].every((key) => entry[key] === identity[key]), "Command artifact receipt mismatch");
914
- assert2(matches(entry.asset, uniqueAsset(assets, name)), `Command artifact asset mismatch: ${name}`);
1058
+ assert3(entry && entry.schema === 1 && entry.kind === kind && entry.platform === platform && entry.installed === true && entry.versionMatched === true && entry.probesPassed === true && entry.serviceStarted === true && entry.serviceStopped === (platform === "windows-x64" ? "process-tree" : "sigterm") && Object.keys(entry).length === 14 && ["tag", "sourceSha", "workflowSha", "runId", "runAttempt"].every((key) => entry[key] === identity[key]), "Command artifact receipt mismatch");
1059
+ assert3(matches(entry.asset, uniqueAsset(assets, name)), `Command artifact asset mismatch: ${name}`);
915
1060
  return true;
916
1061
  }
917
1062
  function validateCommandReceipts(identity, receipts, requirements, assets) {
918
1063
  const required = Object.entries(requirements.commandArtifacts ?? {}).flatMap(([kind, byPlatform]) => Object.entries(byPlatform).map(([platform, name]) => ({ kind, platform, name })));
919
1064
  if (!required.length) {
920
- assert2(receipts === undefined, "Unexpected command artifact receipts");
1065
+ assert3(receipts === undefined, "Unexpected command artifact receipts");
921
1066
  return;
922
1067
  }
923
- assert2(Array.isArray(receipts) && receipts.length === required.length, "Missing or duplicate command artifact receipts");
1068
+ assert3(Array.isArray(receipts) && receipts.length === required.length, "Missing or duplicate command artifact receipts");
924
1069
  for (const { kind, platform, name } of required) {
925
1070
  const entries = receipts.filter((entry) => entry?.kind === kind && entry.platform === platform);
926
- assert2(entries.length === 1, `Missing or duplicate command artifact receipt: ${kind}`);
1071
+ assert3(entries.length === 1, `Missing or duplicate command artifact receipt: ${kind}`);
927
1072
  validateCommandReceipt(identity, entries[0], kind, platform, name, assets);
928
1073
  }
929
1074
  }
930
1075
  function validateReleaseQualification(release, receipt, sourceSha, requirements) {
931
1076
  const required = expectedAssets(requirements);
932
1077
  const platforms = Object.keys(requirements.platforms);
933
- assert2(release.draft === false && receipt.schema === 2 && receipt.tag === release.tag_name && receipt.sourceSha === sourceSha && isGitSha(sourceSha) && isGitSha(receipt.workflowSha) && /^[1-9]\d*$/.test(receipt.runId) && Number.isSafeInteger(receipt.runAttempt) && receipt.runAttempt > 0, "Qualification identity mismatch");
934
- assert2(receipt.platforms.length === platforms.length && receipt.installerTests.length === platforms.length && receipt.installerReceipts.length === platforms.length && platforms.every((platform) => receipt.platforms.filter((x) => x === platform).length === 1 && receipt.installerTests.filter((x) => x === platform).length === 1), "Missing or duplicate platform tests");
1078
+ assert3(release.draft === false && receipt.schema === 2 && receipt.tag === release.tag_name && receipt.sourceSha === sourceSha && isGitSha(sourceSha) && isGitSha(receipt.workflowSha) && /^[1-9]\d*$/.test(receipt.runId) && Number.isSafeInteger(receipt.runAttempt) && receipt.runAttempt > 0, "Qualification identity mismatch");
1079
+ assert3(receipt.platforms.length === platforms.length && receipt.installerTests.length === platforms.length && receipt.installerReceipts.length === platforms.length && platforms.every((platform) => receipt.platforms.filter((x) => x === platform).length === 1 && receipt.installerTests.filter((x) => x === platform).length === 1), "Missing or duplicate platform tests");
935
1080
  for (const platform of platforms) {
936
1081
  const entries = receipt.installerReceipts.filter((entry) => entry.platform === platform);
937
- assert2(entries.length === 1, `Missing or duplicate installer receipt: ${platform}`);
1082
+ assert3(entries.length === 1, `Missing or duplicate installer receipt: ${platform}`);
938
1083
  validateInstallerReceipt(receipt, entries[0], platform, requirements.platforms[platform], release.assets, requirements.offlinePolicy);
939
1084
  }
940
1085
  validateCommandReceipts(receipt, receipt.commandReceipts, requirements, release.assets);
941
- assert2(receipt.assets.length === required.length, "Incorrect qualification asset count");
1086
+ assert3(receipt.assets.length === required.length, "Incorrect qualification asset count");
942
1087
  for (const name of required)
943
- assert2(matches(uniqueAsset(receipt.assets, name), uniqueAsset(release.assets, name)), `Qualification asset mismatch: ${name}`);
1088
+ assert3(matches(uniqueAsset(receipt.assets, name), uniqueAsset(release.assets, name)), `Qualification asset mismatch: ${name}`);
944
1089
  return true;
945
1090
  }
946
1091
  function validateQualificationRun(run, jobs, receipt, repository, requirements, assetsWorkflow) {
947
1092
  expectedAssets(requirements);
948
- assert2(String(run.id) === receipt.runId && run.run_attempt === receipt.runAttempt && run.conclusion === "success" && run.path === assetsWorkflow && run.repository.full_name === repository && run.head_sha === receipt.workflowSha && ["release", "workflow_dispatch"].includes(run.event), "Qualification run identity mismatch");
1093
+ assert3(String(run.id) === receipt.runId && run.run_attempt === receipt.runAttempt && run.conclusion === "success" && run.path === assetsWorkflow && run.repository.full_name === repository && run.head_sha === receipt.workflowSha && ["release", "workflow_dispatch"].includes(run.event), "Qualification run identity mismatch");
949
1094
  for (const platform of Object.keys(requirements.platforms)) {
950
1095
  const platformJobs = jobs.filter((job) => new RegExp(`^(?:[A-Za-z0-9_-]+ / )?Installer / ${platform}$`).test(job.name));
951
- assert2(platformJobs.length === 1 && platformJobs[0].conclusion === "success", `Missing successful installer job: ${platform}`);
1096
+ assert3(platformJobs.length === 1 && platformJobs[0].conclusion === "success", `Missing successful installer job: ${platform}`);
952
1097
  }
953
1098
  return true;
954
1099
  }
@@ -1736,7 +1881,7 @@ function assertBuildMetadata(value, renderer) {
1736
1881
  // ../../src/installer/command-artifact.ts
1737
1882
  import { lstat as lstat2, mkdir as mkdir2, mkdtemp as mkdtemp2, readFile as readFile3, readdir as readdir3, rm as rm2 } from "fs/promises";
1738
1883
  import { tmpdir } from "os";
1739
- import { basename, join, relative, sep } from "path";
1884
+ import { basename, join, relative as relative2, sep } from "path";
1740
1885
  import { c as create, t as list, x as extract } from "tar";
1741
1886
 
1742
1887
  // ../../src/installer/archive-entry.ts
@@ -1851,7 +1996,7 @@ async function collect(root, directory, entries) {
1851
1996
  for (const child of children) {
1852
1997
  const path = join(directory, child.name);
1853
1998
  const info = await lstat2(path);
1854
- const name = relative(root, path).split(sep).join("/");
1999
+ const name = relative2(root, path).split(sep).join("/");
1855
2000
  if (info.isDirectory()) {
1856
2001
  entries.push(name);
1857
2002
  await collect(root, path, entries);
@@ -2636,7 +2781,7 @@ function readPackageFile(bytes, path) {
2636
2781
  }
2637
2782
 
2638
2783
  // src/framework-package-publish.ts
2639
- var packageName = "@adea-ai/app-framework";
2784
+ var packageName2 = "@adea-ai/app-framework";
2640
2785
  var registryUrl = "https://registry.npmjs.org/";
2641
2786
  var VISIBILITY_SLEEPS = 32;
2642
2787
  var FIRST_VISIBILITY_DELAY_MS = 5000;
@@ -2706,12 +2851,12 @@ function publishProgram(options) {
2706
2851
  const manifest = yield* step(async () => JSON.parse(await fs.readFile("package.json", "utf8")));
2707
2852
  const version = provenance.releasedVersion;
2708
2853
  const archive = resolve4(options.archive);
2709
- if (provenance.repository !== "adea-ai/app-framework" || manifest.name !== packageName || manifest.version !== version || basename2(archive) !== `adea-ai-app-framework-${version}.tgz`)
2854
+ if (provenance.repository !== "adea-ai/app-framework" || manifest.name !== packageName2 || manifest.version !== version || basename2(archive) !== `adea-ai-app-framework-${version}.tgz`)
2710
2855
  return yield* refused("source-mismatch");
2711
2856
  const { bytes, integrity } = yield* archiveIntegrity(fs, archive);
2712
2857
  const packed = yield* step(async () => readPackageFile(bytes, "package/package.json"));
2713
2858
  const source = yield* step(async () => readPackageFile(bytes, "package/dist/framework-source.json"));
2714
- if (packed.name !== packageName || packed.version !== version || source.version !== version || source.commit !== sha)
2859
+ if (packed.name !== packageName2 || packed.version !== version || source.version !== version || source.commit !== sha)
2715
2860
  return yield* refused("not-from-checkout");
2716
2861
  const existing = yield* step(() => registry(version));
2717
2862
  if (existing !== null) {
@@ -4177,7 +4322,7 @@ import { Effect as Effect22 } from "effect";
4177
4322
  // ../../src/installer/installer-archive-members.ts
4178
4323
  import { createHash as createHash10 } from "crypto";
4179
4324
  import { lstat as lstat6, open as open4 } from "fs/promises";
4180
- import { isAbsolute as isAbsolute3, relative as relative2, sep as sep2 } from "path";
4325
+ import { isAbsolute as isAbsolute3, relative as relative3, sep as sep2 } from "path";
4181
4326
 
4182
4327
  // ../../src/installer/native-executable.ts
4183
4328
  async function assertNativeExecutable(file, size, platform, what) {
@@ -4200,7 +4345,7 @@ async function assertNativeExecutable(file, size, platform, what) {
4200
4345
  // ../../src/installer/installer-archive-members.ts
4201
4346
  var EMBEDDED_ARCHIVE_MARKER = Buffer.from("ELECTROBUN_ARCHIVE_V1");
4202
4347
  function isWithin(root, path) {
4203
- const rel = relative2(root, path);
4348
+ const rel = relative3(root, path);
4204
4349
  return rel !== "" && rel !== ".." && !rel.startsWith(".." + sep2) && !isAbsolute3(rel);
4205
4350
  }
4206
4351
  function normalizeArchiveMember(name) {
@@ -4815,7 +4960,7 @@ import { delimiter, dirname as dirname12, join as join26 } from "path";
4815
4960
  // ../../src/installer/installer-ci-bootstrap.ts
4816
4961
  import { randomBytes } from "crypto";
4817
4962
  import { lstat as lstat9, mkdir as mkdir5, mkdtemp as mkdtemp5, realpath as realpath2, rm as rm5, writeFile as writeFile4 } from "fs/promises";
4818
- import { dirname as dirname4, isAbsolute as isAbsolute4, join as join13, relative as relative3, sep as sep3 } from "path";
4963
+ import { dirname as dirname4, isAbsolute as isAbsolute4, join as join13, relative as relative4, sep as sep3 } from "path";
4819
4964
  import { fileURLToPath } from "url";
4820
4965
  var bootstrapModules = [
4821
4966
  "app/value-guards.js",
@@ -4827,6 +4972,7 @@ var bootstrapModules = [
4827
4972
  "installer/hosted-runner.js",
4828
4973
  "release/release-qualification.js",
4829
4974
  "updates/feed/release-config-contract.js",
4975
+ "updates/feed/arch-package-policy.js",
4830
4976
  "updates/feed/release-feed.js",
4831
4977
  "native/app-bundle.js",
4832
4978
  "desktop/string-policy.js",
@@ -4871,7 +5017,7 @@ async function preflightInstallerRuntime(options) {
4871
5017
  if (!isHostedRunner(env) || !temp || !isAbsolute4(runtime))
4872
5018
  throw new Error("Runtime preflight requires a disposable hosted runner");
4873
5019
  const tempRoot = await realpath2(temp), bootstrapRoot = await realpath2(bootstrap.directory);
4874
- const relativeBootstrap = relative3(tempRoot, bootstrapRoot);
5020
+ const relativeBootstrap = relative4(tempRoot, bootstrapRoot);
4875
5021
  if (!relativeBootstrap || relativeBootstrap === ".." || relativeBootstrap.startsWith(".." + sep3) || isAbsolute4(relativeBootstrap) || /\s/.test(bootstrapRoot) || bootstrap.worker !== join13(bootstrapRoot, "installer/installer-ci-worker.js") || bootstrap.preflight !== join13(bootstrapRoot, "installer/installer-ci-preflight.js") || bootstrap.bunOptions !== `--preload=${bootstrap.worker}`)
4876
5022
  throw new Error("Invalid installer bootstrap location");
4877
5023
  await runInstallerPreflight({
@@ -1 +1 @@
1
- {"version":"0.1.0","commit":"fcf5f17e923cc176cc2ba5eafb1dd9639b48d023"}
1
+ {"version":"0.2.0","commit":"9374d573ec26d59fec88ccf7ee237cbad696defc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/app-framework-release-tools",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Host-side release tooling for @adea-ai/app-framework apps, on Effect: the release CLIs and the framework package publish. Installing it never adds Effect to the framework itself.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {