Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions prompt-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
bin/agent
bin/prompt-gateway
.prompt-gateway/
*.db
*.db-wal
*.db-shm
39 changes: 39 additions & 0 deletions prompt-gateway/esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as esbuild from "esbuild";

const shared = {
bundle: true,
platform: "node",
target: "node20",
format: "esm",
sourcemap: true,
// better-sqlite3 is a native addon — must stay external
external: ["better-sqlite3"],
banner: {
// ESM needs createRequire for native modules
js: `
import { createRequire } from 'module';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const require = createRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
`.trim(),
},
};

// CLI: agent command
await esbuild.build({
...shared,
entryPoints: ["src/bin/agent.ts"],
outfile: "dist/agent.mjs",
});

// Daemon: prompt-gateway server
await esbuild.build({
...shared,
entryPoints: ["src/index.ts"],
outfile: "dist/prompt-gateway.mjs",
});

console.log("✓ Built dist/agent.mjs");
console.log("✓ Built dist/prompt-gateway.mjs");
Loading