/**
 * Per-target entry — darwin-arm64.
 *
 * Embeds the three native artifacts Myco needs at runtime (libsqlite3 with
 * extension loading enabled, sqlite-vec's vec0 extension, and the ripgrep
 * binary) and registers them before the rest of the CLI runs.
 *
 * Bun's `import X from './file' with { type: 'file' }` copies the file into
 * the compiled binary. At runtime the identifier resolves to a virtual
 * `/$bunfs/` path that we materialize to the real filesystem via
 * `registerEmbeddedNativeDeps()` before any Database is opened.
 *
 * Do not edit this file by hand to add logic — only the three imports and
 * the registerEmbeddedNativeDeps call should live here. Shared runtime
 * logic belongs in `src/runtime/native-deps.ts`.
 */

// @ts-expect-error - Bun file-embed import assertion
import libsqliteEmbed from '../../vendor-src/libsqlite3/darwin-arm64/libsqlite3.dylib' with { type: 'file' };
// @ts-expect-error
import vec0Embed from 'sqlite-vec-darwin-arm64/vec0.dylib' with { type: 'file' };
// @ts-expect-error
import ripgrepEmbed from '@vscode/ripgrep-darwin-arm64/bin/rg' with { type: 'file' };

import { registerEmbeddedNativeDeps } from '../runtime/native-deps.js';
import { setPluginVersion } from '../version.js';
import pkg from '../../package.json' with { type: 'json' };

setPluginVersion(pkg.version);

await registerEmbeddedNativeDeps({
  libsqliteEmbed,
  vec0Embed,
  ripgrepEmbed,
  version: pkg.version,
});

await import('./cli.js');
