@jaimevalasek/aioson 1.5.1 → 1.7.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/CHANGELOG.md +49 -0
- package/README.md +729 -226
- package/docs/design-previews/aurora-command-ui-website.html +884 -0
- package/docs/design-previews/aurora-command-ui.html +682 -0
- package/docs/design-previews/bold-editorial-ui-website.html +658 -0
- package/docs/design-previews/bold-editorial-ui.html +717 -0
- package/docs/design-previews/clean-saas-ui-website.html +1202 -0
- package/docs/design-previews/clean-saas-ui.html +549 -0
- package/docs/design-previews/cognitive-core-ui-website.html +1009 -0
- package/docs/design-previews/cognitive-core-ui.html +463 -0
- package/docs/design-previews/glassmorphism-ui-website.html +572 -0
- package/docs/design-previews/glassmorphism-ui.html +886 -0
- package/docs/design-previews/index.html +699 -0
- package/docs/design-previews/interface-design-website.html +1187 -0
- package/docs/design-previews/interface-design.html +513 -0
- package/docs/design-previews/neo-brutalist-ui-website.html +621 -0
- package/docs/design-previews/neo-brutalist-ui.html +797 -0
- package/docs/design-previews/premium-command-center-ui-website.html +1217 -0
- package/docs/design-previews/premium-command-center-ui.html +552 -0
- package/docs/design-previews/pt.squarespace.com-homepage.html +889 -0
- package/docs/design-previews/warm-craft-ui-website.html +684 -0
- package/docs/design-previews/warm-craft-ui.html +739 -0
- package/docs/en/cli-reference.md +20 -9
- package/docs/integrations/sdlc-genius-boundary.md +76 -0
- package/docs/integrations/sdlc-genius-eval-matrix.md +75 -0
- package/docs/integrations/sdlc-genius-install-checklist.md +93 -0
- package/docs/integrations/sdlc-genius-review-samples.md +86 -0
- package/docs/pt/README.md +10 -0
- package/docs/pt/agent-sharding.md +132 -0
- package/docs/pt/agentes.md +9 -2
- package/docs/pt/busca-de-contexto.md +129 -0
- package/docs/pt/cache-de-contexto.md +156 -0
- package/docs/pt/comandos-cli.md +915 -1
- package/docs/pt/design-hybrid-forge.md +356 -0
- package/docs/pt/devlog-pipeline.md +270 -0
- package/docs/pt/fluxo-artefatos.md +178 -0
- package/docs/pt/hooks-session-guard.md +454 -0
- package/docs/pt/inicio-rapido.md +54 -3
- package/docs/pt/inteligencia-adaptativa.md +324 -0
- package/docs/pt/monitor-de-contexto.md +158 -0
- package/docs/pt/recuperacao-de-sessao.md +125 -0
- package/docs/pt/sandbox.md +125 -0
- package/docs/pt/sdd-automation-scripts.md +557 -0
- package/docs/pt/site-forge.md +309 -0
- package/docs/pt/skills.md +98 -6
- package/docs/pt/spec-learnings-pipeline.md +265 -0
- package/package.json +1 -1
- package/src/a2a/client.js +165 -0
- package/src/a2a/server.js +223 -0
- package/src/agent-loader.js +280 -0
- package/src/cli.js +329 -1
- package/src/commands/agent-audit.js +397 -0
- package/src/commands/agent-export-skill.js +229 -0
- package/src/commands/agent-loader.js +85 -0
- package/src/commands/artifact-validate.js +189 -0
- package/src/commands/brief-gen.js +405 -0
- package/src/commands/brief-validate.js +65 -0
- package/src/commands/classify.js +256 -0
- package/src/commands/context-cache.js +90 -0
- package/src/commands/context-compact.js +49 -0
- package/src/commands/context-health.js +175 -0
- package/src/commands/context-monitor.js +163 -0
- package/src/commands/context-search.js +66 -0
- package/src/commands/context-trim.js +177 -0
- package/src/commands/design-hybrid-options.js +385 -0
- package/src/commands/detect-test-runner.js +55 -0
- package/src/commands/devlog-export-brains.js +27 -0
- package/src/commands/devlog-process.js +292 -0
- package/src/commands/devlog-watch.js +131 -0
- package/src/commands/feature-close.js +165 -0
- package/src/commands/gate-check.js +228 -0
- package/src/commands/health.js +214 -0
- package/src/commands/hooks-emit.js +253 -0
- package/src/commands/hooks-install.js +347 -0
- package/src/commands/init.js +54 -13
- package/src/commands/install.js +52 -13
- package/src/commands/learning-auto-promote.js +195 -0
- package/src/commands/learning-evolve.js +364 -0
- package/src/commands/learning-export.js +103 -0
- package/src/commands/learning-rollback.js +164 -0
- package/src/commands/live.js +59 -1
- package/src/commands/pattern-detect.js +33 -0
- package/src/commands/preflight-context.js +30 -0
- package/src/commands/preflight.js +208 -0
- package/src/commands/pulse-update.js +130 -0
- package/src/commands/recovery.js +43 -0
- package/src/commands/runner-daemon.js +274 -0
- package/src/commands/runner-plan.js +70 -0
- package/src/commands/runner-queue-from-plan.js +166 -0
- package/src/commands/runner-queue.js +189 -0
- package/src/commands/runner-run.js +129 -0
- package/src/commands/runtime.js +47 -1
- package/src/commands/sandbox.js +37 -0
- package/src/commands/self-implement-loop.js +256 -0
- package/src/commands/session-guard.js +218 -0
- package/src/commands/setup-context.js +22 -2
- package/src/commands/setup.js +178 -0
- package/src/commands/sizing.js +165 -0
- package/src/commands/skill.js +144 -32
- package/src/commands/spec-checkpoint.js +177 -0
- package/src/commands/spec-status.js +79 -0
- package/src/commands/spec-sync.js +190 -0
- package/src/commands/spec-tasks.js +288 -0
- package/src/commands/squad-autorun.js +1220 -0
- package/src/commands/squad-bus.js +217 -0
- package/src/commands/squad-card.js +149 -0
- package/src/commands/squad-daemon.js +134 -0
- package/src/commands/squad-dependency-graph.js +164 -0
- package/src/commands/squad-review.js +106 -0
- package/src/commands/squad-scaffold.js +55 -0
- package/src/commands/squad-tool-register.js +157 -0
- package/src/commands/state-save.js +122 -0
- package/src/commands/tool-registry-cmd.js +232 -0
- package/src/commands/update.js +9 -0
- package/src/commands/verify-gate.js +572 -0
- package/src/commands/workflow-execute.js +241 -0
- package/src/constants.js +18 -0
- package/src/context-cache.js +159 -0
- package/src/context-search.js +326 -0
- package/src/design-variation-catalog.js +503 -0
- package/src/i18n/messages/en.js +32 -2
- package/src/i18n/messages/es.js +30 -2
- package/src/i18n/messages/fr.js +30 -2
- package/src/i18n/messages/pt-BR.js +32 -2
- package/src/install-animation.js +260 -0
- package/src/install-profile.js +143 -0
- package/src/install-wizard.js +475 -0
- package/src/installer.js +44 -10
- package/src/lib/health-check.js +158 -0
- package/src/lib/hook-protocol.js +76 -0
- package/src/mcp/apps/squad-dashboard/app.js +163 -0
- package/src/mcp/apps/squad-dashboard/index.html +261 -0
- package/src/mcp/apps/squad-dashboard/mcp-manifest.json +23 -0
- package/src/mcp/resources/squad-state.js +130 -0
- package/src/parser.js +7 -1
- package/src/preflight-engine.js +443 -0
- package/src/recovery-context-session.js +154 -0
- package/src/runner/cascade.js +97 -0
- package/src/runner/cli-launcher.js +109 -0
- package/src/runner/plan-importer.js +63 -0
- package/src/runner/queue-store.js +159 -0
- package/src/runtime-store.js +158 -4
- package/src/sandbox.js +177 -0
- package/src/squad/agent-teams-adapter.js +264 -0
- package/src/squad/brief-validator.js +350 -0
- package/src/squad/bus-bridge.js +140 -0
- package/src/squad/context-compactor.js +265 -0
- package/src/squad/cross-ai-synthesizer.js +250 -0
- package/src/squad/hooks-generator.js +196 -0
- package/src/squad/inter-squad-events.js +175 -0
- package/src/squad/intra-bus.js +345 -0
- package/src/squad/learning-extractor.js +213 -0
- package/src/squad/pattern-detector.js +365 -0
- package/src/squad/preflight-context.js +296 -0
- package/src/squad/recovery-context.js +242 -71
- package/src/squad/reflection.js +365 -0
- package/src/squad/squad-scaffold.js +177 -0
- package/src/squad/state-manager.js +310 -0
- package/src/squad/task-decomposer.js +652 -0
- package/src/squad/verify-gate.js +303 -0
- package/src/tool-executor.js +94 -0
- package/src/updater.js +10 -3
- package/src/worker-runner.js +186 -1
- package/template/.aioson/agents/analyst.md +119 -3
- package/template/.aioson/agents/architect.md +98 -0
- package/template/.aioson/agents/design-hybrid-forge.md +141 -0
- package/template/.aioson/agents/dev.md +335 -14
- package/template/.aioson/agents/deyvin.md +117 -2
- package/template/.aioson/agents/discovery-design-doc.md +44 -0
- package/template/.aioson/agents/genome.md +14 -0
- package/template/.aioson/agents/neo.md +78 -1
- package/template/.aioson/agents/orache.md +50 -4
- package/template/.aioson/agents/orchestrator.md +197 -1
- package/template/.aioson/agents/pm.md +93 -0
- package/template/.aioson/agents/product.md +77 -4
- package/template/.aioson/agents/profiler-enricher.md +14 -0
- package/template/.aioson/agents/profiler-forge.md +14 -0
- package/template/.aioson/agents/profiler-researcher.md +14 -0
- package/template/.aioson/agents/qa.md +249 -19
- package/template/.aioson/agents/setup.md +144 -12
- package/template/.aioson/agents/sheldon.md +237 -11
- package/template/.aioson/agents/site-forge.md +1753 -0
- package/template/.aioson/agents/squad.md +162 -0
- package/template/.aioson/agents/tester.md +209 -0
- package/template/.aioson/agents/ux-ui.md +34 -1
- package/template/.aioson/brains/README.md +128 -0
- package/template/.aioson/brains/_index.json +16 -0
- package/template/.aioson/brains/scripts/query.js +103 -0
- package/template/.aioson/brains/site-forge/visual-patterns.brain.json +205 -0
- package/template/.aioson/config.md +158 -13
- package/template/.aioson/constitution.md +33 -0
- package/template/.aioson/context/forensics/.gitkeep +0 -0
- package/template/.aioson/context/project-pulse.md +34 -0
- package/template/.aioson/context/seeds/seed-example.md +27 -0
- package/template/.aioson/context/user-profile.md +42 -0
- package/template/.aioson/docs/LAYERS.md +79 -0
- package/template/.aioson/docs/README.md +76 -0
- package/template/.aioson/docs/example-external-api-context.md +72 -0
- package/template/.aioson/locales/en/agents/architect.md +17 -0
- package/template/.aioson/locales/en/agents/dev.md +79 -13
- package/template/.aioson/locales/en/agents/orache.md +6 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +24 -0
- package/template/.aioson/locales/en/agents/product.md +50 -0
- package/template/.aioson/locales/en/agents/setup.md +33 -1
- package/template/.aioson/locales/en/agents/sheldon.md +115 -0
- package/template/.aioson/locales/en/agents/squad.md +14 -0
- package/template/.aioson/locales/en/agents/tester.md +6 -0
- package/template/.aioson/locales/es/agents/analyst.md +2 -0
- package/template/.aioson/locales/es/agents/architect.md +19 -0
- package/template/.aioson/locales/es/agents/dev.md +64 -4
- package/template/.aioson/locales/es/agents/deyvin.md +2 -0
- package/template/.aioson/locales/es/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/es/agents/genome.md +2 -0
- package/template/.aioson/locales/es/agents/neo.md +2 -0
- package/template/.aioson/locales/es/agents/orache.md +2 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/es/agents/pair.md +2 -0
- package/template/.aioson/locales/es/agents/pm.md +2 -0
- package/template/.aioson/locales/es/agents/product.md +52 -0
- package/template/.aioson/locales/es/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/es/agents/qa.md +2 -0
- package/template/.aioson/locales/es/agents/setup.md +35 -1
- package/template/.aioson/locales/es/agents/sheldon.md +117 -0
- package/template/.aioson/locales/es/agents/squad.md +16 -0
- package/template/.aioson/locales/es/agents/tester.md +9 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/fr/agents/analyst.md +2 -0
- package/template/.aioson/locales/fr/agents/architect.md +19 -0
- package/template/.aioson/locales/fr/agents/dev.md +64 -4
- package/template/.aioson/locales/fr/agents/deyvin.md +2 -0
- package/template/.aioson/locales/fr/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/fr/agents/genome.md +2 -0
- package/template/.aioson/locales/fr/agents/neo.md +2 -0
- package/template/.aioson/locales/fr/agents/orache.md +2 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/fr/agents/pair.md +2 -0
- package/template/.aioson/locales/fr/agents/pm.md +2 -0
- package/template/.aioson/locales/fr/agents/product.md +52 -0
- package/template/.aioson/locales/fr/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/fr/agents/qa.md +2 -0
- package/template/.aioson/locales/fr/agents/setup.md +35 -1
- package/template/.aioson/locales/fr/agents/sheldon.md +117 -0
- package/template/.aioson/locales/fr/agents/squad.md +16 -0
- package/template/.aioson/locales/fr/agents/tester.md +9 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +64 -3
- package/template/.aioson/locales/pt-BR/agents/architect.md +42 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +147 -14
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +47 -0
- package/template/.aioson/locales/pt-BR/agents/neo.md +62 -1
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +158 -2
- package/template/.aioson/locales/pt-BR/agents/pm.md +95 -1
- package/template/.aioson/locales/pt-BR/agents/product.md +145 -18
- package/template/.aioson/locales/pt-BR/agents/qa.md +16 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +134 -19
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +132 -1
- package/template/.aioson/locales/pt-BR/agents/squad.md +14 -0
- package/template/.aioson/locales/pt-BR/agents/tester.md +449 -0
- package/template/.aioson/rules/README.md +69 -0
- package/template/.aioson/rules/data-format-convention.md +136 -0
- package/template/.aioson/rules/example-monetary-values.md +30 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +124 -3
- package/template/.aioson/skills/design/aurora-command-ui/SKILL.md +243 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/art-direction.md +293 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/components.md +827 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/dashboards.md +250 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/design-tokens.md +585 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/motion.md +365 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/patterns.md +482 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/websites.md +387 -0
- package/template/.aioson/skills/design/glassmorphism-ui/SKILL.md +222 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/art-direction.md +159 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/components.md +498 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/dashboards.md +236 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/design-tokens.md +274 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/motion.md +355 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/patterns.md +198 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/websites.md +307 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/SKILL.md +213 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/art-direction.md +228 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/components.md +855 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/dashboards.md +334 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/design-tokens.md +342 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/motion.md +286 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/patterns.md +458 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/websites.md +723 -0
- package/template/.aioson/skills/design/pt.squarespace.com/.skill-meta.json +31 -0
- package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +66 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +368 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +165 -0
- package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +46 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/analyst.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +109 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +23 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +44 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +37 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +47 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/deyvin.md +27 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md +49 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +101 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/product.md +25 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/sheldon.md +25 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/ui-language.md +75 -0
- package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +147 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/crossover-protocol.md +221 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/naming-registry.md +88 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +306 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +149 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +208 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/variation-library.md +125 -0
- package/template/.aioson/skills/process/simplify/SKILL.md +173 -0
- package/template/.aioson/skills/static/context-budget-guide.md +46 -0
- package/template/.aioson/skills/static/harness-sensors.md +74 -0
- package/template/.aioson/skills/static/multi-agent-patterns.md +43 -0
- package/template/.aioson/skills/static/react-motion-patterns.md +22 -0
- package/template/.aioson/skills/static/static-html-patterns/checklists.md +43 -0
- package/template/.aioson/skills/static/static-html-patterns/css-tokens.md +609 -0
- package/template/.aioson/skills/static/static-html-patterns/motion.md +193 -0
- package/template/.aioson/skills/static/static-html-patterns/premium.md +711 -0
- package/template/.aioson/skills/static/static-html-patterns/structure.md +209 -0
- package/template/.aioson/skills/static/static-html-patterns/utilities.md +190 -0
- package/template/.aioson/skills/static/static-html-patterns.md +58 -1913
- package/template/.aioson/skills/static/threejs-patterns.md +929 -0
- package/template/.aioson/skills/static/web-research-cache.md +112 -0
- package/template/.aioson/tasks/implementation-plan.md +21 -1
- package/template/.claude/commands/aioson/agent/design-hybrid-forge.md +5 -0
- package/template/.claude/commands/aioson/agent/orache.md +5 -0
- package/template/.claude/commands/aioson/agent/sheldon.md +5 -0
- package/template/.claude/commands/aioson/agent/site-forge.md +5 -0
- package/template/AGENTS.md +75 -1
- package/template/CLAUDE.md +31 -0
- package/template/OPENCODE.md +4 -0
- package/template/researchs/.gitkeep +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const readline = require('node:readline');
|
|
6
|
+
const { validateProjectContextFile } = require('../context');
|
|
7
|
+
const { resolveAgentLocale } = require('../locales');
|
|
8
|
+
const { ensureDir } = require('../utils');
|
|
9
|
+
const {
|
|
10
|
+
getDesignVariationCatalog,
|
|
11
|
+
getDesignVariationSources
|
|
12
|
+
} = require('../design-variation-catalog');
|
|
13
|
+
|
|
14
|
+
function resolveTargetDir(args) {
|
|
15
|
+
return path.resolve(process.cwd(), args[0] || '.');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function detectProjectLocale(targetDir) {
|
|
19
|
+
const context = await validateProjectContextFile(targetDir);
|
|
20
|
+
if (context.parsed && context.data && context.data.conversation_language) {
|
|
21
|
+
return {
|
|
22
|
+
locale: resolveAgentLocale(context.data.conversation_language),
|
|
23
|
+
source: 'project-context'
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
locale: 'en',
|
|
28
|
+
source: 'default'
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function resolveLocale(optionsLocale, projectLocale) {
|
|
33
|
+
return resolveAgentLocale(optionsLocale || projectLocale || 'en');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function formatTimestamp(date = new Date()) {
|
|
37
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
38
|
+
return [
|
|
39
|
+
date.getUTCFullYear(),
|
|
40
|
+
pad(date.getUTCMonth() + 1),
|
|
41
|
+
pad(date.getUTCDate())
|
|
42
|
+
].join('') + '-' + [
|
|
43
|
+
pad(date.getUTCHours()),
|
|
44
|
+
pad(date.getUTCMinutes()),
|
|
45
|
+
pad(date.getUTCSeconds())
|
|
46
|
+
].join('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getUiText(locale) {
|
|
50
|
+
if (locale === 'pt-BR') {
|
|
51
|
+
return {
|
|
52
|
+
title: 'AIOSON — Opções do Design Hybrid',
|
|
53
|
+
instructions: 'Use ↑/↓ para mover, espaço para marcar, enter para confirmar, q para cancelar.',
|
|
54
|
+
launching: 'Abrindo seletor de variações de design...',
|
|
55
|
+
saved: 'Preset de variação salvo.',
|
|
56
|
+
path: 'Arquivo ativo',
|
|
57
|
+
history: 'Histórico',
|
|
58
|
+
promptReady: 'Bloco pronto para usar com @design-hybrid-forge:',
|
|
59
|
+
presetHeading: '# Preset de Variação de Design',
|
|
60
|
+
presetIntro: 'Use este arquivo como overlay de variação para `@design-hybrid-forge` ou `/design-hybrid-forge`. O arquivo ativo deve ser arquivado após a skill híbrida ser gerada; a cópia em histórico permanece como trilha de criação.',
|
|
61
|
+
selectedVariations: '## Variações selecionadas',
|
|
62
|
+
presetPolicy: '## Política do preset',
|
|
63
|
+
presetPolicyLines: [
|
|
64
|
+
'- Este preset é temporário e serve apenas para a próxima geração da skill híbrida.',
|
|
65
|
+
'- Após a geração, mova ou apague `.aioson/context/design-variation-preset.md`.',
|
|
66
|
+
'- O histórico em `.aioson/context/history/design-variation-presets/` deve ser preservado.',
|
|
67
|
+
'- O layout padrão do projeto continua sendo definido pela `design_skill` ativa, não por este preset.'
|
|
68
|
+
],
|
|
69
|
+
promptBlock: '## Bloco para prompt',
|
|
70
|
+
sources: '## Fontes',
|
|
71
|
+
none: 'nenhum',
|
|
72
|
+
ttyError: 'Execute este comando em um terminal interativo, ou use --json para inspecionar o catálogo.'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
title: 'AIOSON — Design Hybrid Options',
|
|
78
|
+
instructions: 'Use ↑/↓ to move, space to toggle, enter to confirm, q to cancel.',
|
|
79
|
+
launching: 'Launching design variation picker...',
|
|
80
|
+
saved: 'Design variation preset saved.',
|
|
81
|
+
path: 'Active file',
|
|
82
|
+
history: 'History',
|
|
83
|
+
promptReady: 'Prompt block ready for @design-hybrid-forge:',
|
|
84
|
+
presetHeading: '# Design Variation Preset',
|
|
85
|
+
presetIntro: 'Use this file as a variation overlay for `@design-hybrid-forge` or `/design-hybrid-forge`. The active file should be archived after the hybrid skill is generated; the history copy remains as the creation trail.',
|
|
86
|
+
selectedVariations: '## Selected variations',
|
|
87
|
+
presetPolicy: '## Preset policy',
|
|
88
|
+
presetPolicyLines: [
|
|
89
|
+
'- This preset is temporary and should drive only the next hybrid skill generation.',
|
|
90
|
+
'- After generation, move or delete `.aioson/context/design-variation-preset.md`.',
|
|
91
|
+
'- Keep the history copy in `.aioson/context/history/design-variation-presets/`.',
|
|
92
|
+
'- The project default layout still comes from the active `design_skill`, not from this preset.'
|
|
93
|
+
],
|
|
94
|
+
promptBlock: '## Prompt block',
|
|
95
|
+
sources: '## Sources',
|
|
96
|
+
none: 'none',
|
|
97
|
+
ttyError: 'Run this command in an interactive terminal, or use --json to inspect the catalog.'
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function clearScreen(stdout = process.stdout) {
|
|
102
|
+
stdout.write('\x1Bc');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function renderGroup(group, cursor, selected, ui, stdout = process.stdout) {
|
|
106
|
+
clearScreen(stdout);
|
|
107
|
+
stdout.write(`${ui.title}\n\n`);
|
|
108
|
+
stdout.write(`${group.title}\n`);
|
|
109
|
+
stdout.write(`${group.guidance}\n`);
|
|
110
|
+
stdout.write(`${ui.instructions}\n\n`);
|
|
111
|
+
|
|
112
|
+
for (let i = 0; i < group.options.length; i++) {
|
|
113
|
+
const option = group.options[i];
|
|
114
|
+
const isActive = i === cursor;
|
|
115
|
+
const isSelected = selected.has(option.id);
|
|
116
|
+
const marker = isSelected ? '[x]' : '[ ]';
|
|
117
|
+
const pointer = isActive ? '>' : ' ';
|
|
118
|
+
stdout.write(`${pointer} ${marker} ${option.label}\n`);
|
|
119
|
+
stdout.write(` ${option.description}\n`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async function promptMultiSelectGroup(group, ui, io = {}) {
|
|
124
|
+
const stdin = io.stdin || process.stdin;
|
|
125
|
+
const stdout = io.stdout || process.stdout;
|
|
126
|
+
|
|
127
|
+
if (!stdin.isTTY || !stdout.isTTY) {
|
|
128
|
+
throw new Error('Interactive design-hybrid:options requires a TTY terminal.');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
readline.emitKeypressEvents(stdin);
|
|
132
|
+
const wasRaw = Boolean(stdin.isRaw);
|
|
133
|
+
const wasPaused = typeof stdin.isPaused === 'function' ? stdin.isPaused() : true;
|
|
134
|
+
if (typeof stdin.setRawMode === 'function') stdin.setRawMode(true);
|
|
135
|
+
if (typeof stdin.resume === 'function') stdin.resume();
|
|
136
|
+
|
|
137
|
+
let cursor = 0;
|
|
138
|
+
const selected = new Set();
|
|
139
|
+
|
|
140
|
+
return new Promise((resolve, reject) => {
|
|
141
|
+
let cleanedUp = false;
|
|
142
|
+
|
|
143
|
+
function cleanup() {
|
|
144
|
+
if (cleanedUp) return;
|
|
145
|
+
cleanedUp = true;
|
|
146
|
+
stdin.removeListener('keypress', onKeypress);
|
|
147
|
+
if (stdin.listenerCount('keypress') === 0 && stdin.listenerCount('data') > 0) {
|
|
148
|
+
stdin.emit('data', Buffer.alloc(0));
|
|
149
|
+
}
|
|
150
|
+
if (typeof stdin.setRawMode === 'function') stdin.setRawMode(wasRaw);
|
|
151
|
+
if (wasPaused && typeof stdin.pause === 'function') stdin.pause();
|
|
152
|
+
stdout.write('\n');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function onKeypress(_str, key) {
|
|
156
|
+
if (key && key.ctrl && key.name === 'c') {
|
|
157
|
+
cleanup();
|
|
158
|
+
reject(new Error('Interrupted'));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (key && key.name === 'q') {
|
|
163
|
+
cleanup();
|
|
164
|
+
reject(new Error('Cancelled'));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (key && key.name === 'up') {
|
|
169
|
+
cursor = cursor === 0 ? group.options.length - 1 : cursor - 1;
|
|
170
|
+
renderGroup(group, cursor, selected, ui, stdout);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (key && key.name === 'down') {
|
|
175
|
+
cursor = cursor === group.options.length - 1 ? 0 : cursor + 1;
|
|
176
|
+
renderGroup(group, cursor, selected, ui, stdout);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (key && key.name === 'space') {
|
|
181
|
+
const id = group.options[cursor].id;
|
|
182
|
+
if (selected.has(id)) selected.delete(id);
|
|
183
|
+
else selected.add(id);
|
|
184
|
+
renderGroup(group, cursor, selected, ui, stdout);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (key && key.name === 'return') {
|
|
189
|
+
cleanup();
|
|
190
|
+
resolve(group.options.filter((option) => selected.has(option.id)));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
stdin.on('keypress', onKeypress);
|
|
195
|
+
renderGroup(group, cursor, selected, ui, stdout);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function buildPromptBlock(selections) {
|
|
200
|
+
const lines = ['variation_overlay:'];
|
|
201
|
+
for (const group of selections.__groups) {
|
|
202
|
+
const chosen = selections[group.id] || [];
|
|
203
|
+
lines.push(` ${group.id}:`);
|
|
204
|
+
if (chosen.length === 0) {
|
|
205
|
+
lines.push(' - none');
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
for (const option of chosen) {
|
|
209
|
+
lines.push(` - ${option.id}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return lines.join('\n');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function buildPresetMarkdown(selections, locale, options = {}) {
|
|
216
|
+
const generatedAt = new Date().toISOString();
|
|
217
|
+
const oneShot = options.oneShot !== false;
|
|
218
|
+
const modifierPolicy = options.advanced ? 'up_to_3_modifiers' : 'up_to_2_modifiers';
|
|
219
|
+
const ui = getUiText(locale);
|
|
220
|
+
const lines = [
|
|
221
|
+
'---',
|
|
222
|
+
'preset_type: design-variation',
|
|
223
|
+
`locale: "${locale}"`,
|
|
224
|
+
`consumption_mode: "${oneShot ? 'archive_after_generation' : 'persistent'}"`,
|
|
225
|
+
`modifier_policy: "${modifierPolicy}"`,
|
|
226
|
+
`generated_at: "${generatedAt}"`,
|
|
227
|
+
'---',
|
|
228
|
+
'',
|
|
229
|
+
ui.presetHeading,
|
|
230
|
+
'',
|
|
231
|
+
ui.presetIntro,
|
|
232
|
+
'',
|
|
233
|
+
ui.selectedVariations
|
|
234
|
+
];
|
|
235
|
+
|
|
236
|
+
for (const group of selections.__groups) {
|
|
237
|
+
lines.push('');
|
|
238
|
+
lines.push(`### ${group.title}`);
|
|
239
|
+
const chosen = selections[group.id] || [];
|
|
240
|
+
if (chosen.length === 0) {
|
|
241
|
+
lines.push(`- ${ui.none}`);
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
for (const option of chosen) {
|
|
245
|
+
lines.push(`- ${option.label} — ${option.description}`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
lines.push('');
|
|
250
|
+
lines.push(ui.presetPolicy);
|
|
251
|
+
lines.push('');
|
|
252
|
+
for (const line of ui.presetPolicyLines) {
|
|
253
|
+
lines.push(line);
|
|
254
|
+
}
|
|
255
|
+
lines.push('');
|
|
256
|
+
lines.push(ui.promptBlock);
|
|
257
|
+
lines.push('');
|
|
258
|
+
lines.push('```yaml');
|
|
259
|
+
lines.push(buildPromptBlock(selections));
|
|
260
|
+
lines.push('```');
|
|
261
|
+
lines.push('');
|
|
262
|
+
lines.push(ui.sources);
|
|
263
|
+
for (const source of selections.__sources) {
|
|
264
|
+
lines.push(`- ${source.label}: ${source.url}`);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return `${lines.join('\n')}\n`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function buildSummary(selections) {
|
|
271
|
+
const parts = [];
|
|
272
|
+
for (const group of selections.__groups) {
|
|
273
|
+
const chosen = selections[group.id] || [];
|
|
274
|
+
if (chosen.length === 0) continue;
|
|
275
|
+
parts.push(`${group.title}: ${chosen.map((item) => item.label).join(', ')}`);
|
|
276
|
+
}
|
|
277
|
+
return parts;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
async function runDesignHybridOptions({ args, options = {}, logger, io = {} }) {
|
|
281
|
+
const targetDir = resolveTargetDir(args);
|
|
282
|
+
const presetPath = path.join(targetDir, '.aioson/context/design-variation-preset.md');
|
|
283
|
+
const historyDir = path.join(targetDir, '.aioson/context/history/design-variation-presets');
|
|
284
|
+
const stdin = io.stdin || process.stdin;
|
|
285
|
+
const stdout = io.stdout || process.stdout;
|
|
286
|
+
const projectLocaleResult = await detectProjectLocale(targetDir);
|
|
287
|
+
const projectLocale = projectLocaleResult.locale;
|
|
288
|
+
const localeOption = options.locale || options.language || options.lang;
|
|
289
|
+
const locale = resolveLocale(localeOption, projectLocale);
|
|
290
|
+
const ui = getUiText(locale);
|
|
291
|
+
const groups = getDesignVariationCatalog(locale);
|
|
292
|
+
const sources = getDesignVariationSources(locale);
|
|
293
|
+
const advanced = Boolean(options.advanced);
|
|
294
|
+
const modifierPolicy = advanced ? 'up_to_3_modifiers' : 'up_to_2_modifiers';
|
|
295
|
+
const localeSource = localeOption ? 'option' : projectLocaleResult.source;
|
|
296
|
+
|
|
297
|
+
if (options.json) {
|
|
298
|
+
return {
|
|
299
|
+
ok: true,
|
|
300
|
+
targetDir,
|
|
301
|
+
locale,
|
|
302
|
+
localeSource,
|
|
303
|
+
projectLocale,
|
|
304
|
+
advanced,
|
|
305
|
+
modifierPolicy,
|
|
306
|
+
presetPath: path.relative(targetDir, presetPath),
|
|
307
|
+
historyDir: path.relative(targetDir, historyDir),
|
|
308
|
+
groups,
|
|
309
|
+
sources
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (!stdin.isTTY || !stdout.isTTY) {
|
|
314
|
+
logger.log(ui.ttyError);
|
|
315
|
+
return {
|
|
316
|
+
ok: false,
|
|
317
|
+
error: 'TTY required',
|
|
318
|
+
message: ui.ttyError
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
logger.log(ui.launching);
|
|
323
|
+
const selections = {
|
|
324
|
+
__groups: groups,
|
|
325
|
+
__sources: sources
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
for (const group of groups) {
|
|
329
|
+
const chosen = await promptMultiSelectGroup(group, ui, { stdin, stdout });
|
|
330
|
+
selections[group.id] = chosen;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const content = buildPresetMarkdown(selections, locale, {
|
|
334
|
+
oneShot: options['persistent'] !== true,
|
|
335
|
+
advanced
|
|
336
|
+
});
|
|
337
|
+
const historyPath = path.join(historyDir, `${formatTimestamp()}.md`);
|
|
338
|
+
await ensureDir(path.dirname(presetPath));
|
|
339
|
+
await ensureDir(historyDir);
|
|
340
|
+
await fs.writeFile(presetPath, content, 'utf8');
|
|
341
|
+
await fs.writeFile(historyPath, content, 'utf8');
|
|
342
|
+
|
|
343
|
+
const summary = buildSummary(selections);
|
|
344
|
+
logger.log(`${ui.saved}\n`);
|
|
345
|
+
logger.log(`${ui.path}: ${path.relative(targetDir, presetPath)}\n`);
|
|
346
|
+
logger.log(`${ui.history}: ${path.relative(targetDir, historyPath)}\n`);
|
|
347
|
+
if (summary.length > 0) {
|
|
348
|
+
for (const line of summary) logger.log(`- ${line}`);
|
|
349
|
+
logger.log('');
|
|
350
|
+
}
|
|
351
|
+
logger.log(ui.promptReady);
|
|
352
|
+
logger.log('');
|
|
353
|
+
logger.log(buildPromptBlock(selections));
|
|
354
|
+
|
|
355
|
+
return {
|
|
356
|
+
ok: true,
|
|
357
|
+
targetDir,
|
|
358
|
+
locale,
|
|
359
|
+
localeSource,
|
|
360
|
+
projectLocale,
|
|
361
|
+
advanced,
|
|
362
|
+
modifierPolicy,
|
|
363
|
+
presetPath: path.relative(targetDir, presetPath),
|
|
364
|
+
historyPath: path.relative(targetDir, historyPath),
|
|
365
|
+
selections: Object.fromEntries(
|
|
366
|
+
Object.entries(selections)
|
|
367
|
+
.filter(([key]) => !key.startsWith('__'))
|
|
368
|
+
.map(([key, value]) => [
|
|
369
|
+
key,
|
|
370
|
+
Array.isArray(value) ? value.map((item) => item.id) : value
|
|
371
|
+
])
|
|
372
|
+
)
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
module.exports = {
|
|
377
|
+
runDesignHybridOptions,
|
|
378
|
+
__test__: {
|
|
379
|
+
getUiText,
|
|
380
|
+
promptMultiSelectGroup,
|
|
381
|
+
buildPresetMarkdown,
|
|
382
|
+
buildPromptBlock,
|
|
383
|
+
buildSummary
|
|
384
|
+
}
|
|
385
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* aioson detect:test-runner — detect test runner from project files.
|
|
5
|
+
*
|
|
6
|
+
* Checks for phpunit.xml, jest.config.*, vitest.config.*, pytest.ini, .rspec,
|
|
7
|
+
* foundry.toml and package.json scripts. Returns runner name and run command.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* aioson detect:test-runner .
|
|
11
|
+
* aioson detect:test-runner . --json
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const path = require('node:path');
|
|
15
|
+
const { detectTestRunner } = require('../preflight-engine');
|
|
16
|
+
|
|
17
|
+
const BAR = '━'.repeat(25);
|
|
18
|
+
|
|
19
|
+
async function runDetectTestRunner({ args, options = {}, logger }) {
|
|
20
|
+
const targetDir = path.resolve(process.cwd(), args[0] || '.');
|
|
21
|
+
|
|
22
|
+
const runner = await detectTestRunner(targetDir);
|
|
23
|
+
|
|
24
|
+
if (!runner) {
|
|
25
|
+
const result = { ok: true, detected: false, runner: null, command: null };
|
|
26
|
+
if (options.json) return result;
|
|
27
|
+
logger.log('');
|
|
28
|
+
logger.log('Test Runner Detection');
|
|
29
|
+
logger.log(BAR);
|
|
30
|
+
logger.log('No test runner detected.');
|
|
31
|
+
logger.log('');
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const result = {
|
|
36
|
+
ok: true,
|
|
37
|
+
detected: true,
|
|
38
|
+
runner: runner.name,
|
|
39
|
+
command: runner.command,
|
|
40
|
+
config_file: runner.configFile
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
if (options.json) return result;
|
|
44
|
+
|
|
45
|
+
logger.log('');
|
|
46
|
+
logger.log('Test Runner Detection');
|
|
47
|
+
logger.log(BAR);
|
|
48
|
+
logger.log(`Found: ${runner.configFile} → ${runner.name}`);
|
|
49
|
+
logger.log(`Command: ${runner.command}`);
|
|
50
|
+
logger.log('');
|
|
51
|
+
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = { runDetectTestRunner };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { runLearningExport } = require('./learning-export');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* aioson devlog:export-brains [targetDir] [--min-frequency=N] [--json]
|
|
7
|
+
*
|
|
8
|
+
* Exports high-frequency project_learnings to .aioson/brains/ as Zettelkasten nodes.
|
|
9
|
+
* This is a focused wrapper over learning:export, intended to be run after devlog:process.
|
|
10
|
+
*/
|
|
11
|
+
async function runDevlogExportBrains({ args, options = {}, logger }) {
|
|
12
|
+
// Default min-frequency to 2 for devlog pipeline (lower than the general export default of 1)
|
|
13
|
+
const minFrequency = options['min-frequency'] != null ? options['min-frequency'] : options.minFrequency ?? 2;
|
|
14
|
+
const result = await runLearningExport({
|
|
15
|
+
args,
|
|
16
|
+
options: { ...options, 'min-frequency': minFrequency },
|
|
17
|
+
logger
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (result.ok && !options.json && result.exported > 0) {
|
|
21
|
+
logger.log('Run: aioson learning:evolve to promote high-frequency nodes to genome.');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = { runDevlogExportBrains };
|