@beastmode-develeap/beastmode 0.1.11 → 0.1.13
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 +38 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4338,33 +4338,55 @@ ${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
|
-
|
|
4346
|
-
|
|
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 boardApiUrl = getBoardUrl(session.factoryPath);
|
|
4356
|
+
const boardParam = scope !== "factory" ? `?board=${scope}` : "";
|
|
4357
|
+
const prompt = `CRITICAL CONTEXT \u2014 YOU MUST READ THIS:
|
|
4358
|
+
You are the BeastMode chat assistant running inside a BeastMode factory.
|
|
4359
|
+
|
|
4360
|
+
IMPORTANT RULES:
|
|
4361
|
+
- Monday.com does NOT exist in this system. NEVER mention Monday.com. There is NO Monday.com integration.
|
|
4362
|
+
- This factory uses a LOCAL self-hosted BeastMode Board with a REST API.
|
|
4363
|
+
- You have tools available. You can execute bash commands. Use curl to interact with the board API.
|
|
4364
|
+
- NEVER ask for permissions. You have full access. Just do it.
|
|
4347
4365
|
${scopeContext}
|
|
4348
4366
|
|
|
4349
|
-
|
|
4367
|
+
BOARD API (use curl to manage tasks):
|
|
4368
|
+
- Base URL: ${boardApiUrl}
|
|
4369
|
+
- List items: curl -s '${boardApiUrl}/api/items${boardParam}'
|
|
4370
|
+
- Create item: curl -s -X POST '${boardApiUrl}/api/items${boardParam}' -H 'Content-Type: application/json' -d '{"name":"Task title","status":"","priority":"Medium","task_type":"deep-planning"}'
|
|
4371
|
+
(status="" means Draft/New. Valid statuses: "", "New", "Ready", "Working on it", "Done", etc.)
|
|
4372
|
+
- Update item: curl -s -X PATCH '${boardApiUrl}/api/items/ITEM_ID${boardParam}' -H 'Content-Type: application/json' -d '{"status":"Ready"}'
|
|
4373
|
+
|
|
4374
|
+
Current board items:
|
|
4350
4375
|
${boardContext}
|
|
4351
4376
|
|
|
4352
4377
|
Factory path: ${session.factoryPath}
|
|
4378
|
+
${historyBlock}
|
|
4379
|
+
USER MESSAGE: ${content}
|
|
4353
4380
|
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
Respond concisely using the board data above. Do not try to fetch data externally.`;
|
|
4357
|
-
}
|
|
4381
|
+
Respond concisely. Continue the conversation naturally.`;
|
|
4358
4382
|
const args = [
|
|
4359
4383
|
"-p",
|
|
4360
4384
|
prompt,
|
|
4361
4385
|
"--output-format",
|
|
4362
4386
|
"stream-json",
|
|
4363
|
-
"--verbose"
|
|
4387
|
+
"--verbose",
|
|
4388
|
+
"--dangerously-skip-permissions"
|
|
4364
4389
|
];
|
|
4365
|
-
if (session.claudeSessionId) {
|
|
4366
|
-
args.push("--resume", session.claudeSessionId);
|
|
4367
|
-
}
|
|
4368
4390
|
const child = spawn("claude", args, {
|
|
4369
4391
|
cwd: session.factoryPath,
|
|
4370
4392
|
env: {
|
|
@@ -4412,15 +4434,9 @@ Respond concisely using the board data above. Do not try to fetch data externall
|
|
|
4412
4434
|
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
4435
|
sendToClient(session, { type: "error", message: text });
|
|
4414
4436
|
});
|
|
4415
|
-
child.on("exit", (
|
|
4437
|
+
child.on("exit", () => {
|
|
4416
4438
|
session.process = null;
|
|
4417
4439
|
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
4440
|
if (collectedText) {
|
|
4425
4441
|
session.conversationHistory.push({ role: "assistant", content: collectedText });
|
|
4426
4442
|
}
|