@builder.io/buildercode 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +16 -18
- package/package.json +1 -2
package/dist/cli.mjs
CHANGED
|
@@ -198373,10 +198373,7 @@ const LIB_CACHE = /* @__PURE__ */ new Map();
|
|
|
198373
198373
|
const PENDING_LIB_CACHE = /* @__PURE__ */ new Map();
|
|
198374
198374
|
const NODE_MODULE_CACHE = /* @__PURE__ */ new Map();
|
|
198375
198375
|
const TSCONFIG_CACHE = /* @__PURE__ */ new Map();
|
|
198376
|
-
|
|
198377
|
-
//#region ../dev-tools/cli/version.ts
|
|
198378
|
-
const builderVersion = typeof DEV_TOOLS_VERSION === "string" ? DEV_TOOLS_VERSION : "0.0.0";
|
|
198379
|
-
const pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
198376
|
+
const pkgVersion = process.env.OVERRIDE_VERSION ?? "0.3.1";
|
|
198380
198377
|
//#endregion
|
|
198381
198378
|
//#region ../dev-tools/core/detect-frameworks.ts
|
|
198382
198379
|
async function detectFrameworks$1(sys) {
|
|
@@ -533590,6 +533587,7 @@ function useCodeGenStateHandler() {
|
|
|
533590
533587
|
state.contextWindow = void 0;
|
|
533591
533588
|
state.usage = void 0;
|
|
533592
533589
|
state.hasPlanToApply = false;
|
|
533590
|
+
state.messages = [];
|
|
533593
533591
|
break;
|
|
533594
533592
|
case "message-queue":
|
|
533595
533593
|
state.queue = step.queue;
|
|
@@ -537994,7 +537992,7 @@ const FooterSection = (0, import_react.memo)(() => {
|
|
|
537994
537992
|
children: [
|
|
537995
537993
|
"•",
|
|
537996
537994
|
" Fusion ",
|
|
537997
|
-
|
|
537995
|
+
"0.3.1"
|
|
537998
537996
|
]
|
|
537999
537997
|
});
|
|
538000
537998
|
$[4] = t4;
|
|
@@ -598922,7 +598920,7 @@ const CodeSession = (0, import_react.memo)(({ onExit, isTabActive = true }) => {
|
|
|
598922
598920
|
return;
|
|
598923
598921
|
}
|
|
598924
598922
|
if (input === "c" && key.ctrl) {
|
|
598925
|
-
if (ctrlCPending) {
|
|
598923
|
+
if (showWelcome || ctrlCPending) {
|
|
598926
598924
|
if (ctrlCTimer.current) clearTimeout(ctrlCTimer.current);
|
|
598927
598925
|
onExit({
|
|
598928
598926
|
sessionId: proxy.sessionId,
|
|
@@ -599651,7 +599649,7 @@ function CodeCommand({ onExit, sys, options }) {
|
|
|
599651
599649
|
const lines = [""];
|
|
599652
599650
|
if (info.sessionId) {
|
|
599653
599651
|
lines.push("Resume this session with:");
|
|
599654
|
-
lines.push(`
|
|
599652
|
+
lines.push(` builder --resume ${info.sessionId}`);
|
|
599655
599653
|
lines.push("");
|
|
599656
599654
|
}
|
|
599657
599655
|
process.stdout.write(lines.join("\n"));
|
|
@@ -599697,7 +599695,7 @@ function CodeCommand({ onExit, sys, options }) {
|
|
|
599697
599695
|
}
|
|
599698
599696
|
});
|
|
599699
599697
|
const fusionConfig = await getFusionConfig(sys, { _: [] });
|
|
599700
|
-
const sessionId = options?.
|
|
599698
|
+
const sessionId = options?.resume;
|
|
599701
599699
|
const codeSession = new CodeGenSession({
|
|
599702
599700
|
sys,
|
|
599703
599701
|
credentials,
|
|
@@ -599914,7 +599912,7 @@ function _temp() {
|
|
|
599914
599912
|
//#region src/updater.ts
|
|
599915
599913
|
const REGISTRY_BASE = "https://registry.npmjs.org/@builder.io";
|
|
599916
599914
|
const CHECK_INTERVAL_MS = 1440 * 60 * 1e3;
|
|
599917
|
-
const CONFIG_DIR = path$6.join(os$11.homedir(), ".
|
|
599915
|
+
const CONFIG_DIR = path$6.join(os$11.homedir(), ".builder", "buildercode");
|
|
599918
599916
|
const UPDATE_CHECK_FILE = path$6.join(CONFIG_DIR, "update-check.json");
|
|
599919
599917
|
/**
|
|
599920
599918
|
* Returns true when running as a standalone pkg binary (not via `node` or `npx`).
|
|
@@ -599924,11 +599922,11 @@ function isStandaloneBinary() {
|
|
|
599924
599922
|
return !path$6.basename(process.execPath, ".exe").startsWith("node");
|
|
599925
599923
|
}
|
|
599926
599924
|
function getCurrentVersion() {
|
|
599927
|
-
return
|
|
599925
|
+
return "0.3.1";
|
|
599928
599926
|
}
|
|
599929
599927
|
async function fetchLatestVersion() {
|
|
599930
599928
|
return new Promise((resolve, reject) => {
|
|
599931
|
-
const url = `${REGISTRY_BASE}/
|
|
599929
|
+
const url = `${REGISTRY_BASE}/buildercode/latest`;
|
|
599932
599930
|
https$4.get(url, { headers: { Accept: "application/json" } }, (res) => {
|
|
599933
599931
|
if (res.statusCode !== 200) {
|
|
599934
599932
|
res.resume();
|
|
@@ -599989,7 +599987,7 @@ async function runUpdateCheck() {
|
|
|
599989
599987
|
});
|
|
599990
599988
|
}
|
|
599991
599989
|
const current = getCurrentVersion();
|
|
599992
|
-
if (isNewerVersion(latestVersion, current)) return `Update available: ${current} → ${latestVersion}\nRun \`
|
|
599990
|
+
if (isNewerVersion(latestVersion, current)) return `Update available: ${current} → ${latestVersion}\nRun \`builder update\` to install.`;
|
|
599993
599991
|
} catch {}
|
|
599994
599992
|
return null;
|
|
599995
599993
|
}
|
|
@@ -600033,7 +600031,7 @@ async function selfUpdate(onProgress) {
|
|
|
600033
600031
|
checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
600034
600032
|
latestVersion
|
|
600035
600033
|
});
|
|
600036
|
-
onProgress(`Updated to ${latestVersion}. Restart
|
|
600034
|
+
onProgress(`Updated to ${latestVersion}. Restart builder to apply.`);
|
|
600037
600035
|
} finally {
|
|
600038
600036
|
fs$20.rmSync(tmpDir, {
|
|
600039
600037
|
recursive: true,
|
|
@@ -600043,12 +600041,12 @@ async function selfUpdate(onProgress) {
|
|
|
600043
600041
|
}
|
|
600044
600042
|
function createTempDir(preferredDir) {
|
|
600045
600043
|
try {
|
|
600046
|
-
const probe = path$6.join(preferredDir, ".
|
|
600044
|
+
const probe = path$6.join(preferredDir, ".buildercode-write-test");
|
|
600047
600045
|
fs$20.writeFileSync(probe, "");
|
|
600048
600046
|
fs$20.unlinkSync(probe);
|
|
600049
|
-
return fs$20.mkdtempSync(path$6.join(preferredDir, ".
|
|
600047
|
+
return fs$20.mkdtempSync(path$6.join(preferredDir, ".buildercode-update-"));
|
|
600050
600048
|
} catch {
|
|
600051
|
-
return fs$20.mkdtempSync(path$6.join(os$11.tmpdir(), "
|
|
600049
|
+
return fs$20.mkdtempSync(path$6.join(os$11.tmpdir(), "buildercode-update-"));
|
|
600052
600050
|
}
|
|
600053
600051
|
}
|
|
600054
600052
|
function atomicReplace(source, dest) {
|
|
@@ -600099,7 +600097,7 @@ async function downloadFile(url, dest) {
|
|
|
600099
600097
|
}
|
|
600100
600098
|
//#endregion
|
|
600101
600099
|
//#region src/cli.tsx
|
|
600102
|
-
const VERSION =
|
|
600100
|
+
const VERSION = "0.3.1";
|
|
600103
600101
|
async function startInk(command, options) {
|
|
600104
600102
|
return render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {
|
|
600105
600103
|
command,
|
|
@@ -600112,7 +600110,7 @@ async function startInk(command, options) {
|
|
|
600112
600110
|
}), { exitOnCtrlC: false }).waitUntilExit();
|
|
600113
600111
|
}
|
|
600114
600112
|
const program = new Command().name("fusion").version(VERSION, "-v, --version").description("Builder.io Fusion CLI — AI-powered code generation");
|
|
600115
|
-
program.command("code", { isDefault: true }).description("Interactive AI code generation (default)").argument("[prompt]", "Initial prompt to send immediately").option("-u, --url <url>", "Design URL to integrate").option("-p, --prompt <text>", "Run non-interactively with a prompt").option("-
|
|
600113
|
+
program.command("code", { isDefault: true }).description("Interactive AI code generation (default)").argument("[prompt]", "Initial prompt to send immediately").option("-u, --url <url>", "Design URL to integrate").option("-p, --prompt <text>", "Run non-interactively with a prompt").option("-w, --workspace <path>", "Workspace configuration path").option("--space-id <id>", "Builder.io space ID").option("--continue", "Resume the previous conversation").option("--resume <id>", "Resume a specific session by ID").option("--disable-mcp", "Disable MCP servers").option("--privacy", "Enable privacy mode").action(async (prompt, options) => {
|
|
600116
600114
|
await startInk("code", {
|
|
600117
600115
|
...options,
|
|
600118
600116
|
prompt: prompt ?? options.prompt
|