Files
openclaw/scripts/lib/cross-os-release-checks/companions.ts
Peter Steinberger c70aee247e refactor(scripts): migrate JavaScript tools to TypeScript (#121005)
* refactor(scripts): migrate JavaScript tools to TypeScript

* fix(ci): keep changed-scope preflight zero-install

* fix(ci): preserve zero-install script owners

* fix(ci): complete script migration follow-through

* fix(release): keep stable closeout zero-install

* fix(scripts): preserve standalone execution boundaries

* fix(scripts): repair standalone loader boundaries

* fix(scripts): normalize gateway observation ids

* fix(scripts): keep Docker packager standalone

* test(scripts): preserve rebase cleanup helpers

* test(sessions): use tracked temp directory
2026-08-09 07:21:35 -07:00

32 lines
1.1 KiB
TypeScript

import { resolve } from "node:path";
import { validatePrepublishPluginRegistryArtifact } from "../../prepublish-plugin-registry-artifact.mjs";
type CrossOsCompanionPackage = {
name: string;
tarballPath: string;
};
export function resolveCrossOsCompanionPackages(params: {
artifactDir: string;
candidateVersion: string;
manifestSha256: string;
requiredPackages: string[];
sourceSha: string;
}): CrossOsCompanionPackage[] {
const artifactDir = resolve(params.artifactDir);
const { manifest } = validatePrepublishPluginRegistryArtifact({
artifactDir,
expectedCandidateVersion: params.candidateVersion,
expectedManifestSha256: params.manifestSha256,
expectedSourceSha: params.sourceSha,
requiredPackages: params.requiredPackages,
});
const requiredPackages = new Set(params.requiredPackages);
return manifest.packages
.filter((entry: { name: string; tarball: string }) => requiredPackages.has(entry.name))
.map((entry: { name: string; tarball: string }) => ({
name: entry.name,
tarballPath: resolve(artifactDir, entry.tarball),
}));
}