@cccarv82/freya 2.5.1 → 2.5.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.
Files changed (3) hide show
  1. package/cli/web-ui.js +4 -20
  2. package/cli/web.js +16 -21
  3. package/package.json +1 -1
package/cli/web-ui.js CHANGED
@@ -66,11 +66,11 @@
66
66
  };
67
67
 
68
68
  const inlineFormat = (text) => {
69
- const esc = escapeHtml(text || '');
69
+ let out = text || '';
70
70
  const codes = [];
71
- let out = esc.replace(inlineCodeRe, (_, c) => {
71
+ out = out.replace(inlineCodeRe, (_, c) => {
72
72
  const idx = codes.length;
73
- codes.push(c);
73
+ codes.push(escapeHtml(c));
74
74
  return `@@CODE${idx}@@`;
75
75
  });
76
76
  out = out.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
@@ -1938,23 +1938,7 @@
1938
1938
  }
1939
1939
  }
1940
1940
 
1941
- async function saveSettings() {
1942
- try {
1943
- saveLocal();
1944
- setPill('run', 'saving…');
1945
- await api('/api/settings/save', {
1946
- dir: dirOrDefault(),
1947
- settings: {
1948
- discordWebhookUrl: $('discord').value.trim(),
1949
- teamsWebhookUrl: $('teams').value.trim()
1950
- }
1951
- });
1952
- setPill('ok', 'saved');
1953
- setTimeout(() => setPill('ok', 'pronto'), 800);
1954
- } catch (e) {
1955
- setPill('err', 'save failed');
1956
- }
1957
- }
1941
+
1958
1942
 
1959
1943
  async function publish(target) {
1960
1944
  try {
package/cli/web.js CHANGED
@@ -3971,32 +3971,27 @@ function buildSettingsHtml(safeDefault, appVersion) {
3971
3971
  </div>
3972
3972
  </section>
3973
3973
 
3974
- <div class="devGrid">
3974
+ <div class="devGrid" style="grid-template-columns: 1fr;">
3975
3975
  <div class="panel">
3976
- <div class="panelHead"><b>Configuração de Notificações</b></div>
3976
+ <div class="panelHead"><b>Mapeamento Inteligente de Projetos (Slugs)</b></div>
3977
3977
  <div class="panelBody">
3978
- <label>Discord webhook URL</label>
3979
- <input id="discord" placeholder="https://discord.com/api/webhooks/..." />
3980
- <div style="height:10px"></div>
3981
-
3982
- <label>Teams webhook URL</label>
3983
- <input id="teams" placeholder="https://..." />
3978
+ <p style="margin-top: 0; color: #666; font-size: 13px;">
3979
+ A FREYA tenta adivinhar automaticamente a qual projeto uma tarefa pertence.
3980
+ Se você quiser **garantir** que uma palavra sempre caia em um projeto específico, adicione uma regra abaixo.
3981
+ </p>
3984
3982
 
3985
- <div class="stack" style="margin-top:20px;">
3986
- <button class="btn primary" type="button" onclick="window.saveSettings()">Salvar Configurações</button>
3983
+ <div style="background: var(--surface); padding: 12px; border-radius: 6px; font-size: 12px; font-family: monospace; color: #888; margin-bottom: 16px;">
3984
+ <b>Exemplo de uso:</b><br>
3985
+ Se o cliente é a "Vale" e o projeto é "Trato", e você quer que qualquer frase com a palavra "trato" vá para "vale/trato":<br>
3986
+ <code>{ "contains": "trato", "slug": "vale/trato" }</code>
3987
3987
  </div>
3988
- </div>
3989
- </div>
3990
3988
 
3991
- <div class="panel">
3992
- <div class="panelHead"><b>Mapeamento Smart de Projetos</b></div>
3993
- <div class="panelBody">
3994
- <label>Regras de inferência (JSON)</label>
3995
- <textarea id="slugRules" rows="8" placeholder="{ \"rules\": [ { \"contains\": \"fideliza\", \"slug\": \"vivo/fidelizacao\" } ] }"></textarea>
3996
- <div class="help">Usado pra inferir <code>projectSlug</code>.</div>
3997
- <div class="stack" style="margin-top:10px">
3998
- <button class="btn" type="button" onclick="window.reloadSlugRules()">Recarregar regras</button>
3999
- <button class="btn primary" type="button" onclick="window.saveSlugRules()">Salvar regras</button>
3989
+ <label>Regras de Inferência (Formato JSON)</label>
3990
+ <textarea id="slugRules" rows="12" style="font-family: monospace; font-size: 13px;" placeholder='{\n "rules": [\n {\n "contains": "palavra-chave",\n "slug": "cliente/projeto"\n }\n ]\n}'></textarea>
3991
+
3992
+ <div class="stack" style="margin-top:20px; flex-direction: row; justify-content: flex-end;">
3993
+ <button class="btn" type="button" onclick="window.reloadSlugRules()">Restaurar</button>
3994
+ <button class="btn primary" type="button" onclick="window.saveSlugRules()">Salvar Regras</button>
4000
3995
  </div>
4001
3996
  </div>
4002
3997
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cccarv82/freya",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Personal AI Assistant with local-first persistence",
5
5
  "scripts": {
6
6
  "health": "node scripts/validate-data.js && node scripts/validate-structure.js",