jarvis-ai-framework 2.1.0 → 3.0.0
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/AGENTS.md +22 -122
- package/agents/AGENTS.md +20 -24
- package/agents/README.md +25 -129
- package/agents/engineering/data/eng.data-engineer.agent.md +12 -35
- package/agents/engineering/eng.agent.md +18 -30
- package/agents/engineering/eng.bug-hunter.md +9 -12
- package/agents/engineering/eng.dev-code-reviewer.md +5 -1
- package/agents/engineering/eng.docs-writer.md +3 -3
- package/agents/engineering/eng.frontend.agent.md +13 -8
- package/agents/engineering/eng.rpa.agent.md +5 -13
- package/agents/engineering/eng.ux-designer.agent.md +4 -0
- package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +4 -0
- package/agents/engineering/qa/eng.qa.quality-strategist.md +13 -8
- package/agents/engineering/qa/eng.qa.test-architect.md +16 -15
- package/agents/engineering/qa/eng.qa.test-planner.md +22 -17
- package/agents/engineering/qa/eng.qa.testing-engineer.md +99 -15
- package/agents/product/prod.discovery-interviewer.md +22 -3
- package/agents/product/prod.pm-checker.md +4 -0
- package/bin/README.md +142 -0
- package/bin/commands/docs-publish.js +105 -141
- package/bin/commands/docs-sync.js +66 -104
- package/bin/commands/info.js +7 -27
- package/bin/commands/init.js +23 -51
- package/bin/commands/install-rtk.js +9 -3
- package/bin/commands/list.js +5 -18
- package/bin/commands/map.js +58 -0
- package/bin/commands/qa-signoff.js +58 -55
- package/bin/commands/tokens.js +90 -0
- package/bin/commands/whoami.js +30 -26
- package/bin/jarvis.js +9 -153
- package/bin/lib/auth/session.js +20 -20
- package/bin/lib/cli/program.js +219 -0
- package/bin/lib/cli/shared-options.js +29 -0
- package/bin/lib/config/constants.js +70 -2
- package/bin/lib/config/ide-config.js +4 -8
- package/bin/lib/core/profile-filter.js +116 -0
- package/bin/lib/core/scanner.js +5 -31
- package/bin/lib/core/sync-engine.js +21 -14
- package/bin/lib/core/token-report.js +100 -0
- package/bin/lib/docs/fetch-file.js +39 -0
- package/bin/lib/docs/publish-file.js +194 -0
- package/bin/lib/docs/redis-cache.js +49 -0
- package/bin/lib/docs/validate-frontmatter.js +9 -39
- package/bin/lib/env-loader.js +11 -34
- package/bin/lib/flow-map/index.js +65 -0
- package/bin/lib/flow-map/parse.js +223 -0
- package/bin/lib/flow-map/render.js +89 -0
- package/bin/lib/flow-map/tree.js +248 -0
- package/bin/lib/tasks/comment.js +40 -35
- package/bin/lib/utils/frontmatter.js +57 -0
- package/bin/lib/utils/git-parser.js +4 -6
- package/bin/lib/utils/npmrc-parser.js +6 -13
- package/bin/lib/utils/paths.js +2 -4
- package/bin/lib/utils/ui.js +3 -9
- package/bin/lib/vcs/api.js +25 -41
- package/bin/lib/vcs/create-issue.js +49 -33
- package/bin/lib/vcs/create-merge.js +47 -31
- package/bin/lib/vcs/fetch-raw.js +35 -23
- package/members.md +1 -1
- package/package.json +15 -4
- package/rules/AGENTS.md +18 -7
- package/rules/engineering/eng-rules.md +3 -13
- package/rules/engineering/eng-security-rules.md +19 -18
- package/rules/engineering/eng.bump-rules.md +3 -2
- package/rules/engineering/eng.docs-scraping-rules.md +4 -4
- package/rules/engineering/eng.integrations-rules.md +3 -7
- package/rules/engineering/eng.skills-rules.md +1 -5
- package/rules/engineering/eng.specializations-rules.md +18 -8
- package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
- package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
- package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
- package/rules/product/README.md +1 -0
- package/rules/product/prod-rules.md +1 -4
- package/rules/product/prod.spec-rules.md +0 -4
- package/rules/rtk-rules.md +0 -1
- package/{rules → rules-on-demand}/engineering/eng.breakdown-subtasks-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.plan-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pre-pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.start-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.tech-spec-rules.md +1 -2
- package/{rules → rules-on-demand}/engineering/eng.work-rules.md +0 -4
- package/skills/AGENTS.md +69 -106
- package/skills/SKILLS-ROADMAP.md +47 -132
- package/skills/eng-ai/SKILL.md +270 -0
- package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
- package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
- package/skills/eng-ai/references/11-governanca-ia.md +24 -0
- package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
- package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
- package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
- package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
- package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
- package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
- package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
- package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
- package/skills/eng-ai/references/9-produto-ia.md +24 -0
- package/skills/eng-ai/references/especializacoes.md +17 -0
- package/skills/eng-automation/SKILL.md +290 -0
- package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
- package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
- package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
- package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
- package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
- package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
- package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
- package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
- package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
- package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
- package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
- package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
- package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
- package/skills/eng-automation/references/7-rpa.md +25 -0
- package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
- package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
- package/skills/eng-automation/references/especializacoes.md +18 -0
- package/skills/eng-backend/SKILL.md +6 -0
- package/skills/eng-backend-arch-c4/SKILL.md +10 -4
- package/skills/eng-backend-microservices-trace/SKILL.md +6 -0
- package/skills/eng-backend-nestjs/SKILL.md +17 -462
- package/skills/eng-backend-nestjs/references/1-arquitetura-modulos.md +54 -0
- package/skills/eng-backend-nestjs/references/2-guards-autenticacao.md +118 -0
- package/skills/eng-backend-nestjs/references/3-interceptors-pipes-filters.md +113 -0
- package/skills/eng-backend-nestjs/references/4-config-logging.md +61 -0
- package/skills/eng-backend-nestjs/references/5-testes.md +83 -0
- package/skills/eng-backend-nestjs/references/6-problemas-comuns.md +53 -0
- package/skills/eng-backend-rabbitmq/SKILL.md +15 -298
- package/skills/eng-backend-rabbitmq/references/1-referencia-endpoints.md +28 -0
- package/skills/eng-backend-rabbitmq/references/2-codigo-consumer-producer.md +90 -0
- package/skills/eng-backend-rabbitmq/references/3-arquiteturas-comuns.md +101 -0
- package/skills/eng-backend-rabbitmq/references/4-troubleshooting.md +93 -0
- package/skills/eng-data/SKILL.md +271 -0
- package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
- package/skills/eng-data/references/10-ciencia-dados.md +24 -0
- package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
- package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
- package/skills/eng-data/references/2-modelagem-dados.md +24 -0
- package/skills/eng-data/references/3-bancos-dados.md +24 -0
- package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
- package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
- package/skills/eng-data/references/6-qualidade-dados.md +24 -0
- package/skills/eng-data/references/7-governanca-metadados.md +24 -0
- package/skills/eng-data/references/8-estatistica-analise.md +24 -0
- package/skills/eng-data/references/9-analytics-bi.md +24 -0
- package/skills/eng-data/references/especializacoes.md +20 -0
- package/skills/eng-frontend/SKILL.md +18 -5
- package/skills/eng-frontend/references/13-design-system.md +48 -0
- package/skills/eng-frontend/references/14-microfrontend.md +46 -0
- package/skills/eng-global-docs-write/SKILL.md +10 -5
- package/skills/eng-global-pr/SKILL.md +7 -1
- package/skills/eng-global-task-comment/SKILL.md +8 -2
- package/skills/eng-platform/SKILL.md +331 -0
- package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
- package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
- package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
- package/skills/eng-platform/references/12-finops-custos.md +24 -0
- package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
- package/skills/eng-platform/references/14-profiling-performance.md +23 -0
- package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
- package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
- package/skills/eng-platform/references/2-redes.md +23 -0
- package/skills/eng-platform/references/3-cloud.md +24 -0
- package/skills/eng-platform/references/4-iac-automacao.md +24 -0
- package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
- package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
- package/skills/eng-platform/references/7-observabilidade.md +24 -0
- package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
- package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
- package/skills/eng-platform/references/especializacoes.md +34 -0
- package/skills/eng-qa/SKILL.md +283 -0
- package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
- package/skills/eng-qa/references/10-confiabilidade.md +25 -0
- package/skills/eng-qa/references/11-seguranca.md +24 -0
- package/skills/eng-qa/references/12-acessibilidade.md +24 -0
- package/skills/eng-qa/references/13-dados-testes.md +24 -0
- package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
- package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
- package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
- package/skills/eng-qa/references/3-design-testes.md +25 -0
- package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
- package/skills/eng-qa/references/5-automacao-testes.md +25 -0
- package/skills/eng-qa/references/6-api-integracao.md +25 -0
- package/skills/eng-qa/references/7-contrato.md +24 -0
- package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
- package/skills/eng-qa/references/9-performance.md +24 -0
- package/skills/eng-qa/references/especializacoes.md +29 -0
- package/skills/eng-qa-planner/SKILL.md +264 -0
- package/skills/jarvis-context-detect/SKILL.md +7 -1
- package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
- package/skills/jarvis-create-specialization/SKILL.md +14 -0
- package/skills/jarvis-docs-central/README.md +31 -28
- package/skills/jarvis-docs-central/SKILL.md +11 -5
- package/skills/jarvis-docs-index/SKILL.md +10 -2
- package/skills/jarvis-evolution-architect/SKILL.md +6 -0
- package/skills/jarvis-init/SKILL.md +22 -15
- package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
- package/skills/jarvis-list-specializations/SKILL.md +36 -17
- package/skills/jarvis-report-issue/SKILL.md +7 -1
- package/skills/product-roadmap-report/SKILL.md +8 -0
- package/skills/product-specs/SKILL.md +9 -0
- package/skills/product-specs-update/SKILL.md +6 -0
- package/taxonomy.md +16 -28
- package/templates/AGENTS.md +2 -0
- package/templates/ENV-template.md +10 -2
- package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
- package/templates/engineering/tech-spec-delivery-template.md +179 -0
- package/workflows/AGENTS.md +14 -2
- package/workflows/README.md +8 -16
- package/workflows/all-tools.md +7 -1
- package/workflows/engineering/data/data.contract.md +8 -0
- package/workflows/engineering/data/data.new-pipeline.md +15 -4
- package/workflows/engineering/eng.breakdown-subtasks.md +9 -0
- package/workflows/engineering/eng.bug-audit.md +10 -13
- package/workflows/engineering/eng.build-tech-spec.md +17 -146
- package/workflows/engineering/eng.create-ard-from-code.md +8 -0
- package/workflows/engineering/eng.create-ard.md +8 -0
- package/workflows/engineering/eng.create-rfc.md +7 -0
- package/workflows/engineering/eng.debug.md +5 -21
- package/workflows/engineering/eng.docs.md +9 -0
- package/workflows/engineering/eng.light-arch.md +7 -0
- package/workflows/engineering/eng.plan.md +15 -2
- package/workflows/engineering/eng.pr.md +24 -30
- package/workflows/engineering/eng.pre-pr.md +33 -15
- package/workflows/engineering/eng.review.md +18 -11
- package/workflows/engineering/eng.rpa.robot.md +17 -7
- package/workflows/engineering/eng.start.md +33 -12
- package/workflows/engineering/eng.work.md +25 -17
- package/workflows/engineering/frontend/eng.frontend-component.md +7 -0
- package/workflows/engineering/frontend/eng.frontend-perf-audit.md +8 -0
- package/workflows/engineering/frontend/eng.frontend-review.md +8 -0
- package/workflows/engineering/qa/eng.qa-refinement-entry.md +7 -0
- package/workflows/engineering/qa/eng.qa-release-signoff.md +6 -0
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +7 -1
- package/workflows/product/prod.roadmap.preview.md +9 -0
- package/workflows/product/prod.spec.ard.md +97 -0
- package/workflows/product/prod.spec.breakdown.md +10 -0
- package/workflows/product/prod.spec.clarify.md +8 -2
- package/workflows/product/prod.spec.discovery.md +11 -1
- package/workflows/product/prod.spec.epic.md +8 -0
- package/workflows/product/prod.spec.frd.md +7 -0
- package/workflows/product/prod.spec.issue.md +6 -0
- package/workflows/product/prod.spec.md +15 -1
- package/workflows/product/prod.spec.prd.md +7 -0
- package/workflows/taxonomy.md +58 -6
- package/workflows/warm-up.md +47 -60
- package/agents/engineering/eng.cybersecurity.agent.md +0 -488
- package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -109
- package/bin/lib/docs/fetch-file.sh +0 -41
- package/bin/lib/docs/publish-file.sh +0 -284
- package/rules/engineering/eng.downstream-flow-rules.md +0 -297
- package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
- package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
- package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
- package/skills/eng-ai-engineer/SKILL.md +0 -297
- package/skills/eng-data-bi/SKILL.md +0 -200
- package/skills/eng-data-debug/SKILL.md +0 -308
- package/skills/eng-data-engineer/SKILL.md +0 -257
- package/skills/eng-data-onboard/SKILL.md +0 -311
- package/skills/eng-data-orchestrator/SKILL.md +0 -427
- package/skills/eng-devops-performance-engineer/SKILL.md +0 -313
- package/skills/eng-frontend-design-system/SKILL.md +0 -621
- package/skills/eng-frontend-microfrontend/SKILL.md +0 -604
- package/skills/eng-global-browser-extension-builder/SKILL.md +0 -386
- package/skills/eng-global-jira-comment/SKILL.md +0 -21
- package/skills/eng-qa-a11y-audit/SKILL.md +0 -270
- package/skills/eng-qa-bug-report/SKILL.md +0 -1089
- package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
- package/skills/eng-qa-cypress-e2e/SKILL.md +0 -178
- package/skills/eng-qa-dev-guide/SKILL.md +0 -165
- package/skills/eng-qa-e2e/SKILL.md +0 -401
- package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -323
- package/skills/eng-qa-exploratory/SKILL.md +0 -189
- package/skills/eng-qa-gate/SKILL.md +0 -371
- package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
- package/skills/eng-qa-graphql-contract/SKILL.md +0 -257
- package/skills/eng-qa-quality-report/SKILL.md +0 -413
- package/skills/eng-qa-test-plan/SKILL.md +0 -467
- package/skills/eng-qa-testsprite/SKILL.md +0 -326
- package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
- package/skills/eng-qa-unit-test/SKILL.md +0 -472
- package/skills/eng-scraper/SKILL.md +0 -684
- package/skills/eng-scraper-robot-builder/SKILL.md +0 -371
- package/skills/eng-security-cybersecurity/SKILL.md +0 -646
- package/skills/eng-security-patch/SKILL.md +0 -382
- package/skills/eng-security-threat-model/SKILL.md +0 -165
- package/skills/eng-security-triage/SKILL.md +0 -270
- package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
- package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
- package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
- package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
- package/templates/engineering/qa/qa.quality-report-template.md +0 -130
- package/workflows/engineering/eng.security-audit.md +0 -312
- package/workflows/engineering/eng.security-incident.md +0 -275
- package/workflows/engineering/eng.security-pipeline.md +0 -210
- package/workflows/engineering/eng.security-review.md +0 -235
- package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -51
- package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -51
- package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -60
- package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -202
- package/workflows/engineering/qa/eng.qa-quality-report.md +0 -78
- /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
- /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
- /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Leitura de frontmatter YAML (`---\n...\n---`) compartilhada
|
|
3
|
+
* entre scanner.js, validate-frontmatter.js, qa-signoff.js e sync-engine.js —
|
|
4
|
+
* cada um tinha sua própria cópia da mesma regex de bloco.
|
|
5
|
+
* @module utils/frontmatter
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const BLOCK_PATTERN = /^---\s*\n([\s\S]*?)\n---/;
|
|
9
|
+
|
|
10
|
+
// Exige a chave começando na coluna 0 (sem indentação) — por design, não
|
|
11
|
+
// desce em blocos aninhados (ex: `metadata:\n area: x`). As 4 implementações
|
|
12
|
+
// que este módulo substitui já assumiam isso (`^\w`, sem flag multiline por
|
|
13
|
+
// linha); manter a mesma regra evita "vazar" uma chave aninhada como se fosse
|
|
14
|
+
// de nível raiz.
|
|
15
|
+
// Unicode-aware (`u` flag) para aceitar chaves acentuadas, como "Versão" e
|
|
16
|
+
// "Autor" usadas no frontmatter de ARD/RFC.
|
|
17
|
+
const KEY_VALUE_PATTERN = /^([\p{L}\p{N}_][\p{L}\p{N}_-]*):\s*(.+)$/u;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Extrai o conteúdo bruto entre as cercas `---` do frontmatter.
|
|
21
|
+
* @param {string} content - Conteúdo completo do arquivo
|
|
22
|
+
* @returns {string | null} O bloco (sem as cercas), ou null se não houver frontmatter
|
|
23
|
+
*/
|
|
24
|
+
export function extractFrontmatterBlock(content) {
|
|
25
|
+
const match = content.match(BLOCK_PATTERN);
|
|
26
|
+
return match ? match[1] : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Parseia um bloco de frontmatter YAML simples (`chave: valor`, uma por linha,
|
|
31
|
+
* sem indentação). Não suporta estruturas aninhadas, listas ou blocos
|
|
32
|
+
* multilinha (`>`/`|`) — para isso, veja `sync-engine.js#parseSkillFrontmatter`,
|
|
33
|
+
* que extrai campos específicos com necessidades diferentes.
|
|
34
|
+
* @param {string} content - Conteúdo completo do arquivo (com ou sem frontmatter)
|
|
35
|
+
* @returns {Record<string, string>} Metadados; `{}` se não houver frontmatter
|
|
36
|
+
*/
|
|
37
|
+
export function parseFrontmatter(content) {
|
|
38
|
+
const block = extractFrontmatterBlock(content);
|
|
39
|
+
if (block === null) return {};
|
|
40
|
+
|
|
41
|
+
const metadata = {};
|
|
42
|
+
for (const line of block.split("\n")) {
|
|
43
|
+
const kv = line.match(KEY_VALUE_PATTERN);
|
|
44
|
+
if (!kv) continue;
|
|
45
|
+
|
|
46
|
+
let value = kv[2].trim();
|
|
47
|
+
if (
|
|
48
|
+
(value.startsWith('"') && value.endsWith('"')) ||
|
|
49
|
+
(value.startsWith("'") && value.endsWith("'"))
|
|
50
|
+
) {
|
|
51
|
+
value = value.slice(1, -1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
metadata[kv[1]] = value;
|
|
55
|
+
}
|
|
56
|
+
return metadata;
|
|
57
|
+
}
|
|
@@ -67,7 +67,7 @@ export function parseRepoUrl(url) {
|
|
|
67
67
|
} catch {
|
|
68
68
|
throw new Error(
|
|
69
69
|
`URL inválida: ${url}\n` +
|
|
70
|
-
"Formatos: https://github.com/org/repo.git | https://gitlab.com/grupo/repo.git | https://bitbucket.org/ws/repo.git"
|
|
70
|
+
"Formatos: https://github.com/org/repo.git | https://gitlab.com/grupo/repo.git | https://bitbucket.org/ws/repo.git"
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -82,7 +82,7 @@ export function parseRepoUrl(url) {
|
|
|
82
82
|
if (!vendor) {
|
|
83
83
|
throw new Error(
|
|
84
84
|
`Não foi possível detectar o vendor de ${host}.\n` +
|
|
85
|
-
"Defina VERSION_CONTROL=gitlab|github|bitbucket no ENV.md."
|
|
85
|
+
"Defina VERSION_CONTROL=gitlab|github|bitbucket no ENV.md."
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -108,16 +108,14 @@ export function parseGitLabUrl(url) {
|
|
|
108
108
|
const parsed = parseRepoUrl(url);
|
|
109
109
|
if (parsed.vendor !== "gitlab") {
|
|
110
110
|
throw new Error(
|
|
111
|
-
`URL não é GitLab (${parsed.vendor}): ${url}\n` +
|
|
112
|
-
"Use parseRepoUrl() para GitHub/Bitbucket.",
|
|
111
|
+
`URL não é GitLab (${parsed.vendor}): ${url}\n` + "Use parseRepoUrl() para GitHub/Bitbucket."
|
|
113
112
|
);
|
|
114
113
|
}
|
|
115
114
|
return parsed;
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
export function buildApiUrl(repoUrl, endpoint) {
|
|
119
|
-
const { vendor, apiBase, projectPathEncoded, owner, repo } =
|
|
120
|
-
parseRepoUrl(repoUrl);
|
|
118
|
+
const { vendor, apiBase, projectPathEncoded, owner, repo } = parseRepoUrl(repoUrl);
|
|
121
119
|
if (vendor === "gitlab") {
|
|
122
120
|
return `${apiBase}/projects/${projectPathEncoded}/${endpoint}`;
|
|
123
121
|
}
|
|
@@ -5,9 +5,7 @@ import { execSync } from "node:child_process";
|
|
|
5
5
|
|
|
6
6
|
function readNpmrcToken(hostFragment, cwd = process.cwd()) {
|
|
7
7
|
const paths = [join(cwd, ".npmrc"), join(homedir(), ".npmrc")];
|
|
8
|
-
const re = new RegExp(
|
|
9
|
-
`//[^\\s]*${hostFragment.replace(".", "\\.")}[^\\s]*:_authToken=([^\\s]+)`,
|
|
10
|
-
);
|
|
8
|
+
const re = new RegExp(`//[^\\s]*${hostFragment.replace(".", "\\.")}[^\\s]*:_authToken=([^\\s]+)`);
|
|
11
9
|
|
|
12
10
|
for (const path of paths) {
|
|
13
11
|
if (!existsSync(path)) continue;
|
|
@@ -54,31 +52,26 @@ export function getVcsToken(vendor, cwd = process.cwd()) {
|
|
|
54
52
|
if (token) return token;
|
|
55
53
|
throw new Error(
|
|
56
54
|
"Token GitHub não encontrado.\n" +
|
|
57
|
-
"Use `gh auth login`, ou defina GITHUB_TOKEN, ou //npm.pkg.github.com/:_authToken= no .npmrc."
|
|
55
|
+
"Use `gh auth login`, ou defina GITHUB_TOKEN, ou //npm.pkg.github.com/:_authToken= no .npmrc."
|
|
58
56
|
);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
if (v === "bitbucket") {
|
|
62
|
-
const token =
|
|
63
|
-
process.env.BITBUCKET_TOKEN ||
|
|
64
|
-
readNpmrcToken("bitbucket.org", cwd);
|
|
60
|
+
const token = process.env.BITBUCKET_TOKEN || readNpmrcToken("bitbucket.org", cwd);
|
|
65
61
|
if (token) return token;
|
|
66
62
|
throw new Error(
|
|
67
|
-
"Token Bitbucket não encontrado.\n" +
|
|
68
|
-
"Defina BITBUCKET_TOKEN (App Password) no ambiente.",
|
|
63
|
+
"Token Bitbucket não encontrado.\n" + "Defina BITBUCKET_TOKEN (App Password) no ambiente."
|
|
69
64
|
);
|
|
70
65
|
}
|
|
71
66
|
|
|
72
67
|
const token =
|
|
73
|
-
process.env.GITLAB_TOKEN ||
|
|
74
|
-
readNpmrcToken("gitlab.com", cwd) ||
|
|
75
|
-
readNpmrcToken("gitlab", cwd);
|
|
68
|
+
process.env.GITLAB_TOKEN || readNpmrcToken("gitlab.com", cwd) || readNpmrcToken("gitlab", cwd);
|
|
76
69
|
if (token) return token;
|
|
77
70
|
throw new Error(
|
|
78
71
|
"Token GitLab não encontrado no .npmrc\n" +
|
|
79
72
|
"Configure:\n" +
|
|
80
73
|
" //gitlab.com/api/v4/packages/npm/:_authToken=seu-token\n" +
|
|
81
|
-
"Ou GITLAB_TOKEN no ambiente."
|
|
74
|
+
"Ou GITLAB_TOKEN no ambiente."
|
|
82
75
|
);
|
|
83
76
|
}
|
|
84
77
|
|
package/bin/lib/utils/paths.js
CHANGED
|
@@ -18,8 +18,7 @@ export function getFrameworkRoot() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
throw new Error(
|
|
21
|
-
"Could not locate framework assets.\n" +
|
|
22
|
-
"Run: npm install jarvis-framework --save-dev",
|
|
21
|
+
"Could not locate framework assets.\n" + "Run: npm install jarvis-framework --save-dev"
|
|
23
22
|
);
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -48,8 +47,7 @@ export function detectIDE(cwd) {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export function detectAllIDEs(cwd) {
|
|
51
|
-
return IDES
|
|
52
|
-
.filter((ide) => ide.supported)
|
|
50
|
+
return IDES.filter((ide) => ide.supported)
|
|
53
51
|
.filter((ide) => existsSync(join(cwd, `.${ide.folderName || ide.value}`)))
|
|
54
52
|
.map((ide) => ide.value);
|
|
55
53
|
}
|
package/bin/lib/utils/ui.js
CHANGED
|
@@ -35,21 +35,15 @@ export function showBanner() {
|
|
|
35
35
|
console.log("");
|
|
36
36
|
console.log(" ──────── J . A . R . V . I . S ────────");
|
|
37
37
|
console.log(NC);
|
|
38
|
-
console.log(
|
|
39
|
-
`${DIM}Framework Jarvis para desenvolvimento assistido por IA${NC}`,
|
|
40
|
-
);
|
|
38
|
+
console.log(`${DIM}Framework Jarvis para desenvolvimento assistido por IA${NC}`);
|
|
41
39
|
|
|
42
40
|
try {
|
|
43
41
|
const pkg = getPackageInfo();
|
|
44
42
|
console.log("");
|
|
45
|
-
console.log(
|
|
46
|
-
`${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`,
|
|
47
|
-
);
|
|
43
|
+
console.log(`${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`);
|
|
48
44
|
console.log(`${BOLD}${CYAN} ${pkg.name} v${pkg.version}${NC}`);
|
|
49
45
|
console.log(`${DIM} origem: ${pkg.root}${NC}`);
|
|
50
|
-
console.log(
|
|
51
|
-
`${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`,
|
|
52
|
-
);
|
|
46
|
+
console.log(`${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`);
|
|
53
47
|
} catch {
|
|
54
48
|
// banner sem versão se assets não forem encontrados
|
|
55
49
|
}
|
package/bin/lib/vcs/api.js
CHANGED
|
@@ -89,12 +89,10 @@ export async function createMergeRequest(repoUrl, opts) {
|
|
|
89
89
|
description,
|
|
90
90
|
remove_source_branch: true,
|
|
91
91
|
},
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
93
|
);
|
|
94
94
|
if (!ok || !json?.web_url) {
|
|
95
|
-
throw new Error(
|
|
96
|
-
`Falha ao criar MR GitLab (${status}): ${JSON.stringify(json)}`,
|
|
97
|
-
);
|
|
95
|
+
throw new Error(`Falha ao criar MR GitLab (${status}): ${JSON.stringify(json)}`);
|
|
98
96
|
}
|
|
99
97
|
return { vendor: "gitlab", iid: json.iid, url: json.web_url };
|
|
100
98
|
}
|
|
@@ -111,12 +109,10 @@ export async function createMergeRequest(repoUrl, opts) {
|
|
|
111
109
|
base: target,
|
|
112
110
|
body: description,
|
|
113
111
|
},
|
|
114
|
-
}
|
|
112
|
+
}
|
|
115
113
|
);
|
|
116
114
|
if (!ok || !json?.html_url) {
|
|
117
|
-
throw new Error(
|
|
118
|
-
`Falha ao criar PR GitHub (${status}): ${JSON.stringify(json)}`,
|
|
119
|
-
);
|
|
115
|
+
throw new Error(`Falha ao criar PR GitHub (${status}): ${JSON.stringify(json)}`);
|
|
120
116
|
}
|
|
121
117
|
return { vendor: "github", iid: json.number, url: json.html_url };
|
|
122
118
|
}
|
|
@@ -133,12 +129,10 @@ export async function createMergeRequest(repoUrl, opts) {
|
|
|
133
129
|
destination: { branch: { name: target } },
|
|
134
130
|
close_source_branch: true,
|
|
135
131
|
},
|
|
136
|
-
}
|
|
132
|
+
}
|
|
137
133
|
);
|
|
138
134
|
if (!ok || !json?.links?.html?.href) {
|
|
139
|
-
throw new Error(
|
|
140
|
-
`Falha ao criar PR Bitbucket (${status}): ${JSON.stringify(json)}`,
|
|
141
|
-
);
|
|
135
|
+
throw new Error(`Falha ao criar PR Bitbucket (${status}): ${JSON.stringify(json)}`);
|
|
142
136
|
}
|
|
143
137
|
return {
|
|
144
138
|
vendor: "bitbucket",
|
|
@@ -174,12 +168,10 @@ export async function commitFiles(repoUrl, opts) {
|
|
|
174
168
|
encoding: "base64",
|
|
175
169
|
})),
|
|
176
170
|
},
|
|
177
|
-
}
|
|
171
|
+
}
|
|
178
172
|
);
|
|
179
173
|
if (!ok || !json?.id) {
|
|
180
|
-
throw new Error(
|
|
181
|
-
`Falha no commit GitLab (${status}): ${JSON.stringify(json)}`,
|
|
182
|
-
);
|
|
174
|
+
throw new Error(`Falha no commit GitLab (${status}): ${JSON.stringify(json)}`);
|
|
183
175
|
}
|
|
184
176
|
return { sha: json.id };
|
|
185
177
|
}
|
|
@@ -187,22 +179,17 @@ export async function commitFiles(repoUrl, opts) {
|
|
|
187
179
|
if (repo.vendor === "github") {
|
|
188
180
|
const refRes = await request(
|
|
189
181
|
`${repo.apiBase}/repos/${repo.owner}/${repo.repo}/git/ref/heads/${startBranch}`,
|
|
190
|
-
{ headers }
|
|
182
|
+
{ headers }
|
|
191
183
|
);
|
|
192
184
|
if (!refRes.ok) {
|
|
193
|
-
throw new Error(
|
|
194
|
-
`Branch ${startBranch} não encontrada no GitHub (${refRes.status})`,
|
|
195
|
-
);
|
|
185
|
+
throw new Error(`Branch ${startBranch} não encontrada no GitHub (${refRes.status})`);
|
|
196
186
|
}
|
|
197
187
|
const sha = refRes.json.object.sha;
|
|
198
|
-
await request(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
body: { ref: `refs/heads/${branch}`, sha },
|
|
204
|
-
},
|
|
205
|
-
);
|
|
188
|
+
await request(`${repo.apiBase}/repos/${repo.owner}/${repo.repo}/git/refs`, {
|
|
189
|
+
method: "POST",
|
|
190
|
+
headers,
|
|
191
|
+
body: { ref: `refs/heads/${branch}`, sha },
|
|
192
|
+
});
|
|
206
193
|
let lastSha = sha;
|
|
207
194
|
for (const file of files) {
|
|
208
195
|
const put = await request(
|
|
@@ -215,11 +202,11 @@ export async function commitFiles(repoUrl, opts) {
|
|
|
215
202
|
content: file.contentBase64,
|
|
216
203
|
branch,
|
|
217
204
|
},
|
|
218
|
-
}
|
|
205
|
+
}
|
|
219
206
|
);
|
|
220
207
|
if (!put.ok) {
|
|
221
208
|
throw new Error(
|
|
222
|
-
`Falha ao escrever ${file.path} no GitHub (${put.status}): ${JSON.stringify(put.json)}
|
|
209
|
+
`Falha ao escrever ${file.path} no GitHub (${put.status}): ${JSON.stringify(put.json)}`
|
|
223
210
|
);
|
|
224
211
|
}
|
|
225
212
|
lastSha = put.json.commit?.sha || lastSha;
|
|
@@ -235,14 +222,11 @@ export async function commitFiles(repoUrl, opts) {
|
|
|
235
222
|
const buf = Buffer.from(file.contentBase64, "base64");
|
|
236
223
|
form.set(file.path, new Blob([buf]));
|
|
237
224
|
}
|
|
238
|
-
const res = await fetch(
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
body: form,
|
|
244
|
-
},
|
|
245
|
-
);
|
|
225
|
+
const res = await fetch(`${repo.apiBase}/repositories/${repo.owner}/${repo.repo}/src`, {
|
|
226
|
+
method: "POST",
|
|
227
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
228
|
+
body: form,
|
|
229
|
+
});
|
|
246
230
|
if (!res.ok) {
|
|
247
231
|
throw new Error(`Falha no commit Bitbucket (${res.status}): ${await res.text()}`);
|
|
248
232
|
}
|
|
@@ -262,7 +246,7 @@ export async function createIssue(repoUrl, opts) {
|
|
|
262
246
|
method: "POST",
|
|
263
247
|
headers,
|
|
264
248
|
body: { title, description: body, labels: labels.join(",") },
|
|
265
|
-
}
|
|
249
|
+
}
|
|
266
250
|
);
|
|
267
251
|
if (!ok || !json?.web_url) {
|
|
268
252
|
throw new Error(`Issue GitLab (${status}): ${JSON.stringify(json)}`);
|
|
@@ -277,7 +261,7 @@ export async function createIssue(repoUrl, opts) {
|
|
|
277
261
|
method: "POST",
|
|
278
262
|
headers,
|
|
279
263
|
body: { title, body, labels },
|
|
280
|
-
}
|
|
264
|
+
}
|
|
281
265
|
);
|
|
282
266
|
if (!ok || !json?.html_url) {
|
|
283
267
|
throw new Error(`Issue GitHub (${status}): ${JSON.stringify(json)}`);
|
|
@@ -291,7 +275,7 @@ export async function createIssue(repoUrl, opts) {
|
|
|
291
275
|
method: "POST",
|
|
292
276
|
headers,
|
|
293
277
|
body: { title, content: { raw: body } },
|
|
294
|
-
}
|
|
278
|
+
}
|
|
295
279
|
);
|
|
296
280
|
if (!ok || !json?.links?.html?.href) {
|
|
297
281
|
throw new Error(`Issue Bitbucket (${status}): ${JSON.stringify(json)}`);
|
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
import { createIssue, parseRepoUrl } from "./api.js";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
* Abre uma issue via adapter (GitLab/GitHub/Bitbucket).
|
|
7
|
+
* Usada por `jarvis vcs create-issue` e pelo skill `jarvis-report-issue`.
|
|
8
|
+
* @param {Object} options
|
|
9
|
+
* @param {string} options.repo - URL ou `org/repo` do repositório
|
|
10
|
+
* @param {string} options.title - Título da issue
|
|
11
|
+
* @param {string} options.bodyFile - Path de um arquivo com o corpo em markdown
|
|
12
|
+
*/
|
|
13
|
+
export async function runCreateIssue({ repo, title, bodyFile }) {
|
|
14
|
+
if (!title || !bodyFile || !repo) {
|
|
15
|
+
console.error(
|
|
16
|
+
"Uso: jarvis vcs create-issue --repo <url-ou-path> --title <titulo> --body-file <path>"
|
|
17
|
+
);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
21
|
+
let repoUrl = repo.trim();
|
|
22
|
+
if (!/^https?:\/\//.test(repoUrl) && !repoUrl.includes("@")) {
|
|
23
|
+
const hostGuess = (process.env.VERSION_CONTROL || "gitlab").toLowerCase();
|
|
24
|
+
const host =
|
|
25
|
+
hostGuess === "github"
|
|
26
|
+
? "github.com"
|
|
27
|
+
: hostGuess === "bitbucket"
|
|
28
|
+
? "bitbucket.org"
|
|
29
|
+
: "gitlab.com";
|
|
30
|
+
repoUrl = `https://${host}/${repoUrl.replace(/^\/+/, "")}`;
|
|
31
|
+
}
|
|
13
32
|
|
|
14
|
-
|
|
15
|
-
console.error(
|
|
16
|
-
"Uso: create-issue.js --repo <url-ou-path> --title <titulo> --body-file <path>",
|
|
17
|
-
);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
33
|
+
const body = existsSync(bodyFile) ? readFileSync(bodyFile, "utf-8") : "";
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
repoUrl = `https://${host}/${repoUrl.replace(/^\/+/, "")}`;
|
|
35
|
+
try {
|
|
36
|
+
const result = await createIssue(repoUrl, { title, body });
|
|
37
|
+
parseRepoUrl(repoUrl);
|
|
38
|
+
console.log(`✅ Issue aberto: ${result.url}`);
|
|
39
|
+
console.log(JSON.stringify(result));
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.error(err.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
|
|
46
|
+
function arg(name, fallback = "") {
|
|
47
|
+
const idx = process.argv.indexOf(`--${name}`);
|
|
48
|
+
if (idx === -1) return fallback;
|
|
49
|
+
return process.argv[idx + 1] || fallback;
|
|
50
|
+
}
|
|
34
51
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
process.exit(1);
|
|
52
|
+
// Compatibilidade: continua funcionando como `node bin/lib/vcs/create-issue.js --repo ...`
|
|
53
|
+
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
54
|
+
await runCreateIssue({
|
|
55
|
+
title: arg("title"),
|
|
56
|
+
bodyFile: arg("body-file"),
|
|
57
|
+
repo: arg("repo"),
|
|
58
|
+
});
|
|
43
59
|
}
|
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { createMergeRequest, parseRepoUrl } from "./api.js";
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Abre um MR/PR via adapter (GitLab/GitHub/Bitbucket, pelo hostname do remote).
|
|
8
|
+
* Usada por `jarvis vcs create-merge` e, diretamente, por `eng.pr`.
|
|
9
|
+
* @param {Object} options
|
|
10
|
+
* @param {string} options.source - Branch de origem
|
|
11
|
+
* @param {string} options.target - Branch de destino
|
|
12
|
+
* @param {string} options.title - Título do MR/PR
|
|
13
|
+
* @param {string} [options.bodyFile] - Path de um arquivo com a descrição
|
|
14
|
+
* @param {string} [options.repo] - URL do repo (padrão: `git remote get-url origin`)
|
|
15
|
+
*/
|
|
16
|
+
export async function runCreateMerge({ source, target, title, bodyFile, repo }) {
|
|
17
|
+
if (!source || !target || !title) {
|
|
18
|
+
console.error(
|
|
19
|
+
"Uso: jarvis vcs create-merge --source <branch> --target <branch> --title <titulo> [--body-file path] [--repo url]"
|
|
20
|
+
);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const repoUrl = repo || execSync("git remote get-url origin", { encoding: "utf-8" }).trim();
|
|
25
|
+
const description = bodyFile ? readFileSync(bodyFile, "utf-8") : "";
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const result = await createMergeRequest(repoUrl, {
|
|
29
|
+
source,
|
|
30
|
+
target,
|
|
31
|
+
title,
|
|
32
|
+
description,
|
|
33
|
+
});
|
|
34
|
+
const parsed = parseRepoUrl(repoUrl);
|
|
35
|
+
const noun = parsed.vendor === "gitlab" ? "MR" : "PR";
|
|
36
|
+
console.log(`✅ ${noun} criado: ${result.url}`);
|
|
37
|
+
console.log(JSON.stringify(result));
|
|
38
|
+
} catch (err) {
|
|
39
|
+
console.error(err.message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
5
44
|
function arg(name, fallback = "") {
|
|
6
45
|
const idx = process.argv.indexOf(`--${name}`);
|
|
7
46
|
if (idx === -1) return fallback;
|
|
8
47
|
return process.argv[idx + 1] || fallback;
|
|
9
48
|
}
|
|
10
49
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"Uso: create-merge.js --source <branch> --target <branch> --title <titulo> [--body-file path] [--repo url]",
|
|
20
|
-
);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const repoUrl =
|
|
25
|
-
repoArg ||
|
|
26
|
-
execSync("git remote get-url origin", { encoding: "utf-8" }).trim();
|
|
27
|
-
const description = bodyFile ? readFileSync(bodyFile, "utf-8") : "";
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const result = await createMergeRequest(repoUrl, {
|
|
31
|
-
source,
|
|
32
|
-
target,
|
|
33
|
-
title,
|
|
34
|
-
description,
|
|
50
|
+
// Compatibilidade: continua funcionando como `node bin/lib/vcs/create-merge.js --source ...`
|
|
51
|
+
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
52
|
+
await runCreateMerge({
|
|
53
|
+
source: arg("source"),
|
|
54
|
+
target: arg("target"),
|
|
55
|
+
title: arg("title"),
|
|
56
|
+
bodyFile: arg("body-file"),
|
|
57
|
+
repo: arg("repo"),
|
|
35
58
|
});
|
|
36
|
-
const parsed = parseRepoUrl(repoUrl);
|
|
37
|
-
const noun = parsed.vendor === "gitlab" ? "MR" : "PR";
|
|
38
|
-
console.log(`✅ ${noun} criado: ${result.url}`);
|
|
39
|
-
console.log(JSON.stringify(result));
|
|
40
|
-
} catch (err) {
|
|
41
|
-
console.error(err.message);
|
|
42
|
-
process.exit(1);
|
|
43
59
|
}
|
package/bin/lib/vcs/fetch-raw.js
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
1
2
|
import { fetchRawFile } from "./api.js";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Busca o conteúdo bruto de um arquivo no central-docs via adapter.
|
|
6
|
+
* Usada por `jarvis vcs fetch-raw`.
|
|
7
|
+
* @param {string} filePath - Path do arquivo dentro do repo central-docs
|
|
8
|
+
* @param {string} [ref] - Branch/ref (padrão: "main")
|
|
9
|
+
*/
|
|
10
|
+
export async function runFetchRaw(filePath, ref = "main") {
|
|
11
|
+
const repo = process.env.CENTRAL_DOCS_REPO;
|
|
6
12
|
|
|
7
|
-
if (!filePath) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
if (!repo) {
|
|
12
|
-
console.error("CENTRAL_DOCS_REPO não definido");
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const content = await fetchRawFile(repo, filePath, ref);
|
|
18
|
-
process.stdout.write(content);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
if (err.code === 404) {
|
|
21
|
-
console.error(`⚠️ Arquivo não encontrado no central-docs: ${filePath}`);
|
|
22
|
-
process.exit(2);
|
|
13
|
+
if (!filePath) {
|
|
14
|
+
console.error("Uso: jarvis vcs fetch-raw <file-path> [ref]");
|
|
15
|
+
process.exit(1);
|
|
23
16
|
}
|
|
24
|
-
if (
|
|
25
|
-
console.error("
|
|
17
|
+
if (!repo) {
|
|
18
|
+
console.error("CENTRAL_DOCS_REPO não definido");
|
|
26
19
|
process.exit(1);
|
|
27
20
|
}
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const content = await fetchRawFile(repo, filePath, ref);
|
|
24
|
+
process.stdout.write(content);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (err.code === 404) {
|
|
27
|
+
console.error(`⚠️ Arquivo não encontrado no central-docs: ${filePath}`);
|
|
28
|
+
process.exit(2);
|
|
29
|
+
}
|
|
30
|
+
if (err.code === 401 || err.code === 403) {
|
|
31
|
+
console.error("❌ Token sem permissão para acessar o repositório");
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
console.error(err.message);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Compatibilidade: continua funcionando como `node bin/lib/vcs/fetch-raw.js <file-path> [ref]`
|
|
40
|
+
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
41
|
+
await runFetchRaw(process.argv[2], process.argv[3] || "main");
|
|
30
42
|
}
|
package/members.md
CHANGED
|
@@ -4,7 +4,7 @@ Lista de membros da organização com suas posições, squads e identificadores.
|
|
|
4
4
|
|
|
5
5
|
> **Formato**: `Nome Completo | email | posição | slack_user_id`
|
|
6
6
|
> **Squads válidos**: definidos em `taxonomy.md`
|
|
7
|
-
>
|
|
7
|
+
> Edite esta tabela para cadastrar os membros.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jarvis-ai-framework",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Jarvis framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"postinstall": "node bin/postinstall.js",
|
|
11
11
|
"prepublishOnly": "echo 'Publishing jarvis-framework...'",
|
|
12
12
|
"publish:gitlab": "npm publish",
|
|
13
|
-
"test:comandos": "node test/
|
|
13
|
+
"test:comandos": "node test/comandos-docs.test.js",
|
|
14
|
+
"test:filtro": "node --test test/profile-filter.test.js test/token-report.test.js test/flow-map.test.js test/env-loader.test.js test/sync-engine.test.js test/vcs-api.test.js test/fetch-file.test.js test/publish-file.test.js",
|
|
15
|
+
"lint": "eslint bin/ test/",
|
|
16
|
+
"lint:fix": "eslint bin/ test/ --fix",
|
|
17
|
+
"format": "prettier --write bin/ test/",
|
|
18
|
+
"format:check": "prettier --check bin/ test/"
|
|
14
19
|
},
|
|
15
20
|
"files": [
|
|
16
21
|
"bin/",
|
|
@@ -19,6 +24,7 @@
|
|
|
19
24
|
"workflows/",
|
|
20
25
|
"templates/",
|
|
21
26
|
"rules/",
|
|
27
|
+
"rules-on-demand/",
|
|
22
28
|
"taxonomy.md",
|
|
23
29
|
"members.md",
|
|
24
30
|
"AGENTS.md",
|
|
@@ -43,11 +49,16 @@
|
|
|
43
49
|
"bugs": {
|
|
44
50
|
"url": "https://github.com/phelipperibeiro/jarvis-framework/issues"
|
|
45
51
|
},
|
|
46
|
-
"dependencies": {},
|
|
47
52
|
"engines": {
|
|
48
53
|
"node": ">=18.0.0"
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
|
-
"
|
|
56
|
+
"@eslint/js": "^9.39.5",
|
|
57
|
+
"eslint": "^9.39.5",
|
|
58
|
+
"eslint-config-prettier": "^10.1.8",
|
|
59
|
+
"prettier": "^3.9.9"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"commander": "^13.1.0"
|
|
52
63
|
}
|
|
53
64
|
}
|