wrxn-reversa 1.8.3 → 1.9.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/bin/reversa.js +2 -0
- package/lib/commands/add-engine.js +2 -1
- package/lib/commands/install.js +10 -2
- package/lib/commands/status.js +1 -0
- package/lib/commands/update.js +8 -1
- package/lib/installer/entry-block.js +10 -6
- package/lib/installer/locale.js +53 -0
- package/lib/installer/policy.js +22 -1
- package/lib/installer/prompts.js +17 -4
- package/lib/installer/writer.js +35 -30
- package/locales/README.md +156 -0
- package/locales/en/agents/reversa/SKILL.md +161 -0
- package/locales/en/agents/reversa/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa/references/checkpoint-guide.md +106 -0
- package/locales/en/agents/reversa/references/state-schema.md +88 -0
- package/locales/en/agents/reversa/references/step-01-first-run.md +64 -0
- package/locales/en/agents/reversa/references/step-02-resume.md +91 -0
- package/locales/en/agents/reversa/references/step-03-specs-organization.md +145 -0
- package/locales/en/agents/reversa/references/step-04-regression-check.md +94 -0
- package/locales/en/agents/reversa-add/SKILL.md +151 -0
- package/locales/en/agents/reversa-add/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-agents-help/SKILL.md +212 -0
- package/locales/en/agents/reversa-agents-help/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-arbiter/SKILL.md +150 -0
- package/locales/en/agents/reversa-arbiter/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-archaeologist/SKILL.md +104 -0
- package/locales/en/agents/reversa-archaeologist/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-archaeologist/references/modules-schema.md +75 -0
- package/locales/en/agents/reversa-architect/SKILL.md +113 -0
- package/locales/en/agents/reversa-architect/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-architect/references/interaction-conventions-template.md +34 -0
- package/locales/en/agents/reversa-arquitetura-3d/SKILL.md +163 -0
- package/locales/en/agents/reversa-arquitetura-3d/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/ARCH_TOUR.md +242 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/CALL_GRAPH_3D.md +217 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/CODE_CITY.md +228 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/DEPENDENCY_GRAPH_3D.md +240 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/ERRORS.md +282 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/LAYER_STACK.md +230 -0
- package/locales/en/agents/reversa-arquitetura-3d/references/THREE_PATTERNS.md +249 -0
- package/locales/en/agents/reversa-audit/SKILL.md +110 -0
- package/locales/en/agents/reversa-audit/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-autonomous/SKILL.md +145 -0
- package/locales/en/agents/reversa-autonomous/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-brainstorm/SKILL.md +142 -0
- package/locales/en/agents/reversa-brainstorm/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-challenger/SKILL.md +132 -0
- package/locales/en/agents/reversa-challenger/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-clarify/SKILL.md +115 -0
- package/locales/en/agents/reversa-clarify/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-code-express/SKILL.md +275 -0
- package/locales/en/agents/reversa-code-express/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-coding/SKILL.md +210 -0
- package/locales/en/agents/reversa-coding/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-curator/SKILL.md +142 -0
- package/locales/en/agents/reversa-curator/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-curator/references/decision-rubric.md +52 -0
- package/locales/en/agents/reversa-curator/references/templates/discard_log.md +37 -0
- package/locales/en/agents/reversa-curator/references/templates/target_business_rules.md +59 -0
- package/locales/en/agents/reversa-data-master/SKILL.md +71 -0
- package/locales/en/agents/reversa-data-master/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-debugger/SKILL.md +189 -0
- package/locales/en/agents/reversa-debugger/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-debugger/references/bug-schema.md +123 -0
- package/locales/en/agents/reversa-debugger/references/bugs-readme-template.md +76 -0
- package/locales/en/agents/reversa-debugger-debate/SKILL.md +85 -0
- package/locales/en/agents/reversa-debugger-debate/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-debugger-debate/references/debate-protocol.md +102 -0
- package/locales/en/agents/reversa-debugger-fix/SKILL.md +180 -0
- package/locales/en/agents/reversa-debugger-fix/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-debugger-graph/SKILL.md +104 -0
- package/locales/en/agents/reversa-debugger-graph/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-decouple/SKILL.md +90 -0
- package/locales/en/agents/reversa-decouple/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-depth-inspection/SKILL.md +111 -0
- package/locales/en/agents/reversa-depth-inspection/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-design-system/SKILL.md +81 -0
- package/locales/en/agents/reversa-design-system/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-designer/SKILL.md +224 -0
- package/locales/en/agents/reversa-designer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-designer/references/paradigm-checklist.md +50 -0
- package/locales/en/agents/reversa-designer/references/templates/data_migration_plan.md +80 -0
- package/locales/en/agents/reversa-designer/references/templates/target_architecture.md +70 -0
- package/locales/en/agents/reversa-designer/references/templates/target_data_model.md +64 -0
- package/locales/en/agents/reversa-designer/references/templates/target_domain_model.md +62 -0
- package/locales/en/agents/reversa-designer/references/templates/topology_decision.md +82 -0
- package/locales/en/agents/reversa-detective/SKILL.md +86 -0
- package/locales/en/agents/reversa-detective/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-docs/SKILL.md +253 -0
- package/locales/en/agents/reversa-docs/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-docs/references/config-schema.json +108 -0
- package/locales/en/agents/reversa-docs/references/expected_sources.yaml +59 -0
- package/locales/en/agents/reversa-docs-analyst/SKILL.md +180 -0
- package/locales/en/agents/reversa-docs-analyst/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-docs-mapper/SKILL.md +170 -0
- package/locales/en/agents/reversa-docs-mapper/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-docs-mapper/references/extraction-policy.md +53 -0
- package/locales/en/agents/reversa-docs-publisher/SKILL.md +337 -0
- package/locales/en/agents/reversa-docs-publisher/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-docs-publisher/references/auxiliary_sources.yaml +27 -0
- package/locales/en/agents/reversa-docs-storyteller/SKILL.md +205 -0
- package/locales/en/agents/reversa-docs-storyteller/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-drafter/SKILL.md +204 -0
- package/locales/en/agents/reversa-drafter/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-especialista-d3/SKILL.md +37 -0
- package/locales/en/agents/reversa-especialista-d3/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-especialista-d3/references/api-core.md +13 -0
- package/locales/en/agents/reversa-especialista-d3/references/interatividade.md +5 -0
- package/locales/en/agents/reversa-especialista-d3/references/layouts-complexos.md +8 -0
- package/locales/en/agents/reversa-explorer/SKILL.md +120 -0
- package/locales/en/agents/reversa-explorer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-extract-soul/SKILL.md +231 -0
- package/locales/en/agents/reversa-extract-soul/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-forward/SKILL.md +249 -0
- package/locales/en/agents/reversa-forward/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-forward-autonomous/SKILL.md +202 -0
- package/locales/en/agents/reversa-forward-autonomous/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-framer/SKILL.md +134 -0
- package/locales/en/agents/reversa-framer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-highcharts-visualizer/SKILL.md +118 -0
- package/locales/en/agents/reversa-highcharts-visualizer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-highcharts-visualizer/references/CHART_CATALOG.md +459 -0
- package/locales/en/agents/reversa-highcharts-visualizer/references/ERRORS.md +102 -0
- package/locales/en/agents/reversa-highcharts-visualizer/references/HIGHCHARTS_PATTERNS.md +343 -0
- package/locales/en/agents/reversa-ideator/SKILL.md +149 -0
- package/locales/en/agents/reversa-ideator/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-image-prompt-json/SKILL.md +210 -0
- package/locales/en/agents/reversa-image-prompt-json/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-image-prompt-json/references/Examples.md +133 -0
- package/locales/en/agents/reversa-inspector/SKILL.md +156 -0
- package/locales/en/agents/reversa-inspector/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-inspector/references/parity-coverage-matrix.md +55 -0
- package/locales/en/agents/reversa-inspector/references/templates/parity_specs.md +78 -0
- package/locales/en/agents/reversa-inspector/references/templates/parity_test.feature +48 -0
- package/locales/en/agents/reversa-migrate/SKILL.md +306 -0
- package/locales/en/agents/reversa-migrate/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-migrate/references/auto-defaults.md +55 -0
- package/locales/en/agents/reversa-migrate/references/expected_legacy_artifacts.yaml +69 -0
- package/locales/en/agents/reversa-migrate/references/handoff-checklist.md +34 -0
- package/locales/en/agents/reversa-migrate/references/templates/ambiguity_log.md +43 -0
- package/locales/en/agents/reversa-migrate/references/templates/handoff.md +92 -0
- package/locales/en/agents/reversa-migrate/references/templates/migration_brief.md +58 -0
- package/locales/en/agents/reversa-migrate/references/templates/pending_decisions.md +36 -0
- package/locales/en/agents/reversa-modularize/SKILL.md +89 -0
- package/locales/en/agents/reversa-modularize/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-n8n/SKILL.md +266 -0
- package/locales/en/agents/reversa-n8n/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-n8n/references/node-catalog.md +245 -0
- package/locales/en/agents/reversa-new/SKILL.md +357 -0
- package/locales/en/agents/reversa-new/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-optimize/SKILL.md +92 -0
- package/locales/en/agents/reversa-optimize/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-paradigm-advisor/SKILL.md +172 -0
- package/locales/en/agents/reversa-paradigm-advisor/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-paradigm-advisor/references/paradigm-catalog.md +101 -0
- package/locales/en/agents/reversa-paradigm-advisor/references/templates/paradigm_decision.md +69 -0
- package/locales/en/agents/reversa-plan/SKILL.md +116 -0
- package/locales/en/agents/reversa-plan/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pre-spec/SKILL.md +143 -0
- package/locales/en/agents/reversa-pre-spec/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing/SKILL.md +185 -0
- package/locales/en/agents/reversa-pricing/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-pricing-advisor/SKILL.md +332 -0
- package/locales/en/agents/reversa-pricing-advisor/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-advisor/references/advisor-schema.json +196 -0
- package/locales/en/agents/reversa-pricing-advisor/references/advisor-template.md +106 -0
- package/locales/en/agents/reversa-pricing-advisor/references/sale-models.md +237 -0
- package/locales/en/agents/reversa-pricing-estimate/SKILL.md +297 -0
- package/locales/en/agents/reversa-pricing-estimate/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-estimate/references/effort-formula.md +146 -0
- package/locales/en/agents/reversa-pricing-estimate/references/estimate-schema.json +141 -0
- package/locales/en/agents/reversa-pricing-estimate/references/estimate-template.md +153 -0
- package/locales/en/agents/reversa-pricing-estimate/references/example-estimate.json +74 -0
- package/locales/en/agents/reversa-pricing-estimate/references/example-estimate.md +88 -0
- package/locales/en/agents/reversa-pricing-estimate/references/market-benchmarks.md +102 -0
- package/locales/en/agents/reversa-pricing-estimate/references/value-formula.md +123 -0
- package/locales/en/agents/reversa-pricing-product/SKILL.md +315 -0
- package/locales/en/agents/reversa-pricing-product/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-product/references/breakeven-formula.md +237 -0
- package/locales/en/agents/reversa-pricing-product/references/product-schema.json +288 -0
- package/locales/en/agents/reversa-pricing-product/references/product-template.md +113 -0
- package/locales/en/agents/reversa-pricing-product/references/store-commissions.md +57 -0
- package/locales/en/agents/reversa-pricing-profile/SKILL.md +407 -0
- package/locales/en/agents/reversa-pricing-profile/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-profile/references/example-profile.json +32 -0
- package/locales/en/agents/reversa-pricing-profile/references/example-profile.md +51 -0
- package/locales/en/agents/reversa-pricing-profile/references/profile-schema.json +227 -0
- package/locales/en/agents/reversa-pricing-profile/references/tax-regimes.md +106 -0
- package/locales/en/agents/reversa-pricing-research/SKILL.md +368 -0
- package/locales/en/agents/reversa-pricing-research/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-research/references/research-policy.md +213 -0
- package/locales/en/agents/reversa-pricing-research/references/research-schema.json +330 -0
- package/locales/en/agents/reversa-pricing-size/SKILL.md +215 -0
- package/locales/en/agents/reversa-pricing-size/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-pricing-size/references/example-size.json +41 -0
- package/locales/en/agents/reversa-pricing-size/references/size-schema.json +120 -0
- package/locales/en/agents/reversa-pricing-size/references/sizing-formula.md +183 -0
- package/locales/en/agents/reversa-principles/SKILL.md +87 -0
- package/locales/en/agents/reversa-principles/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-prune/SKILL.md +97 -0
- package/locales/en/agents/reversa-prune/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-quality/SKILL.md +100 -0
- package/locales/en/agents/reversa-quality/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-reconstructor/SKILL.md +277 -0
- package/locales/en/agents/reversa-reconstructor/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-reconstructor/references/reconstruction-plan-migration-template.md +92 -0
- package/locales/en/agents/reversa-reconstructor/references/reconstruction-plan-template.md +84 -0
- package/locales/en/agents/reversa-refactor/SKILL.md +123 -0
- package/locales/en/agents/reversa-refactor/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-refactor/references/opportunity-schema.md +68 -0
- package/locales/en/agents/reversa-refactor/references/refactor-readme-template.md +35 -0
- package/locales/en/agents/reversa-requirements/SKILL.md +238 -0
- package/locales/en/agents/reversa-requirements/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-researcher/SKILL.md +146 -0
- package/locales/en/agents/reversa-researcher/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-restructure/SKILL.md +90 -0
- package/locales/en/agents/reversa-restructure/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-resume/SKILL.md +151 -0
- package/locales/en/agents/reversa-resume/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-reviewer/SKILL.md +158 -0
- package/locales/en/agents/reversa-reviewer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-reviewer/references/confidence-report-template.md +73 -0
- package/locales/en/agents/reversa-reviewer/references/confidence-rules.md +67 -0
- package/locales/en/agents/reversa-reviewer/references/questions-template.md +74 -0
- package/locales/en/agents/reversa-router/SKILL.md +144 -0
- package/locales/en/agents/reversa-router/agents/openai.yaml +3 -0
- package/locales/en/agents/reversa-scout/SKILL.md +94 -0
- package/locales/en/agents/reversa-scout/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-scout/references/surface-schema.md +102 -0
- package/locales/en/agents/reversa-screen-translator/SKILL.md +306 -0
- package/locales/en/agents/reversa-screen-translator/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-screen-translator/references/adapter-pairs.md +102 -0
- package/locales/en/agents/reversa-screen-translator/references/platform-detection.md +73 -0
- package/locales/en/agents/reversa-screen-translator/references/templates/golden_manifest.yaml +62 -0
- package/locales/en/agents/reversa-screen-translator/references/templates/inventory.schema.json +142 -0
- package/locales/en/agents/reversa-screen-translator/references/templates/screen_deviation_log.md +66 -0
- package/locales/en/agents/reversa-screen-translator/references/templates/screen_modernization_decision.md +108 -0
- package/locales/en/agents/reversa-screen-translator/references/templates/target_screens.md +249 -0
- package/locales/en/agents/reversa-selo-generativo/SKILL.md +176 -0
- package/locales/en/agents/reversa-selo-generativo/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-selo-generativo/references/ERRORS.md +206 -0
- package/locales/en/agents/reversa-selo-generativo/references/GENERATIVE_PATTERNS.md +365 -0
- package/locales/en/agents/reversa-selo-generativo/references/PALETTE_BY_STYLE.md +176 -0
- package/locales/en/agents/reversa-simplify/SKILL.md +91 -0
- package/locales/en/agents/reversa-simplify/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-spec-sdd/SKILL.md +288 -0
- package/locales/en/agents/reversa-spec-sdd/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-spec-sdd/assets/spec_examples.md +159 -0
- package/locales/en/agents/reversa-spec-sdd/references/evaluation_rubric.md +113 -0
- package/locales/en/agents/reversa-spec-sdd/references/sdd_guide.md +124 -0
- package/locales/en/agents/reversa-spec-sdd/references/spec_template.md +231 -0
- package/locales/en/agents/reversa-standardize/SKILL.md +88 -0
- package/locales/en/agents/reversa-standardize/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-strategist/SKILL.md +123 -0
- package/locales/en/agents/reversa-strategist/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-strategist/references/migration-strategies.md +41 -0
- package/locales/en/agents/reversa-strategist/references/templates/cutover_plan.md +60 -0
- package/locales/en/agents/reversa-strategist/references/templates/migration_strategy.md +55 -0
- package/locales/en/agents/reversa-strategist/references/templates/risk_register.md +44 -0
- package/locales/en/agents/reversa-sync/SKILL.md +110 -0
- package/locales/en/agents/reversa-sync/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-to-do/SKILL.md +99 -0
- package/locales/en/agents/reversa-to-do/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-visor/SKILL.md +100 -0
- package/locales/en/agents/reversa-visor/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-writer/SKILL.md +225 -0
- package/locales/en/agents/reversa-writer/agents/openai.yaml +5 -0
- package/locales/en/agents/reversa-writer/references/design-template.md +49 -0
- package/locales/en/agents/reversa-writer/references/requirements-template.md +67 -0
- package/locales/en/agents/reversa-writer/references/tasks-template.md +39 -0
- package/locales/en/templates/config.toml +46 -0
- package/locales/en/templates/config.user.toml +8 -0
- package/locales/en/templates/engines/card.md +43 -0
- package/locales/en/templates/forward/body/actions-template.md +83 -0
- package/locales/en/templates/forward/body/principles-template.md +75 -0
- package/locales/en/templates/forward/body/quality-template.md +103 -0
- package/locales/en/templates/forward/body/requirements-template.md +128 -0
- package/locales/en/templates/forward/body/roadmap-template.md +116 -0
- package/locales/en/templates/forward/hooks.yml +60 -0
- package/locales/en/templates/hooks/README.md +93 -0
- package/locales/en/templates/migration/catalogs/paradigm_catalog.md +101 -0
- package/locales/en/templates/plan.md +65 -0
- package/package.json +3 -2
- package/templates/state.json +1 -0
package/bin/reversa.js
CHANGED
|
@@ -28,7 +28,9 @@ if (!command || command === '--help' || command === '-h') {
|
|
|
28
28
|
|
|
29
29
|
Comandos:
|
|
30
30
|
install Instala o Reversa no projeto atual (todos os agentes)
|
|
31
|
+
Opções: --lang=pt|en idioma das skills e das regras (padrão: pt)
|
|
31
32
|
update Atualiza as skills usando este pacote, sem sobrescrever edições
|
|
33
|
+
Opções: --lang=pt|en converte a instalação para outro idioma
|
|
32
34
|
status Mostra o estado atual da análise
|
|
33
35
|
uninstall Remove o Reversa do projeto
|
|
34
36
|
add-engine Adiciona suporte a uma engine
|
|
@@ -7,6 +7,7 @@ import { loadManifest, saveManifest, indexManifest } from '../installer/manifest
|
|
|
7
7
|
import { applyOrangeTheme, ORANGE_PREFIX } from '../installer/orange-prompts.js';
|
|
8
8
|
import { getPackageInfo } from '../utils/package-info.js';
|
|
9
9
|
import { applyWhenIdle, idlePreview } from '../installer/checkout-guard.js';
|
|
10
|
+
import { resolveSkillsLanguage } from '../installer/locale.js';
|
|
10
11
|
import { applyMirrors, describeSkillLayout, planMirrors, previewMirrors, recordChanges, resolveSkillLayout, resolveSkillsMode, verifySkillLayout } from '../installer/skill-layout.js';
|
|
11
12
|
|
|
12
13
|
export default async function addEngine() {
|
|
@@ -72,7 +73,7 @@ export default async function addEngine() {
|
|
|
72
73
|
previewMirrors(mirrors);
|
|
73
74
|
await applyWhenIdle(projectRoot, preview, chalk, async () => {
|
|
74
75
|
verifySkillLayout(projectRoot, selectedEngines, layout);
|
|
75
|
-
const writer = new Writer(projectRoot);
|
|
76
|
+
const writer = new Writer(projectRoot, { lang: resolveSkillsLanguage([], state) });
|
|
76
77
|
writer.installSkills(installedAgents, layout.canonical);
|
|
77
78
|
writer.applyPlan(native, index);
|
|
78
79
|
|
package/lib/commands/install.js
CHANGED
|
@@ -12,6 +12,7 @@ import { clearTerminalForLogo, renderReversaLogo } from '../utils/banner.js';
|
|
|
12
12
|
|
|
13
13
|
import { getPackageInfo } from '../utils/package-info.js';
|
|
14
14
|
import { applyWhenIdle, idlePreview } from '../installer/checkout-guard.js';
|
|
15
|
+
import { languageName, requestedSkillsLanguage, resolveSkillsLanguage } from '../installer/locale.js';
|
|
15
16
|
import { applyMirrors, describeSkillLayout, planMirrors, previewMirrors, recordChanges, resolveSkillLayout, resolveSkillsMode, verifySkillLayout } from '../installer/skill-layout.js';
|
|
16
17
|
|
|
17
18
|
export default async function install(args) {
|
|
@@ -32,6 +33,7 @@ export default async function install(args) {
|
|
|
32
33
|
const preview = idlePreview(projectRoot, chalk);
|
|
33
34
|
if (!preview) return;
|
|
34
35
|
const mode = resolveSkillsMode(args, preview.state);
|
|
36
|
+
const requestedLanguage = requestedSkillsLanguage(args);
|
|
35
37
|
// Check existing installation
|
|
36
38
|
const existing = checkExistingInstallation(projectRoot);
|
|
37
39
|
if (existing.installed) {
|
|
@@ -61,7 +63,12 @@ export default async function install(args) {
|
|
|
61
63
|
// Collect answers
|
|
62
64
|
let answers;
|
|
63
65
|
try {
|
|
64
|
-
|
|
66
|
+
// An existing installation keeps its language: only `update --lang` converts installed skills.
|
|
67
|
+
const kept = existing.installed ? resolveSkillsLanguage([], existing.state ?? {}) : undefined;
|
|
68
|
+
if (kept && requestedLanguage && requestedLanguage !== kept) {
|
|
69
|
+
console.log(chalk.yellow(` Skills stay in ${languageName(kept)}. Run npx ${getPackageInfo().name} update --lang ${requestedLanguage} to convert this installation.\n`));
|
|
70
|
+
}
|
|
71
|
+
answers = await runInstallPrompts(detectedEngines, { skillsLanguage: kept ?? requestedLanguage });
|
|
65
72
|
} catch (err) {
|
|
66
73
|
if (err.isTtyError || err.message?.includes('cancel')) {
|
|
67
74
|
console.log(chalk.gray('\n Installation cancelled.\n'));
|
|
@@ -80,7 +87,7 @@ export default async function install(args) {
|
|
|
80
87
|
let failed = false;
|
|
81
88
|
if (!await applyWhenIdle(projectRoot, preview, chalk, async () => {
|
|
82
89
|
verifySkillLayout(projectRoot, selectedEngines, layout);
|
|
83
|
-
const writer = new Writer(projectRoot);
|
|
90
|
+
const writer = new Writer(projectRoot, { lang: answers.skills_language });
|
|
84
91
|
|
|
85
92
|
const spinner = ora({ text: 'Installing agents...', color: 'cyan' }).start();
|
|
86
93
|
|
|
@@ -176,6 +183,7 @@ export default async function install(args) {
|
|
|
176
183
|
console.log(` ${chalk.cyan('Project:')} ${answers.project_name}`);
|
|
177
184
|
console.log(` ${chalk.cyan('Engines:')} ${engineNames}`);
|
|
178
185
|
console.log(` ${chalk.cyan('Version:')} ${version}`);
|
|
186
|
+
console.log(` ${chalk.cyan('Skills:')} ${languageName(answers.skills_language)}`);
|
|
179
187
|
console.log('');
|
|
180
188
|
console.log(chalk.bold(' Agents installed:'));
|
|
181
189
|
console.log(` ${chalk.cyan('Discovery Team:')} ${discoveryInstalled.length} agent(s)`);
|
package/lib/commands/status.js
CHANGED
|
@@ -23,6 +23,7 @@ export default async function status(args) {
|
|
|
23
23
|
console.log(` Current phase: ${chalk.cyan(state.phase || 'Not started')}`);
|
|
24
24
|
console.log(` Chat language: ${chalk.cyan(state.chat_language || 'pt-br')}`);
|
|
25
25
|
console.log(` Docs language: ${chalk.cyan(state.doc_language || 'pt-br')}`);
|
|
26
|
+
console.log(` Skills language: ${chalk.cyan(state.skills_language || 'pt')}`);
|
|
26
27
|
|
|
27
28
|
if (state.completed?.length > 0) {
|
|
28
29
|
console.log(`\n Completed: ${state.completed.map(f => chalk.hex('#ffa203')('✓ ' + f)).join(', ')}`);
|
package/lib/commands/update.js
CHANGED
|
@@ -11,6 +11,7 @@ import { planImpeccableAgents } from '../installer/impeccable-agents.js';
|
|
|
11
11
|
import { applyOrangeTheme, ORANGE_PREFIX } from '../installer/orange-prompts.js';
|
|
12
12
|
import { getPackageInfo } from '../utils/package-info.js';
|
|
13
13
|
import { applyWhenIdle, idlePreview } from '../installer/checkout-guard.js';
|
|
14
|
+
import { languageName, resolveSkillsLanguage } from '../installer/locale.js';
|
|
14
15
|
import { applyMirrors, describeSkillLayout, planMirrors, previewMirrors, recordChanges, resolveSkillLayout, resolveSkillsMode, verifySkillLayout } from '../installer/skill-layout.js';
|
|
15
16
|
|
|
16
17
|
async function fetchLatestVersion(packageName) {
|
|
@@ -53,6 +54,8 @@ export default async function update(args) {
|
|
|
53
54
|
}
|
|
54
55
|
const { state, version: installedVersion } = existing;
|
|
55
56
|
const mode = resolveSkillsMode(args, state);
|
|
57
|
+
const lang = resolveSkillsLanguage(args, state);
|
|
58
|
+
const previousLang = resolveSkillsLanguage([], state);
|
|
56
59
|
if (!semver.valid(installedVersion) || semver.gt(installedVersion, version)) {
|
|
57
60
|
console.log(chalk.yellow(` Cannot update v${installedVersion} using ${name}@${version}.`));
|
|
58
61
|
return;
|
|
@@ -65,6 +68,9 @@ export default async function update(args) {
|
|
|
65
68
|
spinner.stop();
|
|
66
69
|
console.log(` Installed: ${state.package_name ?? upstreamName}@${installedVersion}`);
|
|
67
70
|
console.log(` Update source: ${name}@${version} (running package)`);
|
|
71
|
+
console.log(lang === previousLang
|
|
72
|
+
? ` Skills language: ${languageName(lang)}`
|
|
73
|
+
: ` Skills language: ${languageName(previousLang)} → ${languageName(lang)} (edited files stay as they are)`);
|
|
68
74
|
if (semver.valid(latest) && semver.gt(latest, version)) {
|
|
69
75
|
console.log(` A newer bundle is available: npx ${name}@${latest} update`);
|
|
70
76
|
}
|
|
@@ -72,7 +78,7 @@ export default async function update(args) {
|
|
|
72
78
|
const manifest = loadManifest(projectRoot);
|
|
73
79
|
const index = indexManifest(manifest);
|
|
74
80
|
const allAgents = listAllAgents();
|
|
75
|
-
const writer = new Writer(projectRoot);
|
|
81
|
+
const writer = new Writer(projectRoot, { lang });
|
|
76
82
|
const plan = { writes: [], kept: [], removals: [] };
|
|
77
83
|
const add = part => {
|
|
78
84
|
for (const key of Object.keys(plan)) plan[key].push(...part[key]);
|
|
@@ -135,6 +141,7 @@ export default async function update(args) {
|
|
|
135
141
|
failed = counts.failed > 0 || allAgents.some(id => pathState(projectRoot, `${root}/${id}/SKILL.md`) !== 'file');
|
|
136
142
|
state.skill_links = links;
|
|
137
143
|
if (!failed) state.skills_mode = mode;
|
|
144
|
+
state.skills_language = lang;
|
|
138
145
|
saveManifest(projectRoot, manifest);
|
|
139
146
|
state.agents = allAgents;
|
|
140
147
|
state.package_name = name;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from 'fs';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
2
|
import { hashContent } from './manifest.js';
|
|
4
3
|
import { renderPolicyBlock } from './policy.js';
|
|
5
4
|
import { getPackageInfo } from '../utils/package-info.js';
|
|
5
|
+
import { SOURCE_LANGUAGE, localizedPath } from './locale.js';
|
|
6
6
|
|
|
7
|
-
const CARD = fileURLToPath(new URL('../../templates/engines/card.md', import.meta.url));
|
|
8
7
|
const BEGIN = '<!-- reversa:begin';
|
|
9
8
|
const END_MARKER = '<!-- reversa:end -->';
|
|
10
9
|
// Última frase da política: fecha todo bloco gravado antes das marcas (até 1.3.7).
|
|
@@ -18,12 +17,17 @@ const skipNewline = (text, at) => text.startsWith('\r\n', at) ? at + 2 : text[at
|
|
|
18
17
|
export const cardHash = card => hashContent(normalize(card));
|
|
19
18
|
|
|
20
19
|
// Cartão de roteamento renderizado para um destino (ver ENGINES.entry).
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const COMPACT = {
|
|
21
|
+
pt: 'Ao compactar, preserve: skill Reversa ativo, etapa atual, último checkpoint gravado e o próximo passo combinado com o usuário.',
|
|
22
|
+
en: 'When compacting, preserve: the active Reversa skill, the current step, the last recorded checkpoint, and the next step agreed with the user.',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function renderCard(target, { outputFolder, forwardFolder, lang = SOURCE_LANGUAGE } = {}) {
|
|
26
|
+
let card = readFileSync(localizedPath('templates', 'engines/card.md', lang), 'utf8')
|
|
27
|
+
.replace('{{REVERSA_POLICY}}', renderPolicyBlock({ outputFolder, forwardFolder, lang }));
|
|
24
28
|
if (!card.endsWith('\n')) card += '\n';
|
|
25
29
|
if (target.compact) {
|
|
26
|
-
card +=
|
|
30
|
+
card += `\n## Compact Instructions\n\n${COMPACT[lang] ?? COMPACT[SOURCE_LANGUAGE]}\n`;
|
|
27
31
|
}
|
|
28
32
|
if (target.frontmatter === 'alwaysApply') card = `---\nalwaysApply: true\n---\n\n${card}`;
|
|
29
33
|
return card;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Language of the installed skills, routing card, and templates.
|
|
2
|
+
// Portuguese is the source tree (agents/, templates/). Every other language is
|
|
3
|
+
// an overlay under locales/<lang>/ with the same relative paths: a file in the
|
|
4
|
+
// overlay replaces the source file; a file with no overlay is installed as is.
|
|
5
|
+
import { existsSync } from 'fs';
|
|
6
|
+
import { join, resolve, dirname } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
10
|
+
|
|
11
|
+
export const SOURCE_LANGUAGE = 'pt';
|
|
12
|
+
export const SKILL_LANGUAGES = [
|
|
13
|
+
{ id: 'pt', name: 'Português' },
|
|
14
|
+
{ id: 'en', name: 'English' },
|
|
15
|
+
];
|
|
16
|
+
const IDS = new Set(SKILL_LANGUAGES.map(language => language.id));
|
|
17
|
+
|
|
18
|
+
export const languageName = id => SKILL_LANGUAGES.find(language => language.id === id)?.name ?? id;
|
|
19
|
+
|
|
20
|
+
// Language given with --lang or --lang=<id>, or undefined.
|
|
21
|
+
export function requestedSkillsLanguage(args = []) {
|
|
22
|
+
const at = args.findIndex(arg => arg === '--lang' || arg.startsWith('--lang='));
|
|
23
|
+
if (at < 0) return undefined;
|
|
24
|
+
const value = args[at] === '--lang' ? args[at + 1] : args[at].slice('--lang='.length);
|
|
25
|
+
if (!IDS.has(value)) throw new Error(`Invalid --lang value. Expected one of: ${[...IDS].join(', ')}.`);
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// --lang wins; otherwise the language recorded at install time; otherwise the source language.
|
|
30
|
+
export function resolveSkillsLanguage(args = [], state = {}) {
|
|
31
|
+
const flag = requestedSkillsLanguage(args);
|
|
32
|
+
if (Object.hasOwn(state, 'skills_language') && !IDS.has(state.skills_language)) {
|
|
33
|
+
throw new Error(`Invalid skills_language in .reversa/state.json. Expected one of: ${[...IDS].join(', ')}.`);
|
|
34
|
+
}
|
|
35
|
+
return flag ?? state.skills_language ?? SOURCE_LANGUAGE;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Overlay directory of a skill in the given language, or null when there is none.
|
|
39
|
+
export function overlayDir(tree, rel, lang = SOURCE_LANGUAGE, root = REPO_ROOT) {
|
|
40
|
+
if (lang === SOURCE_LANGUAGE) return null;
|
|
41
|
+
const dir = join(root, 'locales', lang, tree, rel);
|
|
42
|
+
return existsSync(dir) ? dir : null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Absolute path of a bundled file in the given language.
|
|
46
|
+
// tree: 'agents' | 'templates'. rel: path inside that tree, with forward slashes.
|
|
47
|
+
export function localizedPath(tree, rel, lang = SOURCE_LANGUAGE, root = REPO_ROOT) {
|
|
48
|
+
if (lang !== SOURCE_LANGUAGE) {
|
|
49
|
+
const overlay = join(root, 'locales', lang, tree, rel);
|
|
50
|
+
if (existsSync(overlay)) return overlay;
|
|
51
|
+
}
|
|
52
|
+
return join(root, tree, rel);
|
|
53
|
+
}
|
package/lib/installer/policy.js
CHANGED
|
@@ -26,7 +26,19 @@ export function getWritableFolders({
|
|
|
26
26
|
|
|
27
27
|
// Parágrafo padrão da política configurável de edição do legado (spec
|
|
28
28
|
// legacy-code-edition, RF-08). Introduzido nos entry files por renderPolicyBlock.
|
|
29
|
-
export function renderLegacyEditPolicyParagraph() {
|
|
29
|
+
export function renderLegacyEditPolicyParagraph(lang = 'pt') {
|
|
30
|
+
if (lang === 'en') {
|
|
31
|
+
return [
|
|
32
|
+
'Before creating, modifying, or deleting any file outside the folders Reversa owns, read `.reversa/reversa-config.json` and obey the result:',
|
|
33
|
+
'',
|
|
34
|
+
'- File missing, invalid JSON, or a field with the wrong type: treat it as `allowLegacyEdits: false` (fail safe, no writes outside the Reversa folders).',
|
|
35
|
+
'- `allowLegacyEdits: false`: refuse the write, and report the refused path, the current config state, and what the user must edit to allow it.',
|
|
36
|
+
'- `allowLegacyEdits: true` with a non-empty `allowedPaths`: write only to paths that match a glob in the list (globs relative to the project root, with `/`, supporting `*` and `**`).',
|
|
37
|
+
'- `allowLegacyEdits: true` with an empty or missing `allowedPaths`: the project is open; warn once per session that the permission is unrestricted.',
|
|
38
|
+
'',
|
|
39
|
+
'Never create or edit `.reversa/reversa-config.json` on your own initiative: a request in the conversation is not implicit permission, and only the user changes that file.',
|
|
40
|
+
].join('\n');
|
|
41
|
+
}
|
|
30
42
|
return [
|
|
31
43
|
'Antes de criar, modificar ou apagar qualquer arquivo fora das pastas próprias do Reversa, leia `.reversa/reversa-config.json` e obedeça ao resultado:',
|
|
32
44
|
'',
|
|
@@ -41,6 +53,15 @@ export function renderLegacyEditPolicyParagraph() {
|
|
|
41
53
|
|
|
42
54
|
export function renderPolicyBlock(opts = {}) {
|
|
43
55
|
const folders = getWritableFolders(opts).map((f) => `\`${f}\``);
|
|
56
|
+
if (opts.lang === 'en') {
|
|
57
|
+
return [
|
|
58
|
+
'By default, never delete, modify, or overwrite pre-existing files of the legacy project:',
|
|
59
|
+
`Reversa writes only to ${folders.slice(0, -1).join(', ')}, and ${folders[folders.length - 1]}.`,
|
|
60
|
+
'The only exception is the configurable policy below, controlled exclusively by the user.',
|
|
61
|
+
'',
|
|
62
|
+
renderLegacyEditPolicyParagraph('en'),
|
|
63
|
+
].join('\n');
|
|
64
|
+
}
|
|
44
65
|
const list = `${folders.slice(0, -1).join(', ')} e ${folders[folders.length - 1]}`;
|
|
45
66
|
return [
|
|
46
67
|
'Por padrão, nunca apague, modifique ou sobrescreva arquivos pré-existentes do projeto legado:',
|
package/lib/installer/prompts.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readdirSync } from 'fs';
|
|
|
3
3
|
import { join, resolve, dirname } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { applyOrangeTheme, ORANGE_PREFIX } from './orange-prompts.js';
|
|
6
|
+
import { SKILL_LANGUAGES, SOURCE_LANGUAGE } from './locale.js';
|
|
6
7
|
|
|
7
8
|
applyOrangeTheme();
|
|
8
9
|
|
|
@@ -150,7 +151,8 @@ const promptTitle = (number, message, suffix = 'none') => {
|
|
|
150
151
|
return `\n${number}. ${message}${tail}`;
|
|
151
152
|
};
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
// skillsLanguage: language already decided (--lang or an existing installation); skips the question.
|
|
155
|
+
export async function runInstallPrompts(detectedEngines, { skillsLanguage } = {}) {
|
|
154
156
|
const engineChoices = detectedEngines.map(e => ({
|
|
155
157
|
name: `${e.name}${e.star ? ' (recommended)' : ''}`,
|
|
156
158
|
value: e.id,
|
|
@@ -197,18 +199,28 @@ export async function runInstallPrompts(detectedEngines) {
|
|
|
197
199
|
message: promptTitle(5, 'Language for generated documents and specs:'),
|
|
198
200
|
default: 'Português',
|
|
199
201
|
},
|
|
202
|
+
{
|
|
203
|
+
...P,
|
|
204
|
+
type: 'list',
|
|
205
|
+
name: 'skills_language',
|
|
206
|
+
message: promptTitle(6, 'Language of the installed skills and agent rules (AGENTS.md, CLAUDE.md):', 'list'),
|
|
207
|
+
loop: false,
|
|
208
|
+
when: () => !skillsLanguage,
|
|
209
|
+
default: SOURCE_LANGUAGE,
|
|
210
|
+
choices: SKILL_LANGUAGES.map(language => ({ name: language.name, value: language.id })),
|
|
211
|
+
},
|
|
200
212
|
{
|
|
201
213
|
...P,
|
|
202
214
|
type: 'input',
|
|
203
215
|
name: 'output_folder',
|
|
204
|
-
message: promptTitle(
|
|
216
|
+
message: promptTitle(7, 'Output folder for specs:'),
|
|
205
217
|
default: '_reversa_sdd',
|
|
206
218
|
},
|
|
207
219
|
{
|
|
208
220
|
...P,
|
|
209
221
|
type: 'list',
|
|
210
222
|
name: 'git_strategy',
|
|
211
|
-
message: promptTitle(
|
|
223
|
+
message: promptTitle(8, 'How to handle artifacts in git?', 'list'),
|
|
212
224
|
loop: false,
|
|
213
225
|
choices: [
|
|
214
226
|
{ name: 'Commit with the project (recommended for teams)', value: 'commit' },
|
|
@@ -219,7 +231,7 @@ export async function runInstallPrompts(detectedEngines) {
|
|
|
219
231
|
...P,
|
|
220
232
|
type: 'list',
|
|
221
233
|
name: 'answer_mode',
|
|
222
|
-
message: promptTitle(
|
|
234
|
+
message: promptTitle(9, 'How do you prefer to answer agent questions?', 'list'),
|
|
223
235
|
loop: false,
|
|
224
236
|
choices: [
|
|
225
237
|
{ name: 'In the chat (faster)', value: 'chat' },
|
|
@@ -231,6 +243,7 @@ export async function runInstallPrompts(detectedEngines) {
|
|
|
231
243
|
// Todos os agentes são sempre instalados, sem seleção
|
|
232
244
|
return {
|
|
233
245
|
...answers,
|
|
246
|
+
skills_language: skillsLanguage ?? answers.skills_language ?? SOURCE_LANGUAGE,
|
|
234
247
|
agents: listAllAgents(),
|
|
235
248
|
};
|
|
236
249
|
}
|
package/lib/installer/writer.js
CHANGED
|
@@ -12,6 +12,7 @@ import { getPackageInfo } from '../utils/package-info.js';
|
|
|
12
12
|
import { renderCard, renderBlock, cardHash, findBlock, findLegacyBlock, upsertBlock, removeRange } from './entry-block.js';
|
|
13
13
|
import { hashFile, hashContent, normalizeRel, isUnder } from './manifest.js';
|
|
14
14
|
import { isSafeRel, pathState, walkTree, classifyTarget, matchesBaseline, pruneEmpty } from './reconcile.js';
|
|
15
|
+
import { SOURCE_LANGUAGE, localizedPath, overlayDir } from './locale.js';
|
|
15
16
|
|
|
16
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
18
|
const REPO_ROOT = resolve(__dirname, '..', '..');
|
|
@@ -24,13 +25,20 @@ function placeEntryBlock(file, text, block, range) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export class Writer {
|
|
27
|
-
|
|
28
|
+
// lang: language of the installed skills, card, and templates (see locale.js).
|
|
29
|
+
constructor(projectRoot, { lang = SOURCE_LANGUAGE } = {}) {
|
|
28
30
|
this.projectRoot = projectRoot;
|
|
31
|
+
this.lang = lang;
|
|
29
32
|
this.createdFiles = []; // dirs + files — used by uninstall via state.json
|
|
30
33
|
this.manifestPaths = []; // files only — used to build SHA-256 manifest
|
|
31
34
|
this.entryBlocks = {}; // arquivo → { mode, sha256 } dos blocos com marcas
|
|
32
35
|
}
|
|
33
36
|
|
|
37
|
+
// Reads a bundled template in the installation language.
|
|
38
|
+
_template(rel) {
|
|
39
|
+
return readFileSync(localizedPath('templates', rel, this.lang), 'utf8');
|
|
40
|
+
}
|
|
41
|
+
|
|
34
42
|
// Normalises an absolute path to project-relative
|
|
35
43
|
_rel(absPath) {
|
|
36
44
|
return absPath
|
|
@@ -92,16 +100,18 @@ export class Writer {
|
|
|
92
100
|
const rel = `${root}/${id}`;
|
|
93
101
|
const type = pathState(this.projectRoot, rel);
|
|
94
102
|
if (!existsSync(join(src, 'SKILL.md'))) throw new Error(`Skill not found in the package: ${id}.`);
|
|
95
|
-
if (type === 'missing') pending.push({ src, rel });
|
|
103
|
+
if (type === 'missing') pending.push({ id, src, rel });
|
|
96
104
|
else if (type !== 'dir' || pathState(this.projectRoot, `${rel}/SKILL.md`) !== 'file') {
|
|
97
105
|
throw new Error(`Cannot install ${rel}: existing path is not a usable skill.`);
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
|
-
for (const { src, rel } of pending) {
|
|
108
|
+
for (const { id, src, rel } of pending) {
|
|
101
109
|
if (pathState(this.projectRoot, rel) !== 'missing') throw new Error(`Cannot install ${rel}: path changed during installation.`);
|
|
102
110
|
const dest = join(this.projectRoot, rel);
|
|
103
111
|
this._mkdir(dirname(dest));
|
|
104
112
|
cpSync(src, dest, { recursive: true, force: false, errorOnExist: true });
|
|
113
|
+
const overlay = overlayDir('agents', id, this.lang);
|
|
114
|
+
if (overlay) cpSync(overlay, dest, { recursive: true, force: true });
|
|
105
115
|
this._restoreExecutables(join(dest, 'scripts'));
|
|
106
116
|
this._register(dest);
|
|
107
117
|
this._registerFilesInDir(dest);
|
|
@@ -122,7 +132,7 @@ export class Writer {
|
|
|
122
132
|
// Grava o cartão de roteamento num destino (ver ENGINES.entry).
|
|
123
133
|
// records: state.entry_blocks já gravado (guarda a resposta "Skip").
|
|
124
134
|
async installEntryTarget(target, opts = {}, records = {}) {
|
|
125
|
-
const card = renderCard(target, opts);
|
|
135
|
+
const card = renderCard(target, { ...opts, lang: this.lang });
|
|
126
136
|
const destPath = join(this.projectRoot, target.file);
|
|
127
137
|
const exists = existsSync(destPath);
|
|
128
138
|
|
|
@@ -195,6 +205,7 @@ export class Writer {
|
|
|
195
205
|
state.user_name = answers.user_name;
|
|
196
206
|
state.chat_language = answers.chat_language;
|
|
197
207
|
state.doc_language = answers.doc_language;
|
|
208
|
+
state.skills_language = this.lang;
|
|
198
209
|
state.answer_mode = answers.answer_mode;
|
|
199
210
|
state.output_folder = answers.output_folder;
|
|
200
211
|
state.engines = answers.engines;
|
|
@@ -204,7 +215,7 @@ export class Writer {
|
|
|
204
215
|
this._writeNew(statePath, JSON.stringify(state, null, 2));
|
|
205
216
|
|
|
206
217
|
// config.toml — rendered with actual selections
|
|
207
|
-
const configTemplate =
|
|
218
|
+
const configTemplate = this._template('config.toml');
|
|
208
219
|
const agentsList = answers.agents.map(a => ` "${a}"`).join(',\n');
|
|
209
220
|
const enginesList = answers.engines.map(e => ` "${e}"`).join(',\n');
|
|
210
221
|
const config = configTemplate
|
|
@@ -221,11 +232,10 @@ export class Writer {
|
|
|
221
232
|
.replace('answer_mode = "chat"', `answer_mode = "${answers.answer_mode}"`);
|
|
222
233
|
|
|
223
234
|
this._writeNew(join(reversaDir, 'config.toml'), config);
|
|
224
|
-
this._writeNew(join(reversaDir, 'config.user.toml'),
|
|
225
|
-
readFileSync(join(TEMPLATES_DIR, 'config.user.toml'), 'utf8'));
|
|
235
|
+
this._writeNew(join(reversaDir, 'config.user.toml'), this._template('config.user.toml'));
|
|
226
236
|
|
|
227
237
|
// plan.md
|
|
228
|
-
const planTemplate =
|
|
238
|
+
const planTemplate = this._template('plan.md');
|
|
229
239
|
const plan = planTemplate
|
|
230
240
|
.replace('{{PROJECT}}', answers.project_name)
|
|
231
241
|
.replace('{{DATE}}', new Date().toISOString().split('T')[0]);
|
|
@@ -256,7 +266,7 @@ export class Writer {
|
|
|
256
266
|
const srcFile = join(bodySrc, file);
|
|
257
267
|
const destFile = join(bodyDest, file);
|
|
258
268
|
if (statSync(srcFile).isFile() && !existsSync(destFile)) {
|
|
259
|
-
writeFileSync(destFile,
|
|
269
|
+
writeFileSync(destFile, this._template(`forward/body/${file}`), 'utf8');
|
|
260
270
|
this._register(destFile);
|
|
261
271
|
}
|
|
262
272
|
}
|
|
@@ -266,7 +276,7 @@ export class Writer {
|
|
|
266
276
|
const hooksSrc = join(forwardSrc, 'hooks.yml');
|
|
267
277
|
const hooksDest = join(reversaDir, 'hooks.yml');
|
|
268
278
|
if (existsSync(hooksSrc) && !existsSync(hooksDest)) {
|
|
269
|
-
writeFileSync(hooksDest,
|
|
279
|
+
writeFileSync(hooksDest, this._template('forward/hooks.yml'), 'utf8');
|
|
270
280
|
this._register(hooksDest);
|
|
271
281
|
}
|
|
272
282
|
|
|
@@ -302,7 +312,7 @@ export class Writer {
|
|
|
302
312
|
for (const file of readdirSync(srcDir)) {
|
|
303
313
|
const srcFile = join(srcDir, file);
|
|
304
314
|
if (!statSync(srcFile).isFile()) continue;
|
|
305
|
-
this._writeNew(join(this.projectRoot, '.reversa', 'hooks', file),
|
|
315
|
+
this._writeNew(join(this.projectRoot, '.reversa', 'hooks', file), this._template(`hooks/${file}`));
|
|
306
316
|
}
|
|
307
317
|
}
|
|
308
318
|
|
|
@@ -343,7 +353,7 @@ export class Writer {
|
|
|
343
353
|
if (!leaf.regular) continue;
|
|
344
354
|
const rel = `${destRel}/${leaf.rel}`;
|
|
345
355
|
bundled.add(rel);
|
|
346
|
-
const srcFile =
|
|
356
|
+
const srcFile = localizedPath('agents', `${agentId}/${leaf.rel}`, this.lang);
|
|
347
357
|
const decision = classifyTarget(this.projectRoot, rel, index, hashFile(srcFile));
|
|
348
358
|
if (decision.action === 'write') {
|
|
349
359
|
plan.writes.push({
|
|
@@ -381,15 +391,12 @@ export class Writer {
|
|
|
381
391
|
const forwardSrc = join(TEMPLATES_DIR, 'forward');
|
|
382
392
|
if (!existsSync(forwardSrc)) return plan;
|
|
383
393
|
|
|
394
|
+
// [template path inside templates/, project-relative destination]
|
|
384
395
|
const pairs = [];
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (statSync(srcFile).isFile()) pairs.push([srcFile, `${destRel}/${file}`]);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
collect(join(forwardSrc, 'body'), '.reversa/templates');
|
|
396
|
+
const bodySrc = join(forwardSrc, 'body');
|
|
397
|
+
for (const file of existsSync(bodySrc) ? readdirSync(bodySrc) : []) {
|
|
398
|
+
if (statSync(join(bodySrc, file)).isFile()) pairs.push([`forward/body/${file}`, `.reversa/templates/${file}`]);
|
|
399
|
+
}
|
|
393
400
|
for (const [flavor, extension] of [['sh', 'sh'], ['ps', 'ps1']]) {
|
|
394
401
|
const ownerDir = `.reversa/scripts/${flavor}`;
|
|
395
402
|
for (const name of ['bind-to-extraction', 'prepare-roadmap', 'verify-prerequisites']) {
|
|
@@ -405,10 +412,10 @@ export class Writer {
|
|
|
405
412
|
}
|
|
406
413
|
}
|
|
407
414
|
const hooksSrc = join(forwardSrc, 'hooks.yml');
|
|
408
|
-
if (existsSync(hooksSrc)) pairs.push([
|
|
415
|
+
if (existsSync(hooksSrc)) pairs.push(['forward/hooks.yml', '.reversa/hooks.yml']);
|
|
409
416
|
|
|
410
|
-
for (const [
|
|
411
|
-
this._planContent(plan, rel,
|
|
417
|
+
for (const [template, rel] of pairs) {
|
|
418
|
+
this._planContent(plan, rel, this._template(template), index);
|
|
412
419
|
}
|
|
413
420
|
return plan;
|
|
414
421
|
}
|
|
@@ -419,7 +426,7 @@ export class Writer {
|
|
|
419
426
|
planEntryTargets(targets, opts, index, records = {}) {
|
|
420
427
|
const plan = this._emptyPlan();
|
|
421
428
|
for (const target of targets) {
|
|
422
|
-
const card = renderCard(target, opts);
|
|
429
|
+
const card = renderCard(target, { ...opts, lang: this.lang });
|
|
423
430
|
if (target.kind === 'owned') this._planContent(plan, target.file, card, index);
|
|
424
431
|
else this._planBlock(plan, target, card, index, records);
|
|
425
432
|
if (target.legacyFile) this._planLegacy(plan, target.legacyFile, index);
|
|
@@ -496,18 +503,16 @@ export class Writer {
|
|
|
496
503
|
planPolicyAssets() {
|
|
497
504
|
const plan = this._emptyPlan();
|
|
498
505
|
const pairs = [];
|
|
499
|
-
|
|
500
|
-
if (existsSync(configSrc)) pairs.push([configSrc, '.reversa/reversa-config.json']);
|
|
506
|
+
if (existsSync(join(TEMPLATES_DIR, 'reversa-config.json'))) pairs.push(['reversa-config.json', '.reversa/reversa-config.json']);
|
|
501
507
|
const hooksDir = join(TEMPLATES_DIR, 'hooks');
|
|
502
508
|
if (existsSync(hooksDir)) {
|
|
503
509
|
for (const file of readdirSync(hooksDir)) {
|
|
504
|
-
|
|
505
|
-
if (statSync(srcFile).isFile()) pairs.push([srcFile, `.reversa/hooks/${file}`]);
|
|
510
|
+
if (statSync(join(hooksDir, file)).isFile()) pairs.push([`hooks/${file}`, `.reversa/hooks/${file}`]);
|
|
506
511
|
}
|
|
507
512
|
}
|
|
508
|
-
for (const [
|
|
513
|
+
for (const [template, rel] of pairs) {
|
|
509
514
|
if (pathState(this.projectRoot, rel) === 'missing') {
|
|
510
|
-
plan.writes.push({ rel, reason: 'new', content:
|
|
515
|
+
plan.writes.push({ rel, reason: 'new', content: this._template(template) });
|
|
511
516
|
}
|
|
512
517
|
}
|
|
513
518
|
return plan;
|