@beastmode-develeap/beastmode 0.1.11 → 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 +19 -19
- 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: {
|
|
@@ -4412,15 +4418,9 @@ Respond concisely using the board data above. Do not try to fetch data externall
|
|
|
4412
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;
|
|
4413
4419
|
sendToClient(session, { type: "error", message: text });
|
|
4414
4420
|
});
|
|
4415
|
-
child.on("exit", (
|
|
4421
|
+
child.on("exit", () => {
|
|
4416
4422
|
session.process = null;
|
|
4417
4423
|
session.busy = false;
|
|
4418
|
-
if (!collectedText && code !== 0 && session.claudeSessionId) {
|
|
4419
|
-
session.claudeSessionId = null;
|
|
4420
|
-
sendToClient(session, { type: "system", message: "Session expired \u2014 starting fresh conversation." });
|
|
4421
|
-
runViaCli(session, content, scope);
|
|
4422
|
-
return;
|
|
4423
|
-
}
|
|
4424
4424
|
if (collectedText) {
|
|
4425
4425
|
session.conversationHistory.push({ role: "assistant", content: collectedText });
|
|
4426
4426
|
}
|