import { type NodePlatform } from './node-runtime.js'; import { type MurasakiConfig } from '../config.js'; export { loadUserConfig } from './load-config.js'; export type Arch = 'arm64' | 'x64'; export type Platform = NodePlatform; /** `--target -` (or `config.targets[0]`, or the host). */ export type BundleTarget = { platform: Platform; arch: Arch; }; /** * Pack `dist/client` + `dist/server` (the `'use server'` action registry) + * a copy of the current Node runtime + `assets/prod-server.mjs` + the * compiled `murasaki-launcher` native binary into a macOS `.app` bundle. * * production has no Vite dev server — `murasaki-launcher` (Rust, * crates/native/src/launcher.rs) spawns `prod-server.mjs`, a small Node HTTP * server that serves `dist/client` and runs actions out of the `dist/server` * registry, then points the native WebView at it over * `http://127.0.0.1:/`. This mirrors dev (Vite dev server) closely * enough that the client's `/__murasaki/action/…` fetch works unchanged in * both. */ export default function bundle(argv: string[]): Promise; /** * `` → a filesystem/shell-safe Linux executable name for * `usr/bin/` and the `.desktop` file's `Exec=`/`StartupWMClass=` * values — unlike macOS/Windows (where the launcher is invoked via a path * the OS bundle format itself resolves), an unquoted space in a `.desktop` * `Exec=` value is ambiguous per the freedesktop desktop-entry spec. Runs of * characters outside `[A-Za-z0-9._-]` collapse to a single `-`; falls back * to a generic name if that leaves nothing usable (e.g. an all-emoji * productName) — same convention as `sanitizeAssemblyName` below. */ export declare function sanitizeLinuxExecName(productName: string): string; /** * `config.appId` → a filesystem-safe id for the filenames the fixed Linux * layout derives from it (`.desktop`, `.png`, `usr/lib// * resources/`) — `appId` isn't validated for path-safety by config.ts (only * `productName`/`version` are, see `validateArtifactComponent`), so this * mirrors the same local sanitization `macTypeIdentifier` above already * applies for the same reason. */ export declare function sanitizeLinuxAppId(appId: string): string; /** * `/AppRun` — the entry point every AppImage type-2 runtime execs at * launch. Resolves the launcher binary via `$APPDIR`, the environment * variable the runtime sets to the mounted AppDir root before running this * script — NOT `dirname "$0"`, which would break once squashfs-mounted at a * runtime-chosen mountpoint (this is the AppImage spec's own recommended * idiom). */ export declare function linuxAppRunScript(execName: string): string; /** * The AppImage-required root `.desktop` file (also installed under * `usr/share/applications/` for the `.deb` — see installerLinux). `Comment` * falls back to the same `" desktop application"` text * associations.ts's file-association descriptions default to. * `Exec= %U` — the `%U` field code lets the desktop environment * pass an activation URL/file argument, matching `config.protocols`/ * `fileAssociations`. `StartupWMClass=` lets the window manager * associate the running window with this launcher entry (taskbar * grouping/pinning). `MimeType` is only emitted when protocols/file * associations are declared: `x-scheme-handler/` per protocol, and * per file association the declared `mimeType` when present, else * `application/x-` per extension — mirroring * the macOS/Windows association registration in `infoPlist`/ * `nsisAssociationRegistry`/`wixAssociationComponents`, but the `.desktop` * file is the whole of Linux's declaration surface here (there's no OS-level * MIME database to register a custom type into at bundle time). */ export declare function linuxDesktopEntry(config: MurasakiConfig, execName: string, appId: string): string; /** * Copy the Node Main lifecycle runtime without flattening its compiled module * graph. `main-runtime.js` imports sibling `launch.js` plus * `../main/logger.js`, `../main/sidecar.js`, and `../main/crash-reports.js`; * preserving that layout prevents packaged * apps from starting with an ERR_MODULE_NOT_FOUND after those production * services are enabled. `prod-server.mjs` also imports `crash-reports.js` * directly for its renderer crash-report endpoint. A private package * boundary marks the copied `.js` files as ESM. */ export declare function copyMainRuntime(resourcesDir: string): Promise; /** * The `murasaki-meta.json` object written into both the `.app`'s * `Contents/Resources/` and the win32 folder's `resources/` — read by * `murasaki-launcher` at runtime for window title/size, About panel fields, * etc., and by `prod-server.mjs` (from its cwd, the resources dir) for the * resolved updater config. Kept as one function so the two bundle targets * can't drift apart. */ export declare function metaJson(config: MurasakiConfig, productName: string, iconResource: string | null, cwd: string): string; /** * Builds the main app executable's entitlement plist. This deliberately does * not include Node's JIT/library-loading rights; those belong only to the * bundled helper returned by `helperEntitlementsPlist`. * * Hardened Runtime blocks protected resources unless the main executable has * the matching resource-access entitlement. These are independent from the * Info.plist purpose strings that cause the TCC consent prompt: signed builds * need both. Bluetooth and speech recognition have purpose strings but no * Hardened Runtime resource-access entitlement; the Bluetooth entitlement is * App-Sandbox-only. * App Sandbox is deliberately not generated here. The current bundled Node * process needs JIT rights that are incompatible with Apple's inherit-only * sandbox helper model; configuration validation and this lower-level helper * both reject attempts to enable it. */ export declare function entitlementsPlist(config: MurasakiConfig): string; /** * Builds the bundled Node helper's hardened-runtime entitlement plist. JIT * rights remain confined to Node; App Sandbox/inherit is rejected fail-closed. */ export declare function helperEntitlementsPlist(config: MurasakiConfig): string; /** * `--target -` (e.g. `win32-x64`), for cross-bundling a * platform other than the host. Falls back to `config.targets[0]` when * `--target` isn't passed, then to the host platform + `--arch`/host arch — * which is exactly the pre-`--target` behavior, so plain `murasaki bundle` * and `murasaki bundle --arch x64` on macOS are unaffected. * * Only a single target is resolved per invocation even when `config.targets` * lists several — building every configured target in one run is left to a * later pass (e.g. a loop in the `release` command); pass `--target` * explicitly to pick a specific one. */ export declare function parseTarget(argv: string[], config: MurasakiConfig): BundleTarget; /** * Locate the compiled `murasaki-launcher` binary for the target * platform/arch. Published `@murasakijs/native` ships prebuilt binaries * named `murasaki-launcher.` (see * .github/workflows/native-release.yml and crates/native/package.json's * `files`), matching the `.node` bindings' `murasaki-native..node` * naming — this resolves correctly for cross-platform/cross-arch builds too, * since the published package carries every supported launcher triple. * In workspace development, where `@murasakijs/native` resolves to the Rust * crate itself, refreshes the local release launcher when its Rust sources * are newer than the binary. This prevents a freshly-added framework * capability from being accepted by TypeScript/config generation but * rejected by a stale bundled host. Published packages contain no Cargo * source tree and always use their immutable target-specific prebuild. */ export declare function resolveLauncherBinary(nativeDir: string, platform: Platform, arch: Arch): Promise; /** True only for a workspace-linked native crate whose launcher is missing or stale. */ export declare function workspaceLauncherNeedsRebuild(nativeDir: string, launcherPath: string): Promise; /** * `config.icon` (a 1024px PNG) → a current macOS AppIcon asset catalog plus * `/icon.icns` + `icon.png` compatibility resources. * * Xcode's `actool` is the only supported writer for Assets.car. When a full * Xcode installation is available we compile AppIcon into Assets.car and let * macOS apply its platform mask. Command Line Tools alone only provide * `sips`/`iconutil`, so that environment receives a clear warning and the * legacy `.icns` fallback instead of silently pretending system masking is * active. */ type MacIconResources = { runtimePath: 'icon.png'; usesSystemMask: boolean; }; export declare function buildMacIconResources(cwd: string, iconPath: string, resourcesDir: string): Promise; /** * Create a tiny icon-only application bundle for the unbundled macOS dev * host. `NSApp.applicationIconImage = NSImage(contentsOfFile: rawPng)` skips * AppIcon rendering and exposes an opaque square in the Dock. Resolving this * bundle through `NSWorkspace.iconForFile` gives the same system-owned mask * and appearance treatment as a packaged application, without modifying the * developer's source artwork. * * The directory intentionally lives under the OS temp directory for the * duration of the dev process. It contains no runnable application code; the * placeholder executable only makes the icon carrier a structurally valid * bundle for LaunchServices. */ export declare function buildMacDevIconBundle(cwd: string, config: MurasakiConfig): Promise; export declare function infoPlist(config: MurasakiConfig, productName: string, hasIcon: boolean, hasSystemMaskedIcon?: boolean): string; //# sourceMappingURL=bundle.d.ts.map