build(coding-agent): prevented embedding native runtime dependencies

- Standardized `fastembed` and `onnxruntime-node` as external dependencies for all compiled binaries.
- Removed manual exclusion logic from individual build scripts in favor of a centralized configuration.
- Updated release build dry-run output to reflect consistent external dependency handling.

Fixes #5195
This commit is contained in:
can1357
2026-07-11 20:35:02 +02:00
parent 3d1f9a4a3c
commit 4181ef18b5
5 changed files with 13 additions and 6 deletions
@@ -1,6 +1,9 @@
import { buildDocsIndexPayload } from "./generate-docs-index";
import { createLegacyPiVirtualModulePlugin } from "./legacy-pi-virtual-module";
/** Native runtime dependencies always resolved from the on-demand install instead of embedded into compiled binaries. */
export const COMPILED_EXTERNAL_DEPENDENCIES: readonly string[] = Object.freeze(["fastembed", "onnxruntime-node"]);
/** Inputs shared by local and release coding-agent binary builds. */
export interface CodingAgentCompileOptions {
/** Absolute repository root used for package resolution. */
@@ -13,8 +16,6 @@ export interface CodingAgentCompileOptions {
readonly transformersVersion: string;
/** Optional cross-compilation runtime target. */
readonly target?: Bun.Build.CompileTarget;
/** Dependencies intentionally resolved from the runtime filesystem. */
readonly external?: readonly string[];
/** Match release builds that minify identifiers while retaining names. */
readonly minifyIdentifiers?: boolean;
/** Disable Bun's built-in Darwin signing before the caller re-signs. */
@@ -34,7 +35,7 @@ export async function compileCodingAgent(options: CodingAgentCompileOptions): Pr
const output = await Bun.build({
entrypoints: [options.entrypoint],
root: options.repoRoot,
external: options.external ? [...options.external] : undefined,
external: [...COMPILED_EXTERNAL_DEPENDENCIES],
define: {
"process.env.PI_COMPILED": JSON.stringify("true"),
"process.env.PI_TINY_TRANSFORMERS_VERSION": JSON.stringify(options.transformersVersion),