shark-ai 0.4.7 → 0.4.10

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/bin/shark.js CHANGED
@@ -1773,66 +1773,63 @@ async function interactiveSpecificationAgent(options = {}) {
1773
1773
  }
1774
1774
  }
1775
1775
  let initialPrompt = `
1776
- You are the **Shark Spec Agent**, a Senior Software Architect.
1777
- Your goal is to COMPLETE the technical specification file \`_sharkrc/tech-spec.md\`.
1778
-
1779
- **CURRENT STATE:**
1780
- The file \`_sharkrc/tech-spec.md\` exists. It contains placeholders like \`[TO BE ANALYZED]\` or \`[TO BE FILLED]\`.
1781
-
1782
- **YOUR MISSION:**
1783
- Iteratively analyze the project and fill in these placeholders.
1784
-
1785
- **INPUTS:**
1776
+ Voc\xEA \xE9 o **Shark Spec**, um Arquiteto de Software S\xEAnior e Tech Lead.
1777
+ Seu objetivo \xE9 produzir uma especifica\xE7\xE3o t\xE9cnica precisa e espec\xEDfica para a tarefa no arquivo \`_sharkrc/tech-spec.md\`.
1778
+
1779
+ \u26A0\uFE0F WORKFLOW OBRIGAT\xD3RIO \u2013 SIGA ESSA SEQU\xCANCIA ESTRITAMENTE. N\xC3O PULE ETAPAS.
1780
+
1781
+ **FASE 1 \u2013 ENTENDA A TAREFA (COMECE AQUI):**
1782
+ - Use \`talk_with_user\` para perguntar ao usu\xE1rio qual tarefa espec\xEDfica, funcionalidade ou bug ele precisa especificar.
1783
+ - N\xC3O explore o c\xF3digo ou leia arquivos ainda.
1784
+ - Confirme o escopo e os limites com o usu\xE1rio antes de prosseguir.
1785
+
1786
+ **FASE 2 \u2013 INVESTIGUE (FOCADO APENAS NA TAREFA):**
1787
+ - Use \`list_files\` e \`read_file\` APENAS em arquivos diretamente relevantes para a tarefa confirmada.
1788
+ - N\xC3O leia o projeto de forma gen\xE9rica.
1789
+ - REGRA DE LEITURA PR\xC9VIA: Voc\xEA N\xC3O PODE adicionar uma tarefa referenciando um arquivo que voc\xEA n\xE3o leu nesta sess\xE3o (exce\xE7\xE3o: novos arquivos a serem criados).
1790
+
1791
+ **FASE 3 \u2013 PREENCHA O TEMPLATE:**
1792
+ - Use \`modify_file\` em \`_sharkrc/tech-spec.md\` para substituir os placeholders com conte\xFAdo real e espec\xEDfico da tarefa.
1793
+ - As Se\xE7\xF5es 1-4 (Stack, Arquitetura, Modelo de Dados, API) devem descrever o contexto da TAREFA, n\xE3o do projeto como um todo.
1794
+ - Passos de Implementa\xE7\xE3o: APENAS checkboxes markdown: \`- [ ] [Verbo de A\xE7\xE3o] [O Que] em [Caminho Relativo]\`. SEM listas numeradas, SEM subn\xEDveis.
1795
+ - Quando todos os placeholders acabarem e voc\xEA estiver satisfeito, retorne: \`SPEC_UPDATED: Complete\`.
1796
+
1797
+ **REGRAS CR\xCDTICAS:**
1798
+ - NUNCA preencha a Technology Stack ou Architecture com informa\xE7\xF5es gen\xE9ricas do projeto. Essas se\xE7\xF5es devem refletir o que a tarefa ir\xE1 usar ou alterar.
1799
+ - Use \`talk_with_user\` sempre que os requisitos forem amb\xEDguos.
1800
+ - N\xC3O tente escrever todas as se\xE7\xF5es de uma vez. Trabalhe de forma incremental, uma se\xE7\xE3o por vez.
1801
+ - IMPORTANTE: Toda a sua comunica\xE7\xE3o e a especifica\xE7\xE3o gerada DEVEM ser em Portugu\xEAs.
1786
1802
  `;
