Lines 26-66javascript
26import { execCommand } from "../exec.js";
27import { createSyntheticSourceInfo } from "../source-info.js";
28/** Modules available to extensions via virtualModules (for compiled Bun binary) */
29const VIRTUAL_MODULES = {
30 typebox: _bundledTypebox,
31 "typebox/compile": _bundledTypeboxCompile,
32 "typebox/value": _bundledTypeboxValue,
33 "@sinclair/typebox": _bundledTypebox,
34 "@sinclair/typebox/compile": _bundledTypeboxCompile,
35 "@sinclair/typebox/value": _bundledTypeboxValue,
36 "@earendil-works/pi-agent-core": _bundledPiAgentCore,
37 "@earendil-works/pi-tui": _bundledPiTui,
38 "@earendil-works/pi-ai": _bundledPiAi,
39 "@earendil-works/pi-ai/oauth": _bundledPiAiOauth,
40 "@earendil-works/pi-coding-agent": _bundledPiCodingAgent,
41 "@mariozechner/pi-agent-core": _bundledPiAgentCore,
42 "@mariozechner/pi-tui": _bundledPiTui,
43 "@mariozechner/pi-ai": _bundledPiAi,
44 "@mariozechner/pi-ai/oauth": _bundledPiAiOauth,
45 "@mariozechner/pi-coding-agent": _bundledPiCodingAgent,
47const require = createRequire(import.meta.url);
48/**
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/core/extensions/loader.jsView on unpkg · L46 49 * Get aliases for jiti (used in Node.js/development mode).
50 * In Bun binary mode, virtualModules is used instead.
53function getAliases() {
56 const __dirname = path.dirname(fileURLToPath(import.meta.url));
57 const packageIndex = path.resolve(__dirname, "../..", "index.js");
58 const typeboxEntry = require.resolve("typebox");
59 const typeboxCompileEntry = require.resolve("typebox/compile");
60 const typeboxValueEntry = require.resolve("typebox/value");
61 const packagesRoot = path.resolve(__dirname, "../../../../");
62 const resolveWorkspaceOrImport = (workspaceRelativePath, specifier) => {
63 const workspacePath = path.join(packagesRoot, workspaceRelativePath);
64 if (fs.existsSync(workspacePath)) {