feat(apple): project macOS bundle anatomy in application graphs
project_apple_application_graph accepted only IPA inventories. It now also projects macOS .app directories and ZIP or DMG inventories that contain applications. It reports application roots, platforms, and every nested bundle with its path-convention role, layout, parent, Info.plist path, executable candidates, and signing paths: - roles: app extensions, XPC services (including inside frameworks), frameworks, login items, system and driver extensions, plug-ins, resource bundles, and helper or nested applications; - privileged helpers in Contents/Library/LaunchServices and launchd plists in Contents/Library/LaunchAgents or LaunchDaemons; - direct files of Contents/Helpers; - symlinks by path. Their targets are not inventoried, so versioned frameworks are described through their real Versions/<version>/ directories. AppleDouble sidecars (._* and __MACOSX/) are excluded from roles. A DMG whose contents could not be inventoried is reported as partial. Other inventory formats remain input errors. The projection still reads no plist or CMS semantics; it points callers at inspect_plist. The result schema is additive. projection_id now covers the new fields, so IPA projection IDs differ from earlier versions. verify:macos-bundle compiles a source-owned app with clang (CLT only). It packs it as a directory, a ditto ZIP, and an APFS DMG, and checks identical anatomy through the CLI with stdio MCP parity. It runs in the macOS CI job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b72c079a9a
commit
dd3e7aef0d
@@ -10,7 +10,7 @@ import { projectInventoryEvidence } from "./InventoryProjectionEvidence.js";
|
||||
|
||||
const OPERATION = "project_apple_application_graph" as const;
|
||||
|
||||
/** Project authenticated IPA inventory Evidence into Apple application evidence. */
|
||||
/** Project authenticated IPA or macOS app inventory Evidence into Apple application evidence. */
|
||||
export const projectAppleApplicationEvidence = (
|
||||
rawInput: unknown,
|
||||
): Result<Evidence, AnalysisError> => {
|
||||
@@ -21,7 +21,7 @@ export const projectAppleApplicationEvidence = (
|
||||
operation: OPERATION,
|
||||
predicateType: "rea.apple-application-graph",
|
||||
provider: APPLE_APPLICATION_PROVIDER,
|
||||
subjectFormat: () => "ipa",
|
||||
subjectFormat: (first) => first.subject?.format ?? "unknown",
|
||||
protocolError: "Apple application projection produced an invalid result",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ export const registerApplicationCommands = (
|
||||
logger,
|
||||
name: CLI_COMMANDS.projectAppleApplicationGraph,
|
||||
description:
|
||||
"Project authenticated IPA inventory Evidence into an Apple application graph",
|
||||
"Project authenticated IPA or macOS app inventory Evidence into an Apple application graph",
|
||||
inputSchema: appleApplicationProjectionInputSchema,
|
||||
workflow: (input) => {
|
||||
const result = projectAppleApplicationEvidence(input);
|
||||
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
import {
|
||||
ANDROID_APPLICATION_GRAPH_EXAMPLE,
|
||||
APPLE_APPLICATION_GRAPH_EXAMPLE,
|
||||
MACOS_APPLICATION_GRAPH_EXAMPLE,
|
||||
} from "./mobileApplicationGraphExamples.js";
|
||||
|
||||
const traceOutputSchema = evidenceResultOf(applicationFeatureTraceResultSchema);
|
||||
@@ -278,7 +279,7 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
||||
name: "project_apple_application_graph",
|
||||
...toolContractMetadata("project_apple_application_graph"),
|
||||
description:
|
||||
"Project authenticated IPA inventory_artifact Evidence into an execution-free Apple application inventory. Reports exact component paths and hashes, runtime-family hints, and path-based bridge hypotheses without parsing plist/CMS semantics or claiming observed runtime calls.",
|
||||
"Project authenticated IPA, macOS .app directory, ZIP, or DMG inventory Evidence into an execution-free Apple application inventory. Reports application roots, nested bundles with path-convention roles (app extensions, XPC services, login items, privileged helpers, system extensions, frameworks), launchd plists, exact component paths and hashes, runtime-family hints, and path-based bridge hypotheses without parsing plist/CMS semantics or claiming observed runtime calls.",
|
||||
kind: "application",
|
||||
inputSchema: appleApplicationProjectionInputSchema,
|
||||
outputSchema: evidenceResultOf(appleApplicationProjectionResultSchema),
|
||||
@@ -287,6 +288,11 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
||||
title: "Project IPA inventory Evidence into an Apple application graph",
|
||||
input: APPLE_APPLICATION_GRAPH_EXAMPLE,
|
||||
},
|
||||
{
|
||||
title:
|
||||
"Project a macOS .app directory inventory into its bundle anatomy",
|
||||
input: MACOS_APPLICATION_GRAPH_EXAMPLE,
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { canonicalDigest } from "../domain/comparisonSemantics.js";
|
||||
import { createEvidence } from "../domain/evidence.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
|
||||
const inventory = (format: "apk" | "ipa", digit: string) => {
|
||||
const inventory = (format: "apk" | "ipa" | "directory", digit: string) => {
|
||||
const sha = digit.repeat(64);
|
||||
const artifactId = `art_${canonicalDigest({ sha256: sha }, "Artifact inventory")}`;
|
||||
const occurrenceId = `occ_${canonicalDigest(
|
||||
@@ -112,3 +112,20 @@ export const APPLE_APPLICATION_GRAPH_EXAMPLE = {
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
/** Catalog example for a macOS application bundle inventoried as a directory. */
|
||||
export const MACOS_APPLICATION_GRAPH_EXAMPLE = {
|
||||
inventory_evidence: [
|
||||
createEvidence(
|
||||
{ path: "Fixture.app", sha256: "c".repeat(64), format: "directory" },
|
||||
provider,
|
||||
{
|
||||
operation: "inventory_artifact",
|
||||
parameters: {},
|
||||
result: inventory("directory", "c"),
|
||||
confidence: "observed",
|
||||
authority: "shipped-artifact",
|
||||
},
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
@@ -0,0 +1,372 @@
|
||||
import { createHash } from "node:crypto";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { projectAppleApplication } from "./appleApplication.js";
|
||||
import { canonicalDigest } from "./comparisonSemantics.js";
|
||||
import { createEvidence, type Evidence } from "./evidence.js";
|
||||
import { jsonValueSchema } from "./jsonValue.js";
|
||||
|
||||
type EntryKind = "file" | "directory" | "symlink";
|
||||
type RootFormat = "ipa" | "zip" | "dmg" | "directory" | "asar";
|
||||
|
||||
interface FixtureEntry {
|
||||
readonly path: string;
|
||||
readonly kind?: EntryKind;
|
||||
readonly format?: string;
|
||||
}
|
||||
|
||||
const sha = (text: string): string =>
|
||||
createHash("sha256").update(text).digest("hex");
|
||||
const artifactId = (sha256: string): string =>
|
||||
`art_${canonicalDigest({ sha256 }, "Artifact inventory")}`;
|
||||
|
||||
/** Build one complete, content-addressed inventory page for pure projection tests. */
|
||||
const inventoryEvidence = (
|
||||
rootFormat: RootFormat,
|
||||
subjectName: string,
|
||||
entries: readonly FixtureEntry[],
|
||||
): Evidence => {
|
||||
const rootSha = sha(`${rootFormat}:${subjectName}`);
|
||||
const rootId = artifactId(rootSha);
|
||||
const node = (sha256: string, format: string) => ({
|
||||
artifact_id: artifactId(sha256),
|
||||
kind: "resource",
|
||||
format,
|
||||
sha256,
|
||||
size: 1,
|
||||
media_type: null,
|
||||
architecture: null,
|
||||
executable: false,
|
||||
content_state: "materialized",
|
||||
limitations: [],
|
||||
});
|
||||
const occurrence = (path: string, kind: EntryKind, id: string | null) => ({
|
||||
occurrence_id:
|
||||
path === "."
|
||||
? `occ_${canonicalDigest({ root: rootId }, "Artifact inventory")}`
|
||||
: `occ_${canonicalDigest(
|
||||
{ root_artifact_id: rootId, logical_path: path, entry_kind: kind },
|
||||
"Artifact inventory",
|
||||
)}`,
|
||||
artifact_id: id,
|
||||
parent_occurrence_id: null,
|
||||
logical_path: path,
|
||||
entry_kind: kind,
|
||||
declared_size: null,
|
||||
compressed_size: null,
|
||||
executable: false,
|
||||
encrypted: false,
|
||||
hash_status: "verified",
|
||||
source_location: null,
|
||||
limitations: [],
|
||||
});
|
||||
const nodes = new Map([[rootId, node(rootSha, rootFormat)]]);
|
||||
const occurrences = [occurrence(".", "file", rootId)];
|
||||
for (const { path, kind = "file", format = "file" } of entries) {
|
||||
if (kind === "symlink") {
|
||||
occurrences.push(occurrence(path, kind, null));
|
||||
continue;
|
||||
}
|
||||
const contentSha = sha(`${kind}:${path}`);
|
||||
const id = artifactId(contentSha);
|
||||
nodes.set(
|
||||
id,
|
||||
node(contentSha, kind === "directory" ? "directory" : format),
|
||||
);
|
||||
occurrences.push(occurrence(path, kind, id));
|
||||
}
|
||||
const sortedNodes = [...nodes.values()].sort((left, right) =>
|
||||
left.artifact_id.localeCompare(right.artifact_id),
|
||||
);
|
||||
const sortedOccurrences = occurrences.sort((left, right) =>
|
||||
left.logical_path.localeCompare(right.logical_path, "en"),
|
||||
);
|
||||
const graphSha256 = canonicalDigest(
|
||||
{
|
||||
nodes: sortedNodes,
|
||||
occurrences: sortedOccurrences,
|
||||
edges: [],
|
||||
integrity_contradictions: [],
|
||||
},
|
||||
"Artifact inventory",
|
||||
);
|
||||
return createEvidence(
|
||||
{
|
||||
path: `/fixtures/${subjectName}`,
|
||||
sha256: rootSha,
|
||||
format: rootFormat,
|
||||
},
|
||||
{ id: "rea-artifact-graph", name: "fixture", version: "1" },
|
||||
{
|
||||
operation: "inventory_artifact",
|
||||
parameters: {},
|
||||
confidence: "observed",
|
||||
authority: "shipped-artifact",
|
||||
result: jsonValueSchema.parse({
|
||||
manifest: {
|
||||
manifest_id: `agm_${canonicalDigest(
|
||||
{ root_artifact_id: rootId, graph_sha256: graphSha256 },
|
||||
"Artifact inventory",
|
||||
)}`,
|
||||
root_artifact_id: rootId,
|
||||
root_sha256: rootSha,
|
||||
root_format: rootFormat,
|
||||
graph_sha256: graphSha256,
|
||||
node_count: sortedNodes.length,
|
||||
occurrence_count: sortedOccurrences.length,
|
||||
edge_count: 0,
|
||||
},
|
||||
nodes: sortedNodes,
|
||||
occurrences: sortedOccurrences,
|
||||
edges: [],
|
||||
provenance: [],
|
||||
limitations: [],
|
||||
}),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
const project = (evidence: Evidence) =>
|
||||
projectAppleApplication({ inventory_evidence: [evidence] });
|
||||
|
||||
const macho = (path: string): FixtureEntry => ({ path, format: "mach-o" });
|
||||
|
||||
describe("macOS application roots and bundle roles", () => {
|
||||
it("treats an inventoried .app directory as its own application root", () => {
|
||||
const result = project(
|
||||
inventoryEvidence("directory", "Fixture.app", [
|
||||
{ path: "Contents/Info.plist" },
|
||||
macho("Contents/MacOS/Fixture"),
|
||||
{ path: "Contents/_CodeSignature/CodeResources" },
|
||||
{ path: "Contents/embedded.provisionprofile" },
|
||||
macho("Contents/Library/LaunchServices/com.example.helper"),
|
||||
{ path: "Contents/Library/LaunchDaemons/com.example.helper.plist" },
|
||||
{ path: "Contents/Library/LaunchAgents/com.example.agent.plist" },
|
||||
macho("Contents/Helpers/tool"),
|
||||
macho("Contents/Helpers/Assistant.app/Contents/MacOS/Assistant"),
|
||||
macho(
|
||||
"Contents/Library/SystemExtensions/com.example.filter.systemextension/Contents/MacOS/com.example.filter",
|
||||
),
|
||||
macho(
|
||||
"Contents/Library/SystemExtensions/com.example.driver.dext/driver",
|
||||
),
|
||||
{ path: "Contents/PlugIns/Preview.qlgenerator", kind: "directory" },
|
||||
macho("Contents/PlugIns/Bridge.bundle/Contents/MacOS/Bridge"),
|
||||
{ path: "Contents/Resources/Strings.bundle/Info.plist" },
|
||||
{ path: "Contents/SharedSupport/Data.bundle", kind: "directory" },
|
||||
macho("Contents/Resources/Embedded.app/Contents/MacOS/Embedded"),
|
||||
]),
|
||||
);
|
||||
expect(result).toMatchObject({
|
||||
root_format: "directory",
|
||||
platforms: ["macos"],
|
||||
application_roots: ["."],
|
||||
});
|
||||
expect(
|
||||
result.bundles.map(({ path, role, layout, parent_path: parent }) => ({
|
||||
path,
|
||||
role,
|
||||
layout,
|
||||
parent,
|
||||
})),
|
||||
).toEqual([
|
||||
{ path: ".", role: "application", layout: "macos-deep", parent: null },
|
||||
{
|
||||
path: "Contents/Helpers/Assistant.app",
|
||||
role: "helper-application",
|
||||
layout: "macos-deep",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/Library/SystemExtensions/com.example.driver.dext",
|
||||
role: "driver-extension",
|
||||
layout: "shallow",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/Library/SystemExtensions/com.example.filter.systemextension",
|
||||
role: "system-extension",
|
||||
layout: "macos-deep",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/PlugIns/Bridge.bundle",
|
||||
role: "plug-in",
|
||||
layout: "macos-deep",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/PlugIns/Preview.qlgenerator",
|
||||
role: "plug-in",
|
||||
layout: "shallow",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/Resources/Embedded.app",
|
||||
role: "nested-application",
|
||||
layout: "macos-deep",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/Resources/Strings.bundle",
|
||||
role: "resource-bundle",
|
||||
layout: "shallow",
|
||||
parent: ".",
|
||||
},
|
||||
{
|
||||
path: "Contents/SharedSupport/Data.bundle",
|
||||
role: "bundle",
|
||||
layout: "shallow",
|
||||
parent: ".",
|
||||
},
|
||||
]);
|
||||
expect(result.bundles[0]).toMatchObject({
|
||||
info_plist_path: "Contents/Info.plist",
|
||||
executable_candidates: ["Contents/MacOS/Fixture"],
|
||||
signing_paths: [
|
||||
"Contents/_CodeSignature/CodeResources",
|
||||
"Contents/embedded.provisionprofile",
|
||||
],
|
||||
});
|
||||
expect(
|
||||
result.components.privileged_helpers.map(({ path }) => path),
|
||||
).toEqual(["Contents/Library/LaunchServices/com.example.helper"]);
|
||||
expect(
|
||||
result.components.launchd_plists.map(({ path, domain }) => [
|
||||
path,
|
||||
domain,
|
||||
]),
|
||||
).toEqual([
|
||||
["Contents/Library/LaunchAgents/com.example.agent.plist", "agent"],
|
||||
["Contents/Library/LaunchDaemons/com.example.helper.plist", "daemon"],
|
||||
]);
|
||||
expect(result.components.helpers.map(({ path }) => path)).toEqual([
|
||||
"Contents/Helpers/tool",
|
||||
]);
|
||||
});
|
||||
|
||||
it("does not make a non-application bundle directory an application root", () => {
|
||||
const result = project(
|
||||
inventoryEvidence("directory", "Service.xpc", [
|
||||
{ path: "Contents/Info.plist" },
|
||||
macho("Contents/MacOS/Service"),
|
||||
]),
|
||||
);
|
||||
expect(result.application_roots).toEqual([]);
|
||||
expect(result.bundles).toEqual([]);
|
||||
expect(result.limitations).toContain(
|
||||
"No application bundle (Payload/*.app or *.app/Contents) was present in the supplied inventory pages.",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Apple bundle layouts and containers", () => {
|
||||
it("follows versioned frameworks without resolving Versions/Current", () => {
|
||||
const framework = "Fixture.app/Contents/Frameworks/Core.framework";
|
||||
const result = project(
|
||||
inventoryEvidence("zip", "Fixture.zip", [
|
||||
macho("Fixture.app/Contents/MacOS/Fixture"),
|
||||
{ path: `${framework}/Core`, kind: "symlink" },
|
||||
{ path: `${framework}/Versions/Current`, kind: "symlink" },
|
||||
macho(`${framework}/Versions/A/Core`),
|
||||
{ path: `${framework}/Versions/A/Resources/Info.plist` },
|
||||
{ path: `${framework}/Versions/A/_CodeSignature/CodeResources` },
|
||||
macho(
|
||||
`${framework}/Versions/A/XPCServices/Fetch.xpc/Contents/MacOS/Fetch`,
|
||||
),
|
||||
]),
|
||||
);
|
||||
const core = result.bundles.find(({ path }) => path === framework);
|
||||
expect(core).toEqual({
|
||||
path: framework,
|
||||
parent_path: "Fixture.app",
|
||||
layout: "versioned-framework",
|
||||
role: "framework",
|
||||
role_basis: "path-convention",
|
||||
info_plist_path: `${framework}/Versions/A/Resources/Info.plist`,
|
||||
executable_candidates: [`${framework}/Versions/A/Core`],
|
||||
signing_paths: [`${framework}/Versions/A/_CodeSignature/CodeResources`],
|
||||
});
|
||||
expect(
|
||||
result.bundles.find(({ role }) => role === "xpc-service")?.parent_path,
|
||||
).toBe(framework);
|
||||
expect(result.symlinks).toEqual([
|
||||
`${framework}/Core`,
|
||||
`${framework}/Versions/Current`,
|
||||
]);
|
||||
});
|
||||
|
||||
it("reports an unknown Info.plist when several framework versions exist", () => {
|
||||
const framework = "Fixture.app/Contents/Frameworks/Core.framework";
|
||||
const result = project(
|
||||
inventoryEvidence("zip", "Fixture.zip", [
|
||||
macho("Fixture.app/Contents/MacOS/Fixture"),
|
||||
{ path: `${framework}/Versions/A/Resources/Info.plist` },
|
||||
{ path: `${framework}/Versions/B/Resources/Info.plist` },
|
||||
]),
|
||||
);
|
||||
expect(
|
||||
result.bundles.find(({ path }) => path === framework)?.info_plist_path,
|
||||
).toBeNull();
|
||||
expect(result.limitations).toContainEqual(
|
||||
expect.stringContaining("Versions/Current selects is unknown"),
|
||||
);
|
||||
});
|
||||
|
||||
it("excludes AppleDouble sidecars from roots and roles", () => {
|
||||
const result = project(
|
||||
inventoryEvidence("zip", "Fixture.zip", [
|
||||
macho("Fixture.app/Contents/MacOS/Fixture"),
|
||||
{ path: "Fixture.app/Contents/Library/LaunchDaemons/._helper.plist" },
|
||||
{ path: "Fixture.app/Contents/Library/LaunchDaemons/helper.plist" },
|
||||
{ path: "__MACOSX/Other.app/Contents/._Info.plist" },
|
||||
]),
|
||||
);
|
||||
expect(result.application_roots).toEqual(["Fixture.app"]);
|
||||
expect(result.components.launchd_plists.map(({ path }) => path)).toEqual([
|
||||
"Fixture.app/Contents/Library/LaunchDaemons/helper.plist",
|
||||
]);
|
||||
expect(result.limitations).toContainEqual(
|
||||
expect.stringContaining("AppleDouble sidecar entries"),
|
||||
);
|
||||
});
|
||||
|
||||
it("reports a DMG without inventoried contents as partial", () => {
|
||||
const result = project(inventoryEvidence("dmg", "Fixture.dmg", []));
|
||||
expect(result.coverage).toEqual({
|
||||
status: "partial",
|
||||
inventory_complete: true,
|
||||
});
|
||||
expect(result.limitations).toContain(
|
||||
"The DMG's contents were not inventoried on this host; bundle absence is unknown.",
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps IPA applications shallow and iOS", () => {
|
||||
const result = project(
|
||||
inventoryEvidence("ipa", "Fixture.ipa", [
|
||||
{ path: "Payload/Fixture.app/Info.plist" },
|
||||
macho("Payload/Fixture.app/Fixture"),
|
||||
{ path: "Payload/Fixture.app/embedded.mobileprovision" },
|
||||
macho("Payload/Fixture.app/PlugIns/Share.appex/Share"),
|
||||
]),
|
||||
);
|
||||
expect(result.platforms).toEqual(["ios"]);
|
||||
expect(
|
||||
result.bundles.map(({ path, role, layout }) => [path, role, layout]),
|
||||
).toEqual([
|
||||
["Payload/Fixture.app", "application", "shallow"],
|
||||
["Payload/Fixture.app/PlugIns/Share.appex", "app-extension", "shallow"],
|
||||
]);
|
||||
expect(result.bundles[0]?.executable_candidates).toEqual([
|
||||
"Payload/Fixture.app/Fixture",
|
||||
]);
|
||||
});
|
||||
|
||||
it("rejects inventories that cannot contain an Apple application", () => {
|
||||
expect(() => project(inventoryEvidence("asar", "app.asar", []))).toThrow(
|
||||
"Apple application projection requires IPA, directory, ZIP, or DMG inventory Evidence (got asar)",
|
||||
);
|
||||
});
|
||||
});
|
||||
+144
-50
@@ -3,6 +3,17 @@ import { createHash } from "node:crypto";
|
||||
import canonicalize from "canonicalize";
|
||||
import { z } from "zod";
|
||||
|
||||
import {
|
||||
appleBundleSchema,
|
||||
appleComponentSchema,
|
||||
applicationRoots,
|
||||
detectBundles,
|
||||
isMachOFormat,
|
||||
isSidecar,
|
||||
isWithin,
|
||||
platformsOf,
|
||||
type AppleInventoryEntry,
|
||||
} from "./appleBundleAnatomy.js";
|
||||
import { parseArtifactInventoryEvidence } from "./artifactInventoryEvidence.js";
|
||||
import { evidenceSchema } from "./evidence.js";
|
||||
import { digestSchema } from "./../domain/digests.js";
|
||||
@@ -11,12 +22,7 @@ import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
const evidenceIdSchema = prefixedDigestSchema("ev");
|
||||
const pathSchema = z.string().min(1);
|
||||
|
||||
const componentSchema = z.strictObject({
|
||||
path: pathSchema,
|
||||
artifact_id: prefixedDigestSchema("art"),
|
||||
sha256: digestSchema,
|
||||
format: z.string().min(1),
|
||||
});
|
||||
const APPLE_ROOT_FORMATS = ["ipa", "directory", "zip", "dmg"] as const;
|
||||
|
||||
/** Authenticated artifact inventory pages projected as one Apple application. */
|
||||
export const appleApplicationProjectionInputSchema = z.strictObject({
|
||||
@@ -27,17 +33,25 @@ export const appleApplicationProjectionInputSchema = z.strictObject({
|
||||
export const appleApplicationProjectionResultSchema = z.strictObject({
|
||||
projection_id: prefixedDigestSchema("aap"),
|
||||
root_sha256: digestSchema,
|
||||
root_format: z.literal("ipa"),
|
||||
root_format: z.enum(APPLE_ROOT_FORMATS),
|
||||
platforms: z.array(z.enum(["ios", "macos"])),
|
||||
source_evidence_ids: z.array(evidenceIdSchema).min(1),
|
||||
application_roots: z.array(pathSchema),
|
||||
bundles: z.array(appleBundleSchema),
|
||||
components: z.strictObject({
|
||||
bundle_metadata: z.array(componentSchema),
|
||||
executables: z.array(componentSchema),
|
||||
frameworks: z.array(componentSchema),
|
||||
native_libraries: z.array(componentSchema),
|
||||
javascript: z.array(componentSchema),
|
||||
signing: z.array(componentSchema),
|
||||
bundle_metadata: z.array(appleComponentSchema),
|
||||
executables: z.array(appleComponentSchema),
|
||||
frameworks: z.array(appleComponentSchema),
|
||||
native_libraries: z.array(appleComponentSchema),
|
||||
javascript: z.array(appleComponentSchema),
|
||||
signing: z.array(appleComponentSchema),
|
||||
privileged_helpers: z.array(appleComponentSchema),
|
||||
launchd_plists: z.array(
|
||||
appleComponentSchema.extend({ domain: z.enum(["agent", "daemon"]) }),
|
||||
),
|
||||
helpers: z.array(appleComponentSchema),
|
||||
}),
|
||||
symlinks: z.array(pathSchema),
|
||||
runtime_families: z.array(
|
||||
z.enum([
|
||||
"native",
|
||||
@@ -74,9 +88,10 @@ export type AppleApplicationProjectionResult = z.infer<
|
||||
typeof appleApplicationProjectionResultSchema
|
||||
>;
|
||||
|
||||
type Component = z.infer<typeof componentSchema>;
|
||||
type Component = z.infer<typeof appleComponentSchema>;
|
||||
type RootFormat = (typeof APPLE_ROOT_FORMATS)[number];
|
||||
|
||||
/** Project exact IPA paths and hashes without parsing or executing target code. */
|
||||
/** Project exact Apple application paths and hashes without parsing or executing target code. */
|
||||
export const projectAppleApplication = (
|
||||
input: AppleApplicationProjectionInput,
|
||||
): AppleApplicationProjectionResult => {
|
||||
@@ -84,38 +99,42 @@ export const projectAppleApplication = (
|
||||
const { evidence, inventory } = parseArtifactInventoryEvidence(
|
||||
parsed.inventory_evidence,
|
||||
);
|
||||
if (inventory.manifest.root_format !== "ipa")
|
||||
throw new TypeError("Apple application projection requires IPA Evidence");
|
||||
const rootFormat = appleRootFormat(inventory.manifest.root_format);
|
||||
const nodes = new Map(
|
||||
inventory.nodes.map((node) => [node.artifact_id, node]),
|
||||
);
|
||||
const all = inventory.occurrences
|
||||
.filter(
|
||||
(occurrence) =>
|
||||
occurrence.artifact_id !== null && occurrence.logical_path !== ".",
|
||||
)
|
||||
const entries: AppleInventoryEntry[] = inventory.occurrences
|
||||
.filter(({ logical_path: path }) => path !== ".")
|
||||
.map((occurrence) => {
|
||||
const node = nodes.get(occurrence.artifact_id ?? "");
|
||||
if (occurrence.artifact_id === null)
|
||||
return {
|
||||
path: occurrence.logical_path,
|
||||
kind: occurrence.entry_kind,
|
||||
component: undefined,
|
||||
};
|
||||
const node = nodes.get(occurrence.artifact_id);
|
||||
if (node === undefined)
|
||||
throw new TypeError(
|
||||
"Apple application occurrence has no artifact node",
|
||||
);
|
||||
return {
|
||||
path: occurrence.logical_path,
|
||||
artifact_id: node.artifact_id,
|
||||
sha256: node.sha256,
|
||||
format: node.format,
|
||||
} satisfies Component;
|
||||
kind: occurrence.entry_kind,
|
||||
component: {
|
||||
path: occurrence.logical_path,
|
||||
artifact_id: node.artifact_id,
|
||||
sha256: node.sha256,
|
||||
format: node.format,
|
||||
},
|
||||
};
|
||||
});
|
||||
const roots = [
|
||||
...new Set(
|
||||
inventory.occurrences.flatMap(({ logical_path: path }) => {
|
||||
const match = /^(Payload\/[^/]+\.app)(?:\/|$)/u.exec(path);
|
||||
return match?.[1] === undefined ? [] : [match[1]];
|
||||
}),
|
||||
),
|
||||
].sort(compare);
|
||||
const classified = classifyComponents(all, roots);
|
||||
const all = entries.flatMap(({ component }) =>
|
||||
component === undefined ? [] : [component],
|
||||
);
|
||||
const subjectName = evidence[0]?.subject?.name ?? "";
|
||||
const roots = applicationRoots(entries, subjectName);
|
||||
const bundles = detectBundles(entries, roots);
|
||||
const classified = classifyComponents(entries, all, roots);
|
||||
const runtimeFamilies = identifyRuntimeFamilies(all);
|
||||
const bridgeProjection = identifyBridgeCandidates(
|
||||
classified.javascript,
|
||||
@@ -124,19 +143,35 @@ export const projectAppleApplication = (
|
||||
...classified.native_libraries,
|
||||
]),
|
||||
);
|
||||
const limitations = projectionLimitations(inventory.complete, roots);
|
||||
const uninventoriedImage =
|
||||
rootFormat === "dmg" && inventory.occurrences.length === 1;
|
||||
const complete = inventory.complete && !uninventoriedImage;
|
||||
const limitations = projectionLimitations({
|
||||
complete: inventory.complete,
|
||||
uninventoriedImage,
|
||||
roots,
|
||||
bundles,
|
||||
sidecars: entries.some(({ path }) => isSidecar(path)),
|
||||
symlinks: entries.some(({ kind }) => kind === "symlink"),
|
||||
});
|
||||
const withoutId = {
|
||||
root_sha256: inventory.manifest.root_sha256,
|
||||
root_format: "ipa" as const,
|
||||
root_format: rootFormat,
|
||||
platforms: platformsOf(bundles),
|
||||
source_evidence_ids: evidence
|
||||
.map(({ evidence_id: id }) => id)
|
||||
.sort(compare),
|
||||
application_roots: roots,
|
||||
bundles,
|
||||
components: classified,
|
||||
symlinks: entries
|
||||
.filter(({ kind }) => kind === "symlink")
|
||||
.map(({ path }) => path)
|
||||
.sort(compare),
|
||||
runtime_families: runtimeFamilies,
|
||||
bridge_candidates: bridgeProjection.candidates,
|
||||
coverage: {
|
||||
status: inventory.complete
|
||||
status: complete
|
||||
? ("complete-within-inventory" as const)
|
||||
: ("partial" as const),
|
||||
inventory_complete: inventory.complete,
|
||||
@@ -149,28 +184,59 @@ export const projectAppleApplication = (
|
||||
});
|
||||
};
|
||||
|
||||
const appleRootFormat = (format: string): RootFormat => {
|
||||
const root = APPLE_ROOT_FORMATS.find((candidate) => candidate === format);
|
||||
if (root === undefined)
|
||||
throw new TypeError(
|
||||
`Apple application projection requires IPA, directory, ZIP, or DMG inventory Evidence (got ${format})`,
|
||||
);
|
||||
return root;
|
||||
};
|
||||
|
||||
const classifyComponents = (
|
||||
entries: readonly AppleInventoryEntry[],
|
||||
all: readonly Component[],
|
||||
roots: readonly string[],
|
||||
) => {
|
||||
const withinApp = (path: string): boolean =>
|
||||
roots.some((root) => path.startsWith(`${root}/`));
|
||||
roots.some((root) => isWithin(path, root));
|
||||
const anatomy = (pattern: RegExp): Component[] =>
|
||||
entries.flatMap(({ path, kind, component }) =>
|
||||
kind === "file" &&
|
||||
component !== undefined &&
|
||||
!isSidecar(path) &&
|
||||
withinApp(path) &&
|
||||
pattern.test(path)
|
||||
? [component]
|
||||
: [],
|
||||
);
|
||||
return {
|
||||
bundle_metadata: all.filter(({ path }) =>
|
||||
/(?:^|\/)Info\.plist$/u.test(path),
|
||||
),
|
||||
executables: all.filter(
|
||||
({ path, format }) =>
|
||||
withinApp(path) && ["mach-o", "mach-o-universal"].includes(format),
|
||||
({ path, format }) => withinApp(path) && isMachOFormat(format),
|
||||
),
|
||||
frameworks: all.filter(({ path }) => /\.framework\//u.test(path)),
|
||||
native_libraries: all.filter(({ path }) => /\.(?:dylib|so)$/iu.test(path)),
|
||||
javascript: all.filter(({ format }) => format === "javascript-bundle"),
|
||||
signing: all.filter(({ path }) =>
|
||||
/(?:^|\/)(?:embedded\.mobileprovision|_CodeSignature\/CodeResources)$/u.test(
|
||||
/(?:^|\/)(?:embedded\.(?:mobileprovision|provisionprofile)|_CodeSignature\/CodeResources)$/u.test(
|
||||
path,
|
||||
),
|
||||
),
|
||||
privileged_helpers: anatomy(
|
||||
/(?:^|\/)Contents\/Library\/LaunchServices\/[^/]+$/u,
|
||||
),
|
||||
launchd_plists: anatomy(
|
||||
/(?:^|\/)Contents\/Library\/Launch(?:Agents|Daemons)\/[^/]+\.plist$/u,
|
||||
).map((component) => ({
|
||||
...component,
|
||||
domain: component.path.includes("/LaunchDaemons/")
|
||||
? ("daemon" as const)
|
||||
: ("agent" as const),
|
||||
})),
|
||||
helpers: anatomy(/(?:^|\/)Contents\/Helpers\/[^/]+$/u),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -241,18 +307,46 @@ const bridgeBasis = (
|
||||
return "javascript-and-native-content";
|
||||
};
|
||||
|
||||
const projectionLimitations = (
|
||||
complete: boolean,
|
||||
roots: readonly string[],
|
||||
): string[] => [
|
||||
...(!complete
|
||||
const projectionLimitations = (facts: {
|
||||
readonly complete: boolean;
|
||||
readonly uninventoriedImage: boolean;
|
||||
readonly roots: readonly string[];
|
||||
readonly bundles: readonly z.infer<typeof appleBundleSchema>[];
|
||||
readonly sidecars: boolean;
|
||||
readonly symlinks: boolean;
|
||||
}): string[] => [
|
||||
...(!facts.complete
|
||||
? ["Source inventory pages are incomplete; absence is unknown."]
|
||||
: []),
|
||||
...(roots.length === 0
|
||||
...(facts.uninventoriedImage
|
||||
? [
|
||||
"No Payload/*.app directory was present in the supplied inventory pages.",
|
||||
"The DMG's contents were not inventoried on this host; bundle absence is unknown.",
|
||||
]
|
||||
: []),
|
||||
...(facts.roots.length === 0
|
||||
? [
|
||||
"No application bundle (Payload/*.app or *.app/Contents) was present in the supplied inventory pages.",
|
||||
]
|
||||
: []),
|
||||
...(facts.bundles.some(
|
||||
({ layout, info_plist_path: plist }) =>
|
||||
layout === "versioned-framework" && plist === null,
|
||||
)
|
||||
? [
|
||||
"A versioned framework has zero or several Versions/*/Resources/Info.plist files; the one Versions/Current selects is unknown because symlink targets are not inventoried.",
|
||||
]
|
||||
: []),
|
||||
...(facts.symlinks
|
||||
? [
|
||||
"Symlinks are reported by path only; their targets are not inventoried, so bundles are reported at their real paths.",
|
||||
]
|
||||
: []),
|
||||
...(facts.sidecars
|
||||
? [
|
||||
"AppleDouble sidecar entries (._* files and __MACOSX/) describe neighbouring files and are excluded from bundle roles.",
|
||||
]
|
||||
: []),
|
||||
"Bundle roles follow path conventions. Read each info_plist_path with inspect_plist for CFBundleExecutable, identifiers, and declared services.",
|
||||
"Bundle identifiers and signing claims require dedicated plist and CMS parsing; this projection reports only exact paths and hashes.",
|
||||
"Bridge candidates are path-based hypotheses, not observed runtime calls.",
|
||||
];
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { digestSchema, prefixedDigestSchema } from "./digests.js";
|
||||
|
||||
const pathSchema = z.string().min(1);
|
||||
|
||||
const BUNDLE_EXTENSION =
|
||||
/\.(?:app|appex|xpc|framework|systemextension|dext|bundle|plugin|qlgenerator|mdimporter)$/iu;
|
||||
const MACH_O_FORMATS: readonly string[] = ["mach-o", "mach-o-universal"];
|
||||
|
||||
/** One inventoried file or directory with its content identity. */
|
||||
export const appleComponentSchema = z.strictObject({
|
||||
path: pathSchema,
|
||||
artifact_id: prefixedDigestSchema("art"),
|
||||
sha256: digestSchema,
|
||||
format: z.string().min(1),
|
||||
});
|
||||
|
||||
/** One application root or nested bundle classified by path convention. */
|
||||
export const appleBundleSchema = z.strictObject({
|
||||
path: pathSchema,
|
||||
parent_path: pathSchema.nullable(),
|
||||
layout: z.enum(["shallow", "macos-deep", "versioned-framework"]),
|
||||
role: z.enum([
|
||||
"application",
|
||||
"app-extension",
|
||||
"xpc-service",
|
||||
"framework",
|
||||
"login-item",
|
||||
"system-extension",
|
||||
"driver-extension",
|
||||
"plug-in",
|
||||
"resource-bundle",
|
||||
"bundle",
|
||||
"helper-application",
|
||||
"nested-application",
|
||||
]),
|
||||
role_basis: z.literal("path-convention"),
|
||||
info_plist_path: pathSchema.nullable(),
|
||||
executable_candidates: z.array(pathSchema),
|
||||
signing_paths: z.array(pathSchema),
|
||||
});
|
||||
|
||||
type Component = z.infer<typeof appleComponentSchema>;
|
||||
type Bundle = z.infer<typeof appleBundleSchema>;
|
||||
|
||||
/** One inventory occurrence; symlinks and directories may lack content identity. */
|
||||
export interface AppleInventoryEntry {
|
||||
readonly path: string;
|
||||
readonly kind: "file" | "directory" | "symlink" | "slice";
|
||||
readonly component: Component | undefined;
|
||||
}
|
||||
type Entry = AppleInventoryEntry;
|
||||
|
||||
/** Report whether an inventory format is a thin or universal Mach-O. */
|
||||
export const isMachOFormat = (format: string): boolean =>
|
||||
MACH_O_FORMATS.includes(format);
|
||||
|
||||
/** AppleDouble metadata written beside archived files (`._name`, `__MACOSX/`). */
|
||||
export const isSidecar = (path: string): boolean => {
|
||||
const segments = path.split("/");
|
||||
return (
|
||||
segments.includes("__MACOSX") || (segments.at(-1) ?? "").startsWith("._")
|
||||
);
|
||||
};
|
||||
|
||||
export const isWithin = (path: string, root: string): boolean =>
|
||||
root === "." || path === root || path.startsWith(`${root}/`);
|
||||
|
||||
/**
|
||||
* Outermost iOS (`Payload/X.app`) and macOS (`X.app/Contents/…`) applications.
|
||||
* An inventoried `.app` directory is its own root, `.`.
|
||||
*/
|
||||
export const applicationRoots = (
|
||||
entries: readonly Entry[],
|
||||
subjectName: string,
|
||||
): string[] => {
|
||||
const found = new Set<string>();
|
||||
for (const { path } of entries) {
|
||||
if (isSidecar(path)) continue;
|
||||
const ios = /^(Payload\/[^/]+\.app)(?:\/|$)/u.exec(path);
|
||||
if (ios?.[1] !== undefined) {
|
||||
found.add(ios[1]);
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
/\.app$/iu.test(subjectName) &&
|
||||
/^Contents\/(?:Info\.plist|MacOS\/[^/]+)$/u.test(path)
|
||||
) {
|
||||
found.add(".");
|
||||
continue;
|
||||
}
|
||||
const segments = path.split("/");
|
||||
const index = segments.findIndex(
|
||||
(segment, position) =>
|
||||
/\.app$/iu.test(segment) && segments[position + 1] === "Contents",
|
||||
);
|
||||
if (index >= 0) found.add(segments.slice(0, index + 1).join("/"));
|
||||
}
|
||||
const roots = [...found];
|
||||
return roots
|
||||
.filter(
|
||||
(root) => !roots.some((other) => other !== root && isWithin(root, other)),
|
||||
)
|
||||
.sort(compare);
|
||||
};
|
||||
|
||||
export const detectBundles = (
|
||||
entries: readonly Entry[],
|
||||
roots: readonly string[],
|
||||
): Bundle[] => {
|
||||
const paths = new Set<string>(roots);
|
||||
for (const { path, kind } of entries) {
|
||||
if (isSidecar(path)) continue;
|
||||
const root = roots.find((candidate) => isWithin(path, candidate));
|
||||
if (root === undefined) continue;
|
||||
const segments = path.split("/");
|
||||
const start = root === "." ? 0 : root.split("/").length;
|
||||
for (let index = start; index < segments.length; index++) {
|
||||
const segment = segments[index] ?? "";
|
||||
const leaf = index === segments.length - 1;
|
||||
// A symlink or file named like a bundle has no observed contents.
|
||||
if (BUNDLE_EXTENSION.test(segment) && (!leaf || kind === "directory"))
|
||||
paths.add(segments.slice(0, index + 1).join("/"));
|
||||
}
|
||||
}
|
||||
const tree = indexTree(entries);
|
||||
return [...paths].sort(compare).map((path) => {
|
||||
const layout = bundleLayout(path, tree);
|
||||
return {
|
||||
path,
|
||||
parent_path: enclosingBundle(path, paths),
|
||||
layout,
|
||||
role: roots.includes(path) ? "application" : bundleRole(path),
|
||||
role_basis: "path-convention",
|
||||
info_plist_path: infoPlistPath(path, layout, tree),
|
||||
executable_candidates: executableCandidates(path, layout, tree),
|
||||
signing_paths: signingPaths(path, layout, tree),
|
||||
} satisfies Bundle;
|
||||
});
|
||||
};
|
||||
|
||||
/** Directory children (including implied ancestors) and files, indexed once. */
|
||||
interface Tree {
|
||||
readonly children: ReadonlyMap<string, ReadonlySet<string>>;
|
||||
readonly files: ReadonlyMap<string, Component>;
|
||||
}
|
||||
|
||||
const indexTree = (entries: readonly Entry[]): Tree => {
|
||||
const children = new Map<string, Set<string>>();
|
||||
const files = new Map<string, Component>();
|
||||
for (const { path, kind, component } of entries) {
|
||||
if (isSidecar(path)) continue;
|
||||
if (kind === "file" && component !== undefined) files.set(path, component);
|
||||
const segments = path.split("/");
|
||||
let parent = "";
|
||||
for (const segment of segments) {
|
||||
const names = children.get(parent) ?? new Set<string>();
|
||||
names.add(segment);
|
||||
children.set(parent, names);
|
||||
parent = joinPath(parent, segment);
|
||||
}
|
||||
}
|
||||
return { children, files };
|
||||
};
|
||||
|
||||
const joinPath = (directory: string, name: string): string =>
|
||||
directory === "" ? name : `${directory}/${name}`;
|
||||
|
||||
const directoryOf = (bundle: string): string => (bundle === "." ? "" : bundle);
|
||||
|
||||
const enclosingBundle = (
|
||||
path: string,
|
||||
bundles: ReadonlySet<string>,
|
||||
): string | null => {
|
||||
if (path === ".") return null;
|
||||
const segments = path.split("/");
|
||||
for (let length = segments.length - 1; length > 0; length--) {
|
||||
const candidate = segments.slice(0, length).join("/");
|
||||
if (bundles.has(candidate)) return candidate;
|
||||
}
|
||||
return bundles.has(".") ? "." : null;
|
||||
};
|
||||
|
||||
const bundleLayout = (bundle: string, tree: Tree): Bundle["layout"] => {
|
||||
const names = tree.children.get(directoryOf(bundle));
|
||||
if (names?.has("Contents") === true) return "macos-deep";
|
||||
if (names?.has("Versions") === true) return "versioned-framework";
|
||||
return "shallow";
|
||||
};
|
||||
|
||||
const bundleRole = (bundle: string): Bundle["role"] => {
|
||||
const segments = bundle.split("/");
|
||||
const name = (segments.at(-1) ?? "").toLowerCase();
|
||||
const container = segments.at(-2);
|
||||
if (name.endsWith(".appex")) return "app-extension";
|
||||
if (name.endsWith(".xpc")) return "xpc-service";
|
||||
if (name.endsWith(".framework")) return "framework";
|
||||
if (name.endsWith(".systemextension")) return "system-extension";
|
||||
if (name.endsWith(".dext")) return "driver-extension";
|
||||
if (name.endsWith(".bundle")) {
|
||||
if (container === "PlugIns") return "plug-in";
|
||||
return container === "Resources" ? "resource-bundle" : "bundle";
|
||||
}
|
||||
if (!name.endsWith(".app")) return "plug-in";
|
||||
if (container === "LoginItems" && segments.at(-3) === "Library")
|
||||
return "login-item";
|
||||
if (container === "Helpers") return "helper-application";
|
||||
return "nested-application";
|
||||
};
|
||||
|
||||
/** Files directly inside one directory; nested bundles are deeper paths. */
|
||||
const directFiles = (directory: string, tree: Tree): string[] =>
|
||||
[...(tree.children.get(directory) ?? [])]
|
||||
.map((name) => joinPath(directory, name))
|
||||
.filter((path) => tree.files.has(path))
|
||||
.sort(compare);
|
||||
|
||||
/** Content directories; `Versions/Current` is a symlink outside the inventory. */
|
||||
const contentDirectories = (
|
||||
bundle: string,
|
||||
layout: Bundle["layout"],
|
||||
tree: Tree,
|
||||
): string[] => {
|
||||
const directory = directoryOf(bundle);
|
||||
if (layout === "macos-deep") return [joinPath(directory, "Contents")];
|
||||
if (layout === "shallow") return [directory];
|
||||
const versions = joinPath(directory, "Versions");
|
||||
return [...(tree.children.get(versions) ?? [])]
|
||||
.filter((version) => version !== "Current")
|
||||
.map((version) => joinPath(versions, version))
|
||||
.sort(compare);
|
||||
};
|
||||
|
||||
const infoPlistPath = (
|
||||
bundle: string,
|
||||
layout: Bundle["layout"],
|
||||
tree: Tree,
|
||||
): string | null => {
|
||||
const candidates = contentDirectories(bundle, layout, tree)
|
||||
.map((directory) =>
|
||||
joinPath(
|
||||
directory,
|
||||
layout === "versioned-framework"
|
||||
? "Resources/Info.plist"
|
||||
: "Info.plist",
|
||||
),
|
||||
)
|
||||
.filter((path) => tree.files.has(path));
|
||||
return candidates.length === 1 ? (candidates[0] ?? null) : null;
|
||||
};
|
||||
|
||||
const executableCandidates = (
|
||||
bundle: string,
|
||||
layout: Bundle["layout"],
|
||||
tree: Tree,
|
||||
): string[] =>
|
||||
contentDirectories(bundle, layout, tree)
|
||||
.flatMap((directory) =>
|
||||
directFiles(
|
||||
layout === "macos-deep" ? joinPath(directory, "MacOS") : directory,
|
||||
tree,
|
||||
),
|
||||
)
|
||||
.filter((path) =>
|
||||
MACH_O_FORMATS.includes(tree.files.get(path)?.format ?? ""),
|
||||
);
|
||||
|
||||
const signingPaths = (
|
||||
bundle: string,
|
||||
layout: Bundle["layout"],
|
||||
tree: Tree,
|
||||
): string[] =>
|
||||
contentDirectories(bundle, layout, tree)
|
||||
.flatMap((directory) => [
|
||||
joinPath(directory, "_CodeSignature/CodeResources"),
|
||||
joinPath(directory, "embedded.provisionprofile"),
|
||||
joinPath(directory, "embedded.mobileprovision"),
|
||||
])
|
||||
.filter((path) => tree.files.has(path))
|
||||
.sort(compare);
|
||||
|
||||
export const platformsOf = (bundles: readonly Bundle[]): ("ios" | "macos")[] =>
|
||||
[
|
||||
...new Set(
|
||||
bundles.flatMap(({ role, layout }) => {
|
||||
if (role !== "application") return [];
|
||||
if (layout === "macos-deep") return ["macos" as const];
|
||||
if (layout === "shallow") return ["ios" as const];
|
||||
return [];
|
||||
}),
|
||||
),
|
||||
].sort(compare);
|
||||
|
||||
const compare = (left: string, right: string): number =>
|
||||
left < right ? -1 : left > right ? 1 : 0;
|
||||
File diff suppressed because one or more lines are too long
@@ -5,5 +5,5 @@ export const PACKAGE_METADATA = {
|
||||
serverSdkVersion: "2.3.1",
|
||||
clientSdkVersion: "2.3.1",
|
||||
coreSdkVersion: "2.3.1",
|
||||
skillVersion: "26",
|
||||
skillVersion: "27",
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user