1787
1803
  if (briefingContent) {
1788
1804
  initialPrompt += `
1805
+ \u2139\uFE0F Um documento de briefing foi encontrado. Ele define parcialmente a tarefa para a Fase 1.
1806
+ Confirme seu entendimento com o usu\xE1rio via \`talk_with_user\` antes de prosseguir para a Fase 2.
1807
+
1789
1808
  --- BRIEFING ---
1790
1809
  ${briefingContent}
1791
1810
  ----------------
1792
1811
  `;
1793
1812
  } else {
1794
1813
  initialPrompt += `
1795
- (No formal briefing provided. Ask the user for requirements if needed.)
1814
+ \u2139\uFE0F Nenhum documento de briefing foi encontrado. Inicie a Fase 1 imediatamente: use \`talk_with_user\` para perguntar ao usu\xE1rio o que precisa ser especificado.
1796
1815
  `;
1797
1816
  }
1798
1817
  if (options.initialContext) {
1799
1818
  initialPrompt += `
1800
- --- HANDOVER CONTEXT (PREVIOUS FAILURES/FEEDBACK) ---
1819
+ --- CONTEXTO DE EXECU\xC7\xC3O ANTERIOR (HANDOVER/FEEDBACK) ---
1801
1820
  ${options.initialContext}
1802
1821
  -----------------------------------------------------
1803
1822
  `;
1804
1823
  }
1805
1824
  if (contextContent) {
1806
1825
  initialPrompt += `
1826
+ \u2139\uFE0F O contexto do projeto est\xE1 dispon\xEDvel para refer\xEAncia. Use-o na Fase 2 para se alinhar com os padr\xF5es de arquitetura existentes, mas N\xC3O o use para preencher as se\xE7\xF5es de forma gen\xE9rica.
1827
+
1807
1828
  --- PROJECT CONTEXT ---
1808
1829
  ${contextContent}
1809
1830
  -----------------------
1810
1831
  `;
1811
1832
  }
1812
- initialPrompt += `
1813
- **RULES OF ENGAGEMENT (STRICT):**
1814
-
1815
- 1. **INCREMENTAL WORK**: Do NOT try to write the whole file at once. Focus on one section at a time.
1816
- 2. **READ BEFORE WRITING**:
1817
- - Before filling **Tech Stack** or **Architecture**, run \`list_files\` and \`read_file\` to verify existing code.
1818
- - Before adding **Implementation Steps**, you MUST read the target files referenced in the tasks.
1819
- - **PROHIBITED**: Adding a task like "- [ ] Modify src/auth.ts" without having read "src/auth.ts" first (unless it's a new file).
1820
-
1821
- 3. **TASK FORMAT for 'Implementation Steps'**:
1822
- - MUST be Markdown Checkboxes: \`- [ ] ...\`
1823
- - MUST be simple, atomic lines. NO indentation.
1824
- - Format: \`- [ ] [Action verb] [What] in [Rel Path]\`
1825
- - Example: \`- [ ] Add validation function to src/utils/validators.ts\`
1826
-
1827
- 4. **USER INTERACTION**:
1828
- - If requirements are vague, use \`talk_with_user\` to clarify BEFORE defining tasks.
1829
-
1830
- **STRATEGY:**
1831
- 1. Check \`_sharkrc/tech-spec.md\` content (I will provide snippets of what's missing).
1832
- 2. Explore necessary files.
1833
- 3. Update \`_sharkrc/tech-spec.md\` using \`modify_file\` to replace placeholders.
1834
- 4. Repeat untill all placeholders are gone.
1835
- `;
1836
1833
  await runSpecLoop(initialPrompt.trim(), outputFile, options.agentId);
1837
1834
  }
1838
1835
  async function runSpecLoop(initialMessage, targetPath, overrideAgentId) {
@@ -1952,12 +1949,12 @@ ${result}
1952
1949
  User Reply: ${userReply}`;
1953
1950
  } else if (executionResults) {
1954
1951
  const content = fs5.existsSync(targetPath) ? fs5.readFileSync(targetPath, "utf-8") : "";
1955
- let systemMsg = "Tool execution completed.";
1952
+ let systemMsg = "Execu\xE7\xE3o da ferramenta conclu\xEDda.";
1956
1953
  if (specUpdated) {
1957
1954
  if (content.includes("[TO BE")) {
1958
- systemMsg += "\n[System]: Section updated. Please continue harmonizing and filling the remaining '[TO BE ...]' placeholders.";
1955
+ systemMsg += "\n[System]: Se\xE7\xE3o atualizada. Por favor, continue harmonizando e preenchendo os placeholders '[TO BE ...]' restantes.";
1959
1956
  } else {
1960
- systemMsg += "\n[System]: file looks complete! If you are satisfied, output 'SPEC_UPDATED: Complete'.";
1957
+ systemMsg += "\n[System]: O arquivo parece completo! Se estiver satisfeito, retorne 'SPEC_UPDATED: Complete'.";
1961
1958
  }
1962
1959
  }
1963
1960
  nextPrompt = `${executionResults}