@beastmode-develeap/beastmode 0.1.10 → 0.1.12
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/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4338,11 +4338,21 @@ ${summary.join("\n")}`;
|
|
|
4338
4338
|
}
|
|
4339
4339
|
const scopeContext = scope !== "factory" ? `
|
|
4340
4340
|
You are scoped to project "${scope}". Focus answers on this project only.` : "\nYou have factory-wide scope. Answer questions about any/all projects.";
|
|
4341
|
-
let
|
|
4342
|
-
if (session.
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4341
|
+
let historyBlock = "";
|
|
4342
|
+
if (session.conversationHistory.length > 0) {
|
|
4343
|
+
const recentHistory = session.conversationHistory.slice(-20);
|
|
4344
|
+
const formatted = recentHistory.map(
|
|
4345
|
+
(h) => h.role === "user" ? `User: ${h.content}` : `Assistant: ${h.content}`
|
|
4346
|
+
).join("\n\n");
|
|
4347
|
+
historyBlock = `
|
|
4348
|
+
|
|
4349
|
+
CONVERSATION HISTORY (continue this conversation naturally):
|
|
4350
|
+
${formatted}
|
|
4351
|
+
|
|
4352
|
+
---
|
|
4353
|
+
`;
|
|
4354
|
+
}
|
|
4355
|
+
const prompt = `IMPORTANT CONTEXT \u2014 READ BEFORE RESPONDING:
|
|
4346
4356
|
You are the BeastMode chat assistant. You have ALL the data you need below. Do NOT use curl, do NOT reference Monday.com, do NOT ask for permissions. The task board data is provided inline.
|
|
4347
4357
|
${scopeContext}
|
|
4348
4358
|
|
|
@@ -4350,11 +4360,10 @@ This factory uses a LOCAL self-hosted BeastMode Board (NOT Monday.com). All task
|
|
|
4350
4360
|
${boardContext}
|
|
4351
4361
|
|
|
4352
4362
|
Factory path: ${session.factoryPath}
|
|
4363
|
+
${historyBlock}
|
|
4364
|
+
USER MESSAGE: ${content}
|
|
4353
4365
|
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
Respond concisely using the board data above. Do not try to fetch data externally.`;
|
|
4357
|
-
}
|
|
4366
|
+
Respond concisely. Continue the conversation naturally \u2014 you have full context of what was discussed above.`;
|
|
4358
4367
|
const args = [
|
|
4359
4368
|
"-p",
|
|
4360
4369
|
prompt,
|
|
@@ -4362,9 +4371,6 @@ Respond concisely using the board data above. Do not try to fetch data externall
|
|
|
4362
4371
|
"stream-json",
|
|
4363
4372
|
"--verbose"
|
|
4364
4373
|
];
|
|
4365
|
-
if (session.claudeSessionId) {
|
|
4366
|
-
args.push("--resume", session.claudeSessionId);
|
|
4367
|
-
}
|
|
4368
4374
|
const child = spawn("claude", args, {
|
|
4369
4375
|
cwd: session.factoryPath,
|
|
4370
4376
|
env: {
|
|
@@ -4400,14 +4406,16 @@ Respond concisely using the board data above. Do not try to fetch data externall
|
|
|
4400
4406
|
const transformed = transformCliEvent(parsed);
|
|
4401
4407
|
if (transformed) sendToClient(session, transformed);
|
|
4402
4408
|
} catch {
|
|
4403
|
-
|
|
4409
|
+
if (line.trim() && !line.startsWith("\u256D") && !line.startsWith("\u2570") && !line.startsWith("\u2502") && line.length > 2) {
|
|
4410
|
+
sendToClient(session, { type: "text", content: line });
|
|
4411
|
+
}
|
|
4404
4412
|
}
|
|
4405
4413
|
}
|
|
4406
4414
|
});
|
|
4407
4415
|
child.stderr?.on("data", (data) => {
|
|
4408
4416
|
const text = data.toString("utf-8").trim();
|
|
4409
4417
|
if (!text) return;
|
|
4410
|
-
if (text.includes("configuration file not found") || text.includes("backup file exists") || text.includes("manually restore it by running") || text.includes("
|
|
4418
|
+
if (text.includes("configuration file not found") || text.includes("backup file exists") || text.includes("manually restore it by running") || text.includes("CLAUDE_CODE_")) return;
|
|
4411
4419
|
sendToClient(session, { type: "error", message: text });
|
|
4412
4420
|
});
|
|
4413
4421
|
child.on("exit", () => {
|