jarvis-ai-framework 8.7.0 → 9.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 +33 -36
- package/README.md +22 -10
- package/agents/AGENTS.md +8 -14
- package/agents/README.md +17 -25
- package/agents/engineering/eng.agent.md +10 -12
- package/agents/engineering/eng.bug-hunter.md +7 -10
- package/agents/engineering/eng.dev-code-reviewer.md +1 -1
- package/agents/engineering/eng.frontend.agent.md +3 -2
- package/agents/engineering/eng.rpa.agent.md +8 -6
- package/agents/engineering/qa/eng.qa.test-planner.md +12 -4
- package/agents/engineering/qa/eng.qa.testing-engineer.md +10 -97
- package/agents/product/prod.discovery-interviewer.md +1 -1
- package/bin/README.md +10 -10
- package/bin/commands/init.js +188 -51
- package/bin/commands/rules.js +11 -24
- package/bin/commands/tokens.js +20 -42
- package/bin/commands/untrack.js +73 -0
- package/bin/commands/whoami.js +2 -18
- package/bin/lib/auth/session.js +1 -27
- package/bin/lib/cli/program.js +12 -9
- package/bin/lib/config/constants.js +97 -24
- package/bin/lib/config/ide-config.js +0 -8
- package/bin/lib/core/env-paths.js +2 -2
- package/bin/lib/core/env-upgrade.js +61 -9
- package/bin/lib/core/git-exclude.js +267 -0
- package/bin/lib/core/profile-filter.js +31 -94
- package/bin/lib/core/repos-map.js +106 -0
- package/bin/lib/core/sync-engine.js +42 -44
- package/bin/lib/core/token-report.js +11 -13
- package/bin/lib/core/workspace-mode.js +1 -1
- package/bin/lib/docs/validate-frontmatter.js +0 -42
- package/bin/lib/utils/git-parser.js +0 -5
- package/bin/lib/utils/paths.js +0 -16
- package/package.json +2 -3
- package/rules/artifact-style-rules.md +2 -4
- package/rules/company-overlay-rules.md +0 -2
- package/rules/engineering/eng-rules.md +3 -29
- package/rules/engineering/eng-security-rules.md +0 -15
- package/rules/engineering/eng.integrations-rules.md +3 -12
- package/rules/engineering/eng.skills-rules.md +0 -2
- package/rules/engineering/eng.specializations-rules.md +0 -2
- package/rules/product/prod-rules.md +1 -2
- package/rules/rtk-rules.md +0 -2
- package/rules-on-demand/doc-links-rules.md +5 -7
- package/rules-on-demand/engineering/eng.bump-rules.md +0 -2
- package/rules-on-demand/engineering/eng.gate0-rules.md +0 -2
- package/rules-on-demand/engineering/eng.plan-rules.md +0 -2
- package/rules-on-demand/engineering/eng.pr-rules.md +1 -3
- package/rules-on-demand/engineering/eng.pre-pr-rules.md +2 -4
- package/rules-on-demand/engineering/eng.rpa-rules.md +0 -2
- package/rules-on-demand/engineering/eng.security-rules.md +0 -2
- package/rules-on-demand/engineering/eng.start-rules.md +0 -2
- package/rules-on-demand/engineering/eng.tech-spec-rules.md +5 -6
- package/rules-on-demand/engineering/eng.transitions-rules.md +3 -5
- package/rules-on-demand/engineering/eng.work-rules.md +0 -2
- package/{rules → rules-on-demand}/engineering/frontend/eng.frontend-rules.md +1 -3
- package/rules-on-demand/product/prod.guided-rules.md +2 -4
- package/rules-on-demand/product/prod.spec-common-rules.md +2 -4
- package/{rules → rules-on-demand}/product/prod.spec-rules.md +2 -4
- package/rules-on-demand/warm-up-consume-rules.md +0 -2
- package/skills/AGENTS.md +7 -23
- package/skills/eng-frontend/SKILL.md +2 -0
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/SKILL.md +19 -27
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/references/1-nivel-context.md +1 -1
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/references/2-nivel-container.md +1 -1
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/references/3-nivel-component.md +1 -1
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/references/4-nivel-code.md +1 -1
- package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/references/5-atualizacao-e-adrs.md +1 -1
- package/skills/eng-global-docs-write/SKILL.md +5 -3
- package/skills/eng-global-tech-spec/SKILL.md +1 -1
- package/skills/eng-global-tech-spec/references/delivery-spec.md +22 -9
- package/skills/eng-global-tech-spec/references/reference-spec.md +1 -1
- package/skills/jarvis-context-detect/SKILL.md +19 -16
- package/skills/jarvis-context-detect/assets/context-profile-template.md +2 -2
- package/skills/jarvis-context-detect/references/cdd-aplicado-a-prompts.md +9 -10
- package/skills/jarvis-create-specialization/assets/skill-especializacao-template.md +0 -1
- package/skills/jarvis-docs-index/SKILL.md +1 -1
- package/skills/jarvis-evolution-architect/references/visao-geral.md +1 -1
- package/skills/jarvis-init/SKILL.md +121 -140
- package/skills/jarvis-init/assets/exemplo-execucao.md +8 -8
- package/skills/jarvis-init/assets/mapa-de-tecnologias.md +27 -0
- package/skills/jarvis-init/assets/onboarding-checklist.md +0 -1
- package/skills/jarvis-init/assets/passo-adicionar-stacks.md +9 -3
- package/skills/jarvis-init/assets/repos.md +48 -0
- package/skills/jarvis-init/assets/rules-sync-manual.md +11 -68
- package/skills/jarvis-init/assets/upgrade.md +18 -9
- package/skills/jarvis-init/assets/validacoes.md +3 -22
- package/taxonomy.md +6 -156
- package/templates/AGENTS.md +16 -16
- package/templates/ENV-template.md +18 -35
- package/templates/cdd-mind-map-template.md +2 -2
- package/templates/engineering/AGENTS-template.md +10 -2
- package/templates/engineering/RFC-template.md +17 -4
- package/templates/engineering/advisor-template.md +2 -1
- package/templates/engineering/architecture-template.md +18 -10
- package/templates/engineering/light-arch-template.md +9 -9
- package/templates/engineering/plan-template.md +5 -1
- package/templates/engineering/qa/qa.test-strategy-template.md +3 -1
- package/templates/engineering/tech-spec-delivery-template.md +88 -4
- package/templates/engineering/tech-spec-template.md +29 -2
- package/workflows/AGENTS.md +11 -17
- package/workflows/README.md +10 -23
- package/workflows/engineering/eng.build-tech-spec.md +0 -25
- package/workflows/engineering/eng.create-ard.md +74 -9
- package/workflows/engineering/eng.debug.md +8 -8
- package/workflows/engineering/eng.light-arch.md +3 -4
- package/workflows/engineering/eng.plan.md +11 -7
- package/workflows/engineering/eng.pr.md +2 -1
- package/workflows/engineering/eng.pre-pr.md +5 -2
- package/workflows/engineering/eng.rpa.robot.md +1 -1
- package/workflows/engineering/eng.start.md +2 -2
- package/workflows/engineering/eng.work.md +0 -2
- package/workflows/engineering/frontend/eng.frontend-component.md +1 -1
- package/workflows/engineering/frontend/eng.frontend-perf-audit.md +1 -1
- package/workflows/engineering/frontend/eng.frontend-review.md +2 -2
- package/workflows/product/prod.spec.ard.md +7 -5
- package/workflows/product/prod.spec.breakdown.md +3 -3
- package/workflows/product/prod.spec.clarify.md +2 -0
- package/workflows/product/prod.spec.discovery.md +1 -1
- package/workflows/product/prod.spec.epic.md +2 -2
- package/workflows/product/prod.spec.frd.md +2 -2
- package/workflows/product/prod.spec.issue.md +2 -2
- package/workflows/product/prod.spec.prd.md +2 -2
- package/workflows/taxonomy.md +10 -17
- package/workflows/warm-up.md +6 -8
- package/agents/engineering/data/eng.data-engineer.agent.md +0 -250
- package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +0 -89
- package/agents/engineering/qa/eng.qa.quality-strategist.md +0 -116
- package/members.md +0 -25
- package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +0 -5
- package/rules-on-demand/engineering/eng.breakdown-subtasks-rules.md +0 -556
- package/rules-on-demand/engineering/qa/eng.qa.cypress-standards-rules.md +0 -259
- package/skills/SKILLS-ROADMAP.md +0 -232
- package/skills/eng-qa-planner/assets/test-coverage-template.md +0 -92
- package/skills/eng-qa-planner/assets/test-patterns.md +0 -178
- package/skills/product-roadmap-report/README.md +0 -303
- package/skills/product-roadmap-report/SKILL.md +0 -208
- package/skills/product-roadmap-report/commands/status.compiled.single.team.md +0 -23
- package/skills/product-roadmap-report/commands/status.list.projects.md +0 -17
- package/skills/product-roadmap-report/commands/status.memory.md +0 -192
- package/skills/product-roadmap-report/commands/status.roadmap.preview.md +0 -94
- package/skills/product-roadmap-report/references/detailed-guide.md +0 -236
- package/skills/product-roadmap-report/rules/status-report-rules.md +0 -44
- package/skills/product-roadmap-report/templates/template-multiple-teams-compiled-status.md +0 -53
- package/skills/product-roadmap-report/templates/template-projects-list.md +0 -23
- package/skills/product-roadmap-report/templates/template-single-team-compiled-status.md +0 -60
- package/skills/product-roadmap-report/templates/template-single-team-status.md +0 -49
- package/skills/product-specs/SKILL.md +0 -52
- package/skills/product-specs-update/SKILL.md +0 -295
- package/templates/engineering/breakdown-subtasks-template.md +0 -211
- package/templates/engineering/data-contract-template.md +0 -135
- package/templates/engineering/data-pipeline-template.md +0 -163
- package/templates/engineering/qa/qa.release-signoff-template.md +0 -54
- package/templates/engineering/qa/qa.sprint-plan-template.md +0 -49
- package/templates/engineering/work-progress-template.md +0 -155
- package/workflows/engineering/data/data.contract.md +0 -210
- package/workflows/engineering/data/data.new-pipeline.md +0 -241
- package/workflows/engineering/eng.breakdown-subtasks.md +0 -201
- package/workflows/engineering/eng.create-ard-from-code.md +0 -240
- package/workflows/engineering/eng.docs.md +0 -48
- package/workflows/engineering/eng.review.md +0 -185
- package/workflows/engineering/qa/eng.qa-refinement-entry.md +0 -88
- package/workflows/engineering/qa/eng.qa-release-signoff.md +0 -108
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +0 -102
- package/workflows/product/prod.roadmap.preview.md +0 -115
- /package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/assets/example-code.md +0 -0
- /package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/assets/example-component.md +0 -0
- /package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/assets/example-container.md +0 -0
- /package/skills/{eng-backend-arch-c4 → eng-global-arch-c4}/assets/example-context.md +0 -0
package/bin/commands/tokens.js
CHANGED
|
@@ -1,60 +1,39 @@
|
|
|
1
1
|
import { buildReport } from "../lib/core/token-report.js";
|
|
2
2
|
import { resolveEnvPath, loadEnv } from "../lib/env-loader.js";
|
|
3
3
|
import { getFrameworkRoot } from "../lib/utils/paths.js";
|
|
4
|
-
import { showBanner, RED, GREEN, BLUE,
|
|
4
|
+
import { showBanner, RED, GREEN, BLUE, CYAN, DIM, NC } from "../lib/utils/ui.js";
|
|
5
5
|
import { logger } from "../lib/utils/logger.js";
|
|
6
6
|
|
|
7
|
-
const AXES = ["HUB", "POSITION", "AREA", "SQUAD"];
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* O que muda a medida: ARTIFACT_STYLE e RTK. A flag manda; o que faltar vem do ENV.md, se houver.
|
|
9
|
+
* Sem ENV.md, vale `ai-generated` e o RTK desligado (#263). Se não dá para escolher ou ler o ENV.md
|
|
10
|
+
* (dois na mesma pasta, `--ide` inválida ou sem ENV.md, `JARVIS_ENV_FILE` inexistente, ENV.md
|
|
11
|
+
* ilegível), sai com 1, como o `jarvis rules sync`: medir com o padrão daria um número errado que
|
|
12
|
+
* parece certo.
|
|
12
13
|
*/
|
|
13
14
|
function resolveProfile(flags) {
|
|
14
15
|
const profile = {};
|
|
15
|
-
for (const axis of AXES) {
|
|
16
|
-
const value = flags[axis.toLowerCase()];
|
|
17
|
-
if (typeof value === "string") profile[axis] = value;
|
|
18
|
-
}
|
|
19
16
|
if (typeof flags.artifactStyle === "string") profile.ARTIFACT_STYLE = flags.artifactStyle;
|
|
20
|
-
|
|
21
17
|
let rtkEnabled = flags.rtk === true || flags.rtk === "true";
|
|
22
|
-
|
|
23
|
-
if (AXES.some((axis) => !profile[axis])) {
|
|
24
|
-
try {
|
|
25
|
-
const { path } = resolveEnvPath(process.cwd(), flags);
|
|
26
|
-
const env = loadEnv(process.cwd(), path);
|
|
27
|
-
for (const axis of AXES) {
|
|
28
|
-
if (!profile[axis] && env[axis]) profile[axis] = env[axis];
|
|
29
|
-
}
|
|
30
|
-
if (!profile.ARTIFACT_STYLE && env.ARTIFACT_STYLE)
|
|
31
|
-
profile.ARTIFACT_STYLE = env.ARTIFACT_STYLE;
|
|
32
|
-
if (flags.rtk === undefined) rtkEnabled = env.RTK_ENABLED === "true";
|
|
33
|
-
} catch {
|
|
34
|
-
// sem ENV.md: valem só as flags
|
|
35
|
-
}
|
|
36
|
-
}
|
|
18
|
+
if (profile.ARTIFACT_STYLE && flags.rtk !== undefined) return { profile, rtkEnabled };
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
let env;
|
|
21
|
+
try {
|
|
22
|
+
// Sem ENV.md, o resolveEnvPath devolve o caminho da raiz, que não existe, e o loadEnv devolve {}.
|
|
23
|
+
env = loadEnv(process.cwd(), resolveEnvPath(process.cwd(), flags).path);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
logger.error(`${RED}❌ ${err.message}${NC}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
if (!profile.ARTIFACT_STYLE && env.ARTIFACT_STYLE) profile.ARTIFACT_STYLE = env.ARTIFACT_STYLE;
|
|
29
|
+
if (flags.rtk === undefined) rtkEnabled = env.RTK_ENABLED === "true";
|
|
30
|
+
return { profile, rtkEnabled };
|
|
40
31
|
}
|
|
41
32
|
|
|
42
33
|
const kb = (bytes) => (bytes / 1000).toFixed(1);
|
|
43
34
|
|
|
44
35
|
export async function tokens(flags) {
|
|
45
|
-
const { profile, rtkEnabled
|
|
46
|
-
|
|
47
|
-
if (missing.length > 0) {
|
|
48
|
-
logger.error(`${RED}❌ Perfil incompleto: faltam ${missing.join(", ")}${NC}`);
|
|
49
|
-
logger.info(
|
|
50
|
-
`${YELLOW}Uso: jarvis tokens [--hub X --position Y --area Z --squad W] [--rtk] [--json]${NC}`
|
|
51
|
-
);
|
|
52
|
-
logger.info(
|
|
53
|
-
`${DIM}Sem flags, o perfil vem do ENV.md do workspace (use --ide <ide> se houver mais de um).${NC}\n`
|
|
54
|
-
);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
|
|
36
|
+
const { profile, rtkEnabled } = resolveProfile(flags);
|
|
58
37
|
const report = buildReport(getFrameworkRoot(), profile, { rtkEnabled });
|
|
59
38
|
|
|
60
39
|
if (flags.json) {
|
|
@@ -65,8 +44,7 @@ export async function tokens(flags) {
|
|
|
65
44
|
showBanner();
|
|
66
45
|
logger.info(`${CYAN}📏 Custo estimado no início da sessão${NC}`);
|
|
67
46
|
logger.info(
|
|
68
|
-
`${DIM}
|
|
69
|
-
` | RTK=${rtkEnabled ? "ligado" : "desligado"}${NC}`
|
|
47
|
+
`${DIM}ARTIFACT_STYLE=${report.profile.ARTIFACT_STYLE} | RTK=${rtkEnabled ? "ligado" : "desligado"}${NC}`
|
|
70
48
|
);
|
|
71
49
|
logger.info(`${DIM}${report.estimate}${NC}`);
|
|
72
50
|
logger.info("");
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { resolveEnvPath } from "../lib/env-loader.js";
|
|
3
|
+
import { UNTRACKABLE_FILES, untrackFromIndex } from "../lib/core/git-exclude.js";
|
|
4
|
+
import { logger, configureFromFlags } from "../lib/utils/logger.js";
|
|
5
|
+
import { RED, GREEN, YELLOW, DIM, NC } from "../lib/utils/ui.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `jarvis untrack <arquivos…>` (#227): tira `AGENTS.md` e/ou `CLAUDE.md` já versionados do índice do git
|
|
9
|
+
* (`git rm --cached`), sem apagar o arquivo local, e os põe no `.git/info/exclude`. Nunca faz commit nem
|
|
10
|
+
* push: a remoção fica staged para a pessoa revisar e commitar.
|
|
11
|
+
*
|
|
12
|
+
* É a execução da escolha **Tirar do git**, feita no `/jarvis-init upgrade` (skill na IDE) depois do Sim da
|
|
13
|
+
* pessoa. O `jarvis init` e o `jarvis init --upgrade` nunca chamam isto, nem com `--yes`: arquivo que a
|
|
14
|
+
* pessoa não confirmou não sai do índice. Só vale no modo projeto (raiz com `.git`) e exige o `ENV.md` do
|
|
15
|
+
* workspace (achado da pasta atual para cima, ou por `--ide`/`--env-file`): sem ele o comando recusa, para não
|
|
16
|
+
* agir no repositório filho de um workspace por acidente.
|
|
17
|
+
*
|
|
18
|
+
* Sai com 1 se algum arquivo foi recusado (nome fora da lista, não versionado, raiz sem repositório).
|
|
19
|
+
* @param {string[]} files
|
|
20
|
+
* @param {{ ide?: string, "env-file"?: string }} [flags]
|
|
21
|
+
*/
|
|
22
|
+
export function untrack(files, flags = {}) {
|
|
23
|
+
configureFromFlags(flags);
|
|
24
|
+
|
|
25
|
+
const names = [...new Set((files || []).filter(Boolean))];
|
|
26
|
+
if (names.length === 0) {
|
|
27
|
+
logger.error(`${RED}❌ Informe o arquivo: jarvis untrack ${UNTRACKABLE_FILES.join(" | ")}${NC}`);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let workspaceDir;
|
|
33
|
+
try {
|
|
34
|
+
const resolved = resolveEnvPath(process.cwd(), flags);
|
|
35
|
+
if (!resolved.path || !existsSync(resolved.path)) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"ENV.md não encontrado: rode o comando na pasta do workspace (a que contém a pasta da IDE) ou use --ide/--env-file"
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
workspaceDir = resolved.root || process.cwd();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
logger.error(`${RED}❌ ${error.message}${NC}`);
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let removed = 0;
|
|
48
|
+
for (const name of names) {
|
|
49
|
+
const result = untrackFromIndex(workspaceDir, name);
|
|
50
|
+
if (!result.ok) {
|
|
51
|
+
logger.error(`${RED}❌ ${name}: ${result.reason}${NC}`);
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
removed += 1;
|
|
56
|
+
logger.info(`${GREEN}✅ ${name}: removido do índice (staged). O arquivo local continua.${NC}`);
|
|
57
|
+
if (result.excludeAdded.length) {
|
|
58
|
+
logger.info(`${DIM} • .git/info/exclude: ${result.excludeAdded.join(", ")}${NC}`);
|
|
59
|
+
}
|
|
60
|
+
if (result.excludeError) {
|
|
61
|
+
logger.error(
|
|
62
|
+
`${RED} ✗ O exclude não foi gravado (${result.excludeError}). O índice JÁ foi alterado (staged), mas o arquivo local pode voltar a aparecer como novo no git.${NC}`
|
|
63
|
+
);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (removed > 0) {
|
|
68
|
+
logger.info(
|
|
69
|
+
`${YELLOW}ℹ️ Nenhum commit foi criado. Revise com \`git status\` e faça o commit; ao ser integrado, ` +
|
|
70
|
+
`o commit apaga o arquivo para o resto do time (o histórico guarda o conteúdo).${NC}`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
package/bin/commands/whoami.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import { resolveUser
|
|
1
|
+
import { resolveUser } from "../lib/auth/session.js";
|
|
2
2
|
import { loadEnv, resolveEnvPath } from "../lib/env-loader.js";
|
|
3
3
|
import { logger, configureFromFlags } from "../lib/utils/logger.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BLUE, DIM, NC } from "../lib/utils/ui.js";
|
|
5
5
|
|
|
6
6
|
export async function whoami(flags) {
|
|
7
7
|
configureFromFlags(flags);
|
|
8
8
|
|
|
9
|
-
if (flags.logout) {
|
|
10
|
-
clearSession();
|
|
11
|
-
logger.info(`${GREEN}✓ ~/.jarvis/auth.json removido${NC}`);
|
|
12
|
-
logger.info(
|
|
13
|
-
`${DIM}Login não é mais necessário — identidade vem de USER= no ENV.md, git ou SO.${NC}`
|
|
14
|
-
);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
9
|
let env = {};
|
|
19
10
|
try {
|
|
20
11
|
const cwd = process.cwd();
|
|
@@ -36,12 +27,5 @@ export async function whoami(flags) {
|
|
|
36
27
|
`${DIM}Sem login. Ordem: ENV.md (USER=) → git config user.email → usuário do SO.${NC}`
|
|
37
28
|
);
|
|
38
29
|
|
|
39
|
-
const leftover = readSession();
|
|
40
|
-
if (leftover?.email) {
|
|
41
|
-
logger.info("");
|
|
42
|
-
logger.info(` ${YELLOW}⚠ ~/.jarvis/auth.json legado (${leftover.email}) — não é usado.${NC}`);
|
|
43
|
-
logger.info(` ${DIM}Remova com: jarvis logout${NC}`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
30
|
logger.info("");
|
|
47
31
|
}
|
package/bin/lib/auth/session.js
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
import { existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
2
1
|
import { execSync } from "node:child_process";
|
|
3
|
-
import {
|
|
4
|
-
import { homedir, userInfo } from "node:os";
|
|
5
|
-
|
|
6
|
-
const SESSION_FILE = join(homedir(), ".jarvis", "auth.json");
|
|
7
|
-
|
|
8
|
-
export function readSession() {
|
|
9
|
-
if (!existsSync(SESSION_FILE)) return null;
|
|
10
|
-
try {
|
|
11
|
-
return JSON.parse(readFileSync(SESSION_FILE, "utf-8"));
|
|
12
|
-
} catch {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function clearSession() {
|
|
18
|
-
if (existsSync(SESSION_FILE)) {
|
|
19
|
-
unlinkSync(SESSION_FILE);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
2
|
+
import { userInfo } from "node:os";
|
|
22
3
|
|
|
23
4
|
/**
|
|
24
5
|
* Resolve local identity without OAuth.
|
|
@@ -47,10 +28,3 @@ export function resolveUser(env = {}) {
|
|
|
47
28
|
|
|
48
29
|
return { id: "local", source: "fallback" };
|
|
49
30
|
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Identity used as dev_id. Never requires jarvis login.
|
|
53
|
-
*/
|
|
54
|
-
export function getAuthUser(env = {}) {
|
|
55
|
-
return resolveUser(env).id;
|
|
56
|
-
}
|
package/bin/lib/cli/program.js
CHANGED
|
@@ -29,6 +29,7 @@ import { docsSessions } from "../../commands/docs-sessions.js";
|
|
|
29
29
|
import { installRtk } from "../../commands/install-rtk.js";
|
|
30
30
|
import { tokens } from "../../commands/tokens.js";
|
|
31
31
|
import { rulesSync } from "../../commands/rules.js";
|
|
32
|
+
import { untrack } from "../../commands/untrack.js";
|
|
32
33
|
import { map } from "../../commands/map.js";
|
|
33
34
|
import { fork } from "../../commands/fork.js";
|
|
34
35
|
import { dailyReport } from "../../commands/daily-report.js";
|
|
@@ -49,7 +50,7 @@ function getVersion() {
|
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Remonta as opções do commander (camelCase) no formato antigo de `flags`
|
|
52
|
-
* que `bin/commands/*.js` espera. `extra` (positionals
|
|
53
|
+
* que `bin/commands/*.js` espera. `extra` (positionals em `_`)
|
|
53
54
|
* é aplicado por último e sempre vence.
|
|
54
55
|
* @param {Record<string, unknown>} options
|
|
55
56
|
* @param {Record<string, unknown>} [extra]
|
|
@@ -123,9 +124,6 @@ export function buildProgram() {
|
|
|
123
124
|
const whoamiCmd = cmd(program, "whoami").description("Exibir identidade (ENV.md / git / SO)");
|
|
124
125
|
withEnvOptions(withLogOptions(whoamiCmd)).action((options) => whoami(toLegacyFlags(options)));
|
|
125
126
|
|
|
126
|
-
const logoutCmd = cmd(program, "logout").description("Remover auth.json legado");
|
|
127
|
-
withLogOptions(logoutCmd).action((options) => whoami(toLegacyFlags(options, { logout: true })));
|
|
128
|
-
|
|
129
127
|
const docs = cmd(program, "docs").description("Sincronizar ou publicar documentação");
|
|
130
128
|
|
|
131
129
|
const docsSyncCmd = cmd(docs, "sync").description(
|
|
@@ -239,10 +237,6 @@ export function buildProgram() {
|
|
|
239
237
|
|
|
240
238
|
cmd(program, "tokens")
|
|
241
239
|
.description("Estimar o que carrega no início da sessão")
|
|
242
|
-
.option("--hub <hub>")
|
|
243
|
-
.option("--position <position>")
|
|
244
|
-
.option("--area <area>")
|
|
245
|
-
.option("--squad <squad>")
|
|
246
240
|
.option("--artifact-style <estilo>", "ai-generated ou human-generated (padrão: lido do ENV.md)")
|
|
247
241
|
.option("--rtk", "Força RTK ligado (padrão: lido do ENV.md)")
|
|
248
242
|
.option("--json", "Saída em JSON")
|
|
@@ -252,12 +246,21 @@ export function buildProgram() {
|
|
|
252
246
|
|
|
253
247
|
const rules = cmd(program, "rules").description("Rules da pasta da IDE");
|
|
254
248
|
const rulesSyncCmd = cmd(rules, "sync").description(
|
|
255
|
-
"
|
|
249
|
+
"Sincronizar rules/ e rules-on-demand/ da IDE com o ENV.md (Passo 8 do /jarvis-init)"
|
|
256
250
|
);
|
|
257
251
|
withEnvOptions(withLogOptions(rulesSyncCmd)).action((options) =>
|
|
258
252
|
rulesSync(toLegacyFlags(options))
|
|
259
253
|
);
|
|
260
254
|
|
|
255
|
+
const untrackCmd = cmd(program, "untrack")
|
|
256
|
+
.description(
|
|
257
|
+
"Tirar AGENTS.md/CLAUDE.md versionados do índice do git (git rm --cached), sem apagar o arquivo e sem commit; a pergunta é do /jarvis-init upgrade"
|
|
258
|
+
)
|
|
259
|
+
.argument("<arquivos...>", "AGENTS.md e/ou CLAUDE.md");
|
|
260
|
+
withEnvOptions(withLogOptions(untrackCmd)).action((files, options) =>
|
|
261
|
+
untrack(files, toLegacyFlags(options))
|
|
262
|
+
);
|
|
263
|
+
|
|
261
264
|
cmd(program, "fork")
|
|
262
265
|
.description(
|
|
263
266
|
"Overlay de empresa: copia um artefato do core para $IDE/overlays/{COMPANY_PROFILE}/, com carimbo"
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* @module config/constants
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
/** @constant {string} Nome do pacote NPM */
|
|
7
|
-
export const CLI_NAME = "jarvis-framework";
|
|
8
|
-
|
|
9
6
|
/** @constant {string} Nome do arquivo de lock */
|
|
10
7
|
export const LOCK_FILE = "jarvis-lock.json";
|
|
11
8
|
|
|
@@ -20,7 +17,6 @@ export const SYNC_DIRS = Object.freeze([
|
|
|
20
17
|
"templates",
|
|
21
18
|
"rules",
|
|
22
19
|
"rules-on-demand",
|
|
23
|
-
"scripts",
|
|
24
20
|
]);
|
|
25
21
|
|
|
26
22
|
/**
|
|
@@ -187,6 +183,97 @@ export const OBSOLETE_PATHS = Object.freeze([
|
|
|
187
183
|
"templates/engineering/swagger-template.md",
|
|
188
184
|
"templates/engineering/CONTACTS-template.md",
|
|
189
185
|
"templates/cdd-aplicado-a-prompts.md",
|
|
186
|
+
// Lote A de código morto (issue #238, mãe #237): template, agente e arquivos de skill sem
|
|
187
|
+
// consumidor. A pasta assets/ do eng-qa-planner saiu inteira (test-coverage-template.md e
|
|
188
|
+
// test-patterns.md). O commands/status.memory.md do product-roadmap-report fica: a regra do skill manda rodá-lo (até a #243, que tirou o skill inteiro).
|
|
189
|
+
"templates/engineering/work-progress-template.md",
|
|
190
|
+
"agents/engineering/qa/eng.qa.quality-champion-task-agent.md",
|
|
191
|
+
"skills/eng-qa-planner/assets",
|
|
192
|
+
"skills/product-roadmap-report/commands/status.compiled.single.team.md",
|
|
193
|
+
"skills/product-roadmap-report/commands/status.list.projects.md",
|
|
194
|
+
// eng.review (issue #245, mãe #237): consolidado no eng.pre-pr (com o eng.frontend-review para
|
|
195
|
+
// interface). O workflow é achatado na pasta de comandos de cada IDE.
|
|
196
|
+
"workflows/eng.review.md",
|
|
197
|
+
"commands/eng.review.md",
|
|
198
|
+
"steering/eng.review.md",
|
|
199
|
+
// eng.docs (issue #246, mãe #237): coberto pela oferta de documentação do eng.work (Fase 6.2) e
|
|
200
|
+
// pelo gate 9 do eng.pre-pr; o skill eng-global-docs-write continua. O workflow é achatado.
|
|
201
|
+
"workflows/eng.docs.md",
|
|
202
|
+
"commands/eng.docs.md",
|
|
203
|
+
"steering/eng.docs.md",
|
|
204
|
+
// eng.create-ard-from-code (issue #247, mãe #237): fundido no eng.create-ard, no modo "Do código existente"
|
|
205
|
+
// (--codigo). O workflow é achatado. O skill de diagramas C4 virou global (eng-backend-arch-c4 → eng-global-arch-c4).
|
|
206
|
+
"workflows/eng.create-ard-from-code.md",
|
|
207
|
+
"commands/eng.create-ard-from-code.md",
|
|
208
|
+
"steering/eng.create-ard-from-code.md",
|
|
209
|
+
"skills/eng-backend-arch-c4",
|
|
210
|
+
"steering/skills/skill-eng-backend-arch-c4.md",
|
|
211
|
+
// eng.breakdown-subtasks (issue #248, mãe #237): fundido no Delivery Spec do eng.build-tech-spec (atalho da
|
|
212
|
+
// Tech Spec pronta, nível "passo a passo" na Fase 7). O workflow é achatado; a rule e o template saem junto.
|
|
213
|
+
"workflows/eng.breakdown-subtasks.md",
|
|
214
|
+
"commands/eng.breakdown-subtasks.md",
|
|
215
|
+
"steering/eng.breakdown-subtasks.md",
|
|
216
|
+
"rules-on-demand/engineering/eng.breakdown-subtasks-rules.md",
|
|
217
|
+
"templates/engineering/breakdown-subtasks-template.md",
|
|
218
|
+
// Cluster DATA (issue #242, mãe #237): os workflows data.contract e data.new-pipeline, o agente
|
|
219
|
+
// eng.data-engineer e os 2 templates não tinham porta de entrada no ciclo eng.*; a área data fica
|
|
220
|
+
// com o skill eng-data. Os workflows são achatados. Só o arquivo do agente sai: a pasta
|
|
221
|
+
// agents/engineering/data/ fica vazia na IDE, sem apagar o que a empresa tenha posto lá.
|
|
222
|
+
"workflows/engineering/data/data.contract.md",
|
|
223
|
+
"workflows/data.contract.md",
|
|
224
|
+
"commands/data.contract.md",
|
|
225
|
+
"steering/data.contract.md",
|
|
226
|
+
"workflows/engineering/data/data.new-pipeline.md",
|
|
227
|
+
"workflows/data.new-pipeline.md",
|
|
228
|
+
"commands/data.new-pipeline.md",
|
|
229
|
+
"steering/data.new-pipeline.md",
|
|
230
|
+
"agents/engineering/data/eng.data-engineer.agent.md",
|
|
231
|
+
"templates/engineering/data-contract-template.md",
|
|
232
|
+
"templates/engineering/data-pipeline-template.md",
|
|
233
|
+
// prod.roadmap.preview e product-roadmap-report (issue #243, mãe #237): o par só chamava um ao outro,
|
|
234
|
+
// dependia de Obsidian e de .claude/status.memory/ e não tinha uso. O workflow é achatado; a pasta do skill sai inteira.
|
|
235
|
+
"workflows/prod.roadmap.preview.md",
|
|
236
|
+
"commands/prod.roadmap.preview.md",
|
|
237
|
+
"steering/prod.roadmap.preview.md",
|
|
238
|
+
"skills/product-roadmap-report",
|
|
239
|
+
"steering/skills/skill-product-roadmap-report.md",
|
|
240
|
+
// product-specs e product-specs-update (issue #244, mãe #237): skills sem chamador. O roteamento para os
|
|
241
|
+
// prod.spec.* fica no /prod.spec, e a cascata PRD↔FRD não era executada por nenhum comando. No Kiro, o
|
|
242
|
+
// skill vira steering/skills/skill-{nome}.md.
|
|
243
|
+
"skills/product-specs",
|
|
244
|
+
"skills/product-specs-update",
|
|
245
|
+
"steering/skills/skill-product-specs.md",
|
|
246
|
+
"steering/skills/skill-product-specs-update.md",
|
|
247
|
+
// Cluster QA fora do ciclo (issue #241, mãe #237): os 3 comandos só citavam uns aos outros. O workflow é
|
|
248
|
+
// achatado; o agente e os 2 templates saem pelo caminho normal. O Modo A do eng.qa.test-planner continua
|
|
249
|
+
// por chamada direta. O cadastro de membros da raiz não entra aqui: saiu do SYNC_ROOT_FILES, e a cópia
|
|
250
|
+
// instalada é do usuário (pode ter dados do time).
|
|
251
|
+
"workflows/eng.qa-refinement-entry.md",
|
|
252
|
+
"commands/eng.qa-refinement-entry.md",
|
|
253
|
+
"steering/eng.qa-refinement-entry.md",
|
|
254
|
+
"workflows/eng.qa-release-signoff.md",
|
|
255
|
+
"commands/eng.qa-release-signoff.md",
|
|
256
|
+
"steering/eng.qa-release-signoff.md",
|
|
257
|
+
"workflows/eng.qa-sprint-planning.md",
|
|
258
|
+
"commands/eng.qa-sprint-planning.md",
|
|
259
|
+
"steering/eng.qa-sprint-planning.md",
|
|
260
|
+
"agents/engineering/qa/eng.qa.quality-strategist.md",
|
|
261
|
+
"templates/engineering/qa/qa.release-signoff-template.md",
|
|
262
|
+
"templates/engineering/qa/qa.sprint-plan-template.md",
|
|
263
|
+
// Rules de uma área só saíram de rules/ (issue #263, mãe #237): a de frontend e a de spec de produto
|
|
264
|
+
// foram para rules-on-demand/ e são lidas pelos comandos da área; o ponteiro de Cypress foi apagado (a
|
|
265
|
+
// rule inteira já estava em rules-on-demand/). Entradas de arquivo, para não apagar uma rule própria da
|
|
266
|
+
// pessoa na mesma pasta. No Kiro, a cópia de cada uma em steering/.
|
|
267
|
+
"rules/engineering/frontend/eng.frontend-rules.md",
|
|
268
|
+
"rules/engineering/qa/eng.qa.cypress-standards-rules.md",
|
|
269
|
+
"rules/product/prod.spec-rules.md",
|
|
270
|
+
"steering/eng.frontend-rules.md",
|
|
271
|
+
"steering/eng.qa.cypress-standards-rules.md",
|
|
272
|
+
"steering/prod.spec-rules.md",
|
|
273
|
+
// Tudo de Cypress saiu (issue #263, mãe #237): a rule de rules-on-demand/, que nenhum comando lia, e o
|
|
274
|
+
// agente antigo de Cypress, removido do framework sem entrar aqui.
|
|
275
|
+
"rules-on-demand/engineering/qa/eng.qa.cypress-standards-rules.md",
|
|
276
|
+
"agents/engineering/qa/eng.qa.cypress-specialist.md",
|
|
190
277
|
]);
|
|
191
278
|
|
|
192
279
|
/**
|
|
@@ -208,7 +295,7 @@ export const SYNC_EXCLUDE = Object.freeze({
|
|
|
208
295
|
* Arquivos da raiz que devem ser sincronizados
|
|
209
296
|
* @constant {ReadonlyArray<string>}
|
|
210
297
|
*/
|
|
211
|
-
export const SYNC_ROOT_FILES = Object.freeze(["taxonomy.md", "AGENTS.md"
|
|
298
|
+
export const SYNC_ROOT_FILES = Object.freeze(["taxonomy.md", "AGENTS.md"]);
|
|
212
299
|
|
|
213
300
|
/**
|
|
214
301
|
* Mapeamento de model do Jarvis para formato OpenCode (provider/model-id)
|
|
@@ -216,14 +303,13 @@ export const SYNC_ROOT_FILES = Object.freeze(["taxonomy.md", "AGENTS.md", "membe
|
|
|
216
303
|
*/
|
|
217
304
|
export const OPENCODE_MODEL_MAP = Object.freeze({
|
|
218
305
|
// Anthropic — shorthands usados no Jarvis
|
|
219
|
-
opus: "anthropic/claude-opus-
|
|
220
|
-
sonnet: "anthropic/claude-sonnet-
|
|
221
|
-
haiku: "anthropic/claude-haiku-
|
|
222
|
-
// Anthropic — IDs completos
|
|
306
|
+
opus: "anthropic/claude-opus-5-5",
|
|
307
|
+
sonnet: "anthropic/claude-sonnet-5-5",
|
|
308
|
+
haiku: "anthropic/claude-haiku-5-5",
|
|
309
|
+
// Anthropic — IDs completos com data: normalizados para o ID sem data. Os demais IDs `claude-*`
|
|
310
|
+
// (ex.: claude-sonnet-5) passam direto pelo fallback `anthropic/{id}` de resolveOpenCodeModel.
|
|
223
311
|
"claude-opus-4-6-20250529": "anthropic/claude-opus-4-6",
|
|
224
312
|
"claude-sonnet-4-6-20250514": "anthropic/claude-sonnet-4-6",
|
|
225
|
-
"claude-sonnet-5": "anthropic/claude-sonnet-4-6",
|
|
226
|
-
"claude-haiku-4-5-20250414": "anthropic/claude-haiku-4-5-20250414",
|
|
227
313
|
// OpenAI
|
|
228
314
|
"gpt-4o": "openai/gpt-4o",
|
|
229
315
|
"gpt-4o-mini": "openai/gpt-4o-mini",
|
|
@@ -251,16 +337,3 @@ export const OPENCODE_DEFAULT_PERMISSIONS = Object.freeze({
|
|
|
251
337
|
grep: "allow",
|
|
252
338
|
task: "allow",
|
|
253
339
|
});
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Mapeamento de HUB Jarvis para fileMatchPattern do Kiro
|
|
257
|
-
* Usado para gerar steering files de rules com inclusion: fileMatch
|
|
258
|
-
* @constant {Readonly<Record<string, string>>}
|
|
259
|
-
*/
|
|
260
|
-
export const KIRO_HUB_FILE_PATTERNS = Object.freeze({
|
|
261
|
-
FRONTEND: "**/*.tsx,**/*.ts,**/*.jsx,**/*.js,**/*.css,**/*.scss",
|
|
262
|
-
BACKEND: "**/*.ts,**/*.js",
|
|
263
|
-
QA: "**/*.test.ts,**/*.spec.ts,**/*.cy.ts,**/*.test.js,**/*.spec.js",
|
|
264
|
-
DATA: "**/*.py,**/*.sql,**/*.ipynb",
|
|
265
|
-
AI: "**/*.ts,**/*.py",
|
|
266
|
-
});
|
|
@@ -275,11 +275,3 @@ export function getWorkflowsFolder(ideValue) {
|
|
|
275
275
|
export function getMCPTargets(ideValue) {
|
|
276
276
|
return getIDEConfig(ideValue)?.mcp || [];
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Limpa o cache (útil para testes)
|
|
281
|
-
* @private
|
|
282
|
-
*/
|
|
283
|
-
export function _clearCache() {
|
|
284
|
-
_ideConfigCache = null;
|
|
285
|
-
}
|
|
@@ -150,7 +150,7 @@ export function assertPathsResolved(expanded, keys = PATH_KEYS) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/** Subpasta de cada área dentro do `SESSIONS_DIR`. */
|
|
153
|
-
export const SESSION_AREAS = Object.freeze(["eng", "prod"
|
|
153
|
+
export const SESSION_AREAS = Object.freeze(["eng", "prod"]);
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* O que o `jarvis init` cria para as sessões (#228): a pasta (de `SESSIONS_DIR`, com o padrão
|
|
@@ -177,7 +177,7 @@ export function planSessionsSetup({ workspaceDir, env = {}, isRepo }) {
|
|
|
177
177
|
const underJarvis = inside && (rel === ".jarvis" || rel.startsWith(".jarvis/") || rel.startsWith(".jarvis\\"));
|
|
178
178
|
if (inside && !underJarvis) gitignore.push(`${rel.split("\\").join("/")}/`);
|
|
179
179
|
else if (isRoot) {
|
|
180
|
-
warnings.push(`SESSIONS_DIR (${value}) é a própria raiz do workspace: eng
|
|
180
|
+
warnings.push(`SESSIONS_DIR (${value}) é a própria raiz do workspace: eng/ e prod/ ficam soltas nela e o .gitignore não as cobre.`);
|
|
181
181
|
} else if (!inside) {
|
|
182
182
|
warnings.push(`SESSIONS_DIR (${value}) fora da raiz do repositório: sem entrada no .gitignore para ele.`);
|
|
183
183
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Upgrade do ENV.md (`jarvis init --upgrade`): acrescenta as chaves do template que faltam.
|
|
2
2
|
// Regra: só acrescenta. Nenhuma chave existente muda, preenchida, vazia ou com lista de opções.
|
|
3
3
|
// Exceções declaradas (automáticas): `JARVIS_PROJECT=` vazio recebe o valor oficial do template, e
|
|
4
|
-
// as chaves de REMOVED_KEYS (blocos que saíram do template, #209) são apagadas
|
|
4
|
+
// as chaves de REMOVED_KEYS (blocos e chaves que saíram do template, #209, #239 e #263) são apagadas
|
|
5
|
+
// sem ler o valor, salvo o POSITION, que vira a SENIORITY (#263).
|
|
5
6
|
// As outras exceções (CENTRAL_DOCS_LOCATION e esvaziar o TOKEN_TASK_MANAGER) pedem confirmação
|
|
6
7
|
// e ficam no Upgrade (C) do skill jarvis-init (item 8). Mesmas regras dos itens 3, 4, 8, 9 e 10.
|
|
7
8
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -13,8 +14,20 @@ import { EnvPathError, expandEnvPath } from "./env-paths.js";
|
|
|
13
14
|
|
|
14
15
|
const KEY_LINE = /^([A-Z][A-Z0-9_]*)=(.*)$/;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* SENIORITY nova (#263): vem do cargo antigo (POSITION), que o upgrade apaga, lido sem distinguir
|
|
19
|
+
* maiúsculas nem espaços nas pontas. JUNIOR → junior, PLENO → pleno, outro valor → senior. Sem
|
|
20
|
+
* cargo (ausente, vazio ou a lista de exemplo do template) → vazia, e vira pendência.
|
|
21
|
+
* @param {string | undefined} role
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
function seniorityFromRole(role) {
|
|
25
|
+
const value = (role || "").trim().toUpperCase();
|
|
26
|
+
if (!value || isOptionList(value)) return "";
|
|
27
|
+
if (value === "JUNIOR") return "junior";
|
|
28
|
+
if (value === "PLENO") return "pleno";
|
|
29
|
+
return "senior";
|
|
30
|
+
}
|
|
18
31
|
|
|
19
32
|
/**
|
|
20
33
|
* Lê as chaves do ENV na ordem do arquivo, **incluindo as vazias** (o `loadEnv`
|
|
@@ -35,8 +48,9 @@ function isOptionList(value) {
|
|
|
35
48
|
return /^\[.*\]$/.test(value);
|
|
36
49
|
}
|
|
37
50
|
|
|
38
|
-
// Blocos que saíram do template (#209): o upgrade apaga as chaves e, quando o bloco fica vazio,
|
|
39
|
-
// a moldura dele. Os comentários são os do template na época; moldura diferente fica.
|
|
51
|
+
// Blocos que saíram do template (#209, #239): o upgrade apaga as chaves e, quando o bloco fica vazio,
|
|
52
|
+
// a moldura dele. Os comentários são os do template na época; moldura diferente fica. Na #263 saem só
|
|
53
|
+
// três chaves da moldura "Organização", que fica no ENV.md da pessoa com o SQUAD.
|
|
40
54
|
const REMOVED_BLOCKS = Object.freeze([
|
|
41
55
|
{
|
|
42
56
|
title: "Mensageria (opcional)",
|
|
@@ -79,6 +93,42 @@ const REMOVED_BLOCKS = Object.freeze([
|
|
|
79
93
|
"# URL da instância (self-hosted).",
|
|
80
94
|
],
|
|
81
95
|
},
|
|
96
|
+
{
|
|
97
|
+
title: "Chat / comunicador (opcional)",
|
|
98
|
+
keys: [
|
|
99
|
+
"MESSAGE_COMUNICATOR",
|
|
100
|
+
"MESSAGE_COMUNICATOR_BOT_TOKEN",
|
|
101
|
+
"MESSAGE_COMUNICATOR_SIGNING_SECRET",
|
|
102
|
+
"MESSAGE_COMUNICATOR_APP_TOKEN",
|
|
103
|
+
"ALERTS_CHANNEL",
|
|
104
|
+
],
|
|
105
|
+
comments: [
|
|
106
|
+
"# slack: BOT_TOKEN + SIGNING_SECRET + APP_TOKEN (Socket Mode)",
|
|
107
|
+
"# discord: BOT_TOKEN (Bot) + ALERTS_CHANNEL = ID do canal",
|
|
108
|
+
"# teams: BOT_TOKEN = URL do Incoming Webhook (SIGNING/APP vazios)",
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: "Object storage (opcional)",
|
|
113
|
+
keys: ["OBJECT_STORAGE", "TOKEN_OBJECT_STORAGE"],
|
|
114
|
+
comments: [],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
// #263: a variável só servia à rule de Cypress, que saiu.
|
|
118
|
+
title: "QA / suíte de testes (opcional)",
|
|
119
|
+
keys: ["TEST_FOLDER"],
|
|
120
|
+
comments: [
|
|
121
|
+
"# Caminho relativo à raiz do projeto.",
|
|
122
|
+
"# Cypress E2E: cypress | e2e | tests/e2e",
|
|
123
|
+
"# Unit/integração: tests | test | src/__tests__",
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
// #263: o cargo vira a SENIORITY nova antes de sair (planEnvUpgrade); hub e área não têm substituto.
|
|
128
|
+
title: "Organização (obrigatório — opções vêm do taxonomy.md)",
|
|
129
|
+
keys: ["HUB", "AREA", "POSITION"],
|
|
130
|
+
comments: [],
|
|
131
|
+
},
|
|
82
132
|
]);
|
|
83
133
|
|
|
84
134
|
export const REMOVED_KEYS = Object.freeze(REMOVED_BLOCKS.flatMap((b) => b.keys));
|
|
@@ -105,7 +155,6 @@ const AXES = ["TASK_MANAGER", "VERSION_CONTROL"];
|
|
|
105
155
|
export function planEnvUpgrade(envText, templateText, { workspaceDir } = {}) {
|
|
106
156
|
const env = parseEnvEntries(envText);
|
|
107
157
|
const template = parseEnvEntries(templateText);
|
|
108
|
-
const area = (env.get("AREA") || "").toUpperCase();
|
|
109
158
|
|
|
110
159
|
const added = [];
|
|
111
160
|
const filled = [];
|
|
@@ -116,9 +165,12 @@ export function planEnvUpgrade(envText, templateText, { workspaceDir } = {}) {
|
|
|
116
165
|
if (env.has(key) || REMOVED_KEYS.includes(key)) continue;
|
|
117
166
|
|
|
118
167
|
let value = isOptionList(templateValue) ? "" : templateValue;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
168
|
+
// PROD_MODE nova: sempre perguntada no /jarvis-init upgrade (#263).
|
|
169
|
+
if (key === "PROD_MODE") pending.push("PROD_MODE");
|
|
170
|
+
if (key === "SENIORITY") {
|
|
171
|
+
value = seniorityFromRole(env.get("POSITION"));
|
|
172
|
+
if (value) warnings.push("SENIORITY_DERIVED");
|
|
173
|
+
else pending.push("SENIORITY");
|
|
122
174
|
}
|
|
123
175
|
if (key === "WORKSPACE_MODE" && workspaceDir) {
|
|
124
176
|
const repos = (env.get("WORKSPACE_REPOS") || "")
|