@beastmode-develeap/beastmode 0.1.9 → 0.1.11

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 CHANGED
@@ -4338,7 +4338,11 @@ ${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
- const wrappedPrompt = `IMPORTANT CONTEXT \u2014 READ BEFORE RESPONDING:
4341
+ let prompt;
4342
+ if (session.claudeSessionId) {
4343
+ prompt = content;
4344
+ } else {
4345
+ prompt = `IMPORTANT CONTEXT \u2014 READ BEFORE RESPONDING:
4342
4346
  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.
4343
4347
  ${scopeContext}
4344
4348
 
@@ -4350,9 +4354,10 @@ Factory path: ${session.factoryPath}
4350
4354
  USER QUESTION: ${content}
4351
4355
 
4352
4356
  Respond concisely using the board data above. Do not try to fetch data externally.`;
4357
+ }
4353
4358
  const args = [
4354
4359
  "-p",
4355
- wrappedPrompt,
4360
+ prompt,
4356
4361
  "--output-format",
4357
4362
  "stream-json",
4358
4363
  "--verbose"
@@ -4395,19 +4400,27 @@ Respond concisely using the board data above. Do not try to fetch data externall
4395
4400
  const transformed = transformCliEvent(parsed);
4396
4401
  if (transformed) sendToClient(session, transformed);
4397
4402
  } catch {
4398
- sendToClient(session, { type: "text", content: line });
4403
+ if (line.trim() && !line.startsWith("\u256D") && !line.startsWith("\u2570") && !line.startsWith("\u2502") && line.length > 2) {
4404
+ sendToClient(session, { type: "text", content: line });
4405
+ }
4399
4406
  }
4400
4407
  }
4401
4408
  });
4402
4409
  child.stderr?.on("data", (data) => {
4403
4410
  const text = data.toString("utf-8").trim();
4404
4411
  if (!text) return;
4405
- if (text.includes("configuration file not found") || text.includes("backup file exists") || text.includes("manually restore it by running") || text.includes("Not logged in") || text.includes("CLAUDE_CODE_")) return;
4412
+ if (text.includes("configuration file not found") || text.includes("backup file exists") || text.includes("manually restore it by running") || text.includes("CLAUDE_CODE_")) return;
4406
4413
  sendToClient(session, { type: "error", message: text });
4407
4414
  });
4408
- child.on("exit", () => {
4415
+ child.on("exit", (code) => {
4409
4416
  session.process = null;
4410
4417
  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
+ }
4411
4424
  if (collectedText) {
4412
4425
  session.conversationHistory.push({ role: "assistant", content: collectedText });
4413
4426
  }