@cccarv82/freya 1.0.49 → 1.0.50

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.
Files changed (2) hide show
  1. package/cli/web.js +11 -3
  2. package/package.json +1 -1
package/cli/web.js CHANGED
@@ -611,6 +611,7 @@ function run(cmd, args, cwd) {
611
611
  function isAllowedChatSearchPath(relPath) {
612
612
  if (!relPath) return false;
613
613
  if (relPath.startsWith('..')) return false;
614
+ if (relPath.startsWith('data/chat/')) return false;
614
615
  return relPath.startsWith('data/') || relPath.startsWith('logs/') || relPath.startsWith('docs/');
615
616
  }
616
617
 
@@ -625,13 +626,16 @@ async function copilotSearch(workspaceDir, query, opts = {}) {
625
626
  'Você é um buscador local de arquivos.',
626
627
  'Objetivo: encontrar registros relevantes para a consulta do usuário.',
627
628
  'Escopo: procure SOMENTE nos diretórios data/, logs/ e docs/ do workspace.',
629
+ 'Exclua data/chat/ (conversa), a menos que o usuário peça explicitamente por chat.',
628
630
  'Use ferramentas para ler/consultar arquivos, mas não modifique nada.',
629
631
  `Consulta do usuário: "${q}"`,
630
632
  '',
631
633
  'Responda APENAS com JSON válido (sem code fences) no formato:',
632
634
  '{"summary":"<1-2 frases humanas>","matches":[{"file":"<caminho relativo>","date":"YYYY-MM-DD ou vazio","snippet":"<trecho curto>"}]}',
633
635
  `Limite de matches: ${limit}.`,
634
- 'O resumo deve soar humano e mencionar a quantidade de registros encontrados.',
636
+ 'O resumo deve soar humano, bem escrito e mencionar a quantidade de registros encontrados.',
637
+ 'Priorize responder exatamente à pergunta (ex.: data e ID da última CHG).',
638
+ 'Evite repetir o mesmo trecho; escolha evidências mais úteis.',
635
639
  'A lista deve estar ordenada por relevância.'
636
640
  ].join('\n');
637
641
 
@@ -695,9 +699,13 @@ function buildChatAnswer(query, matches, summary) {
695
699
 
696
700
  const lines = [];
697
701
  lines.push(`Encontrei ${count} registro(s).`);
698
- lines.push(`Resumo (${count} registro(s)): ${summaryText}`);
702
+ lines.push(`Resumo: ${summaryText}`);
699
703
 
700
- for (const m of matches) {
704
+ if (!matches.length) return lines.join('\n');
705
+
706
+ lines.push('');
707
+ lines.push('Principais evidências:');
708
+ for (const m of matches.slice(0, 5)) {
701
709
  const parts = [];
702
710
  if (m.date) parts.push(`**${m.date}**`);
703
711
  if (m.file) parts.push('`' + m.file + '`');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cccarv82/freya",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Personal AI Assistant with local-first persistence",
5
5
  "scripts": {
6
6
  "health": "node scripts/validate-data.js",