Skip to content

Commit 7b48e5d

Browse files
committed
chore: release v0.3.0
- Polyfill markAsUncloneable for Bun compatibility (undici@8 requirement) - URL fetching, proxy support, quality gates, TUI fixes
1 parent 151de57 commit 7b48e5d

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devagent-ts",
3-
"version": "0.2.4",
3+
"version": "0.3.0",
44
"private": true,
55
"packageManager": "bun@1.3.10",
66
"license": "MIT",

scripts/bundle.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,23 @@ if (result.exitCode !== 0) {
5656
process.exit(1);
5757
}
5858

59-
// Ensure shebang is present
59+
// Ensure shebang is present and add polyfills for missing Node.js APIs (e.g. Bun < 1.4)
6060
const bundleContent = readFileSync(join(DIST, "devagent.js"), "utf-8");
61-
if (!bundleContent.startsWith("#!/")) {
61+
const polyfill = [
62+
"// Polyfill markAsUncloneable for Bun (undici@8 requires it from node:worker_threads)",
63+
"try { const wt = require('node:worker_threads'); if (!wt.markAsUncloneable) wt.markAsUncloneable = function() {}; } catch {}",
64+
"",
65+
].join("\n");
66+
if (bundleContent.startsWith("#!/")) {
67+
const firstNewline = bundleContent.indexOf("\n");
6268
writeFileSync(
6369
join(DIST, "devagent.js"),
64-
"#!/usr/bin/env node\n" + bundleContent,
70+
bundleContent.slice(0, firstNewline + 1) + polyfill + bundleContent.slice(firstNewline + 1),
71+
);
72+
} else {
73+
writeFileSync(
74+
join(DIST, "devagent.js"),
75+
"#!/usr/bin/env node\n" + polyfill + bundleContent,
6576
);
6677
}
6778

0 commit comments

Comments
 (0)