beast-agent 2.44.2 → 2.44.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beast-agent",
3
3
  "productName": "Beast Agent",
4
- "version": "2.44.2",
4
+ "version": "2.44.3",
5
5
  "description": "Ultra-fast local agent shell for Windows.",
6
6
  "author": "algokodcom (AlgoKod)",
7
7
  "license": "MIT",
@@ -122,8 +122,28 @@ const FORMAT_RULES =
122
122
  'ÇIKTI BİÇİMİ (ZORUNLU):\n' +
123
123
  '- Yanıtlarında asla # karakteri kullanma (markdown başlık yok).\n' +
124
124
  '- Asla * karakteri kullanma (kalın/italik yıldız yok); madde işaretleri için - kullan.\n' +
125
+ '- Uzun tire (em/en dash: — veya –) KULLANMA; cümle aralarını virgül, iki nokta ya da gerekiyorsa kısa çizgi (-) ile ayır.\n' +
125
126
  '- Renkli sembol/ikon kullanma (renkli kalp, daire vb. yok); normal sarı emoji kullanabilirsin.\n' +
126
- '- Kod bloklarında dil gereği # veya * gerekiyorsa kod içinde serbest.';
127
+ '- Kod bloklarında dil gereği # veya * gerekiyorsa kod içinde serbest.\n' +
128
+ '- Düz, doğal ve insani yaz: kalıplaşmış giriş/kapanış cümleleri, "umarım yardımcı olur" tarzı boş nezaket ve robotik madde listeleri kullanma.';
129
+
130
+ /* Uzun tire (—/–) temizliği: nihai metinden yapay zeka imzası sayılan tireleri
131
+ kaldırır — boşluklu em dash virgüle, en dash ve bitişik em dash kısa çizgiye
132
+ döner; kod blokları ve satır içi kod DOKUNULMADAN korunur. */
133
+ function stripAiDashes(text) {
134
+ const s = String(text == null ? '' : text);
135
+ if (!/[\u2013\u2014]/.test(s)) return s;
136
+ const parts = s.split(/(```[\s\S]*?```|`[^`\n]*`)/);
137
+ for (let i = 0; i < parts.length; i += 2) {
138
+ parts[i] = parts[i]
139
+ .replace(/[ \t]+\u2014[ \t]+/g, ', ')
140
+ .replace(/[ \t]*\u2013[ \t]*/g, '-')
141
+ .replace(/\u2014/g, '-')
142
+ .replace(/,\s*,/g, ',')
143
+ .replace(/[ \t]+([.!?:;])/g, '$1');
144
+ }
145
+ return parts.join('');
146
+ }
127
147
 
128
148
  /* Kişi bazlı granül izin seviyeleri: hangi araçlara erişilebilir */
129
149
  const PERM_TOOL_SETS = {
@@ -865,6 +885,7 @@ class Engine {
865
885
  costIn: Number(c.costIn) || null,
866
886
  costOut: Number(c.costOut) || null,
867
887
  };
888
+ if (res && typeof res.content === 'string') res.content = stripAiDashes(res.content);
868
889
  return res;
869
890
  } catch (e) {
870
891
  if (e && (e.name === 'AbortError' || (signal && signal.aborted))) throw e;
@@ -4934,6 +4955,7 @@ const skills = require('./skills');
4934
4955
  }),
4935
4956
  }
4936
4957
  );
4958
+ if (res && typeof res.content === 'string') res.content = stripAiDashes(res.content);
4937
4959
  const assistant = { role: 'assistant', content: res.content || '' };
4938
4960
  if (res.toolCalls && res.toolCalls.length) assistant.tool_calls = res.toolCalls;
4939
4961
  if (res.reasoning) assistant.reasoning_content = res.reasoning; /* thinking geri-besleme */
@@ -7113,3 +7135,4 @@ module.exports.PERM_TOOL_SETS = PERM_TOOL_SETS;
7113
7135
  module.exports.PERM_LEVELS = PERM_LEVELS;
7114
7136
  module.exports.normalizePerms = normalizePerms;
7115
7137
  module.exports.OBSERVE_MARK = OBSERVE_MARK;
7138
+ module.exports.stripAiDashes = stripAiDashes;
package/src/main.js CHANGED
@@ -11,7 +11,7 @@ const crypto = require('crypto');
11
11
  isteklerindeki konuşma-başına kimlik agent/llm.js'te üretilir */
12
12
  const OPENCODE_SESSION = 'beast-' + crypto.randomUUID();
13
13
  const { spawn } = require('child_process');
14
- const { Engine, OBSERVE_MARK } = require('./agent/engine');
14
+ const { Engine, OBSERVE_MARK, stripAiDashes } = require('./agent/engine');
15
15
  const { loadBeastConfig, parseEnvFile, beastDir } = require('./agent/config');
16
16
  const bots = require('./agent/bots');
17
17
  const mqueue = require('./agent/mqueue');
@@ -7171,7 +7171,7 @@ function empatiLlmCompose(prompt) {
7171
7171
  ],
7172
7172
  temperature: 0.6,
7173
7173
  }, { signal: ctrl.signal })
7174
- .then((r) => String(r.content || '').trim().slice(0, 600))
7174
+ .then((r) => stripAiDashes(String(r.content || '').trim()).slice(0, 600))
7175
7175
  .catch(() => '')
7176
7176
  .finally(() => clearTimeout(kill));
7177
7177
  }