@jaimevalasek/aioson 1.3.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 +456 -0
- package/CODE_OF_CONDUCT.md +12 -0
- package/CONTRIBUTING.md +13 -0
- package/LICENSE +21 -0
- package/README.md +254 -0
- package/bin/aioson.js +4 -0
- package/docs/en/cli-reference.md +398 -0
- package/docs/en/i18n.md +52 -0
- package/docs/en/json-schemas.md +41 -0
- package/docs/en/mcp.md +56 -0
- package/docs/en/parallel.md +82 -0
- package/docs/en/qa-browser.md +339 -0
- package/docs/en/release-flow.md +22 -0
- package/docs/en/release-notes-template.md +41 -0
- package/docs/en/release.md +28 -0
- package/docs/en/schemas/agent-prompt.schema.json +17 -0
- package/docs/en/schemas/agents.schema.json +32 -0
- package/docs/en/schemas/context-validate.schema.json +36 -0
- package/docs/en/schemas/doctor.schema.json +89 -0
- package/docs/en/schemas/error.schema.json +24 -0
- package/docs/en/schemas/i18n-add.schema.json +15 -0
- package/docs/en/schemas/index.json +116 -0
- package/docs/en/schemas/info.schema.json +39 -0
- package/docs/en/schemas/init.schema.json +48 -0
- package/docs/en/schemas/install.schema.json +60 -0
- package/docs/en/schemas/locale-apply.schema.json +30 -0
- package/docs/en/schemas/mcp-doctor.schema.json +95 -0
- package/docs/en/schemas/mcp-init.schema.json +122 -0
- package/docs/en/schemas/package-test.schema.json +24 -0
- package/docs/en/schemas/parallel-assign.schema.json +57 -0
- package/docs/en/schemas/parallel-doctor.schema.json +86 -0
- package/docs/en/schemas/parallel-init.schema.json +53 -0
- package/docs/en/schemas/parallel-status.schema.json +94 -0
- package/docs/en/schemas/setup-context.schema.json +39 -0
- package/docs/en/schemas/smoke.schema.json +23 -0
- package/docs/en/schemas/update.schema.json +48 -0
- package/docs/en/schemas/workflow-plan.schema.json +30 -0
- package/docs/en/web3.md +54 -0
- package/docs/pt/README.md +46 -0
- package/docs/pt/advisor-spec.md +335 -0
- package/docs/pt/agentes.md +453 -0
- package/docs/pt/cenarios.md +1230 -0
- package/docs/pt/clientes-ai.md +224 -0
- package/docs/pt/comandos-cli.md +511 -0
- package/docs/pt/genome-3.0-spec.md +296 -0
- package/docs/pt/guia-engineer.md +226 -0
- package/docs/pt/inicio-rapido.md +138 -0
- package/docs/pt/profiler-system.md +214 -0
- package/docs/pt/runtime-observability.md +72 -0
- package/docs/pt/squad-genoma.md +777 -0
- package/docs/pt/web3.md +797 -0
- package/docs/testing/genome-2.0-manual-regression.md +23 -0
- package/docs/testing/genome-2.0-matrix.md +36 -0
- package/docs/testing/genome-2.0-rollout.md +184 -0
- package/package.json +50 -0
- package/src/agents.js +56 -0
- package/src/cli.js +497 -0
- package/src/commands/agents.js +142 -0
- package/src/commands/cloud.js +1767 -0
- package/src/commands/config.js +90 -0
- package/src/commands/context-validate.js +91 -0
- package/src/commands/doctor.js +123 -0
- package/src/commands/genome-doctor.js +41 -0
- package/src/commands/genome-migrate.js +49 -0
- package/src/commands/i18n-add.js +56 -0
- package/src/commands/info.js +41 -0
- package/src/commands/init.js +75 -0
- package/src/commands/install.js +68 -0
- package/src/commands/locale-apply.js +51 -0
- package/src/commands/locale-diff.js +126 -0
- package/src/commands/mcp-doctor.js +406 -0
- package/src/commands/mcp-init.js +379 -0
- package/src/commands/package-e2e.js +273 -0
- package/src/commands/parallel-assign.js +403 -0
- package/src/commands/parallel-doctor.js +437 -0
- package/src/commands/parallel-init.js +249 -0
- package/src/commands/parallel-status.js +290 -0
- package/src/commands/qa-doctor.js +185 -0
- package/src/commands/qa-init.js +161 -0
- package/src/commands/qa-report.js +58 -0
- package/src/commands/qa-run.js +873 -0
- package/src/commands/qa-scan.js +337 -0
- package/src/commands/runtime.js +948 -0
- package/src/commands/scan-project.js +1107 -0
- package/src/commands/setup-context.js +650 -0
- package/src/commands/smoke.js +426 -0
- package/src/commands/squad-doctor.js +358 -0
- package/src/commands/squad-export.js +46 -0
- package/src/commands/squad-pipeline.js +97 -0
- package/src/commands/squad-repair-genomes.js +39 -0
- package/src/commands/squad-status.js +424 -0
- package/src/commands/squad-validate.js +230 -0
- package/src/commands/test-agents.js +194 -0
- package/src/commands/update.js +55 -0
- package/src/commands/workflow-next.js +594 -0
- package/src/commands/workflow-plan.js +108 -0
- package/src/constants.js +314 -0
- package/src/context-parse-reason.js +22 -0
- package/src/context-writer.js +150 -0
- package/src/context.js +217 -0
- package/src/detector.js +261 -0
- package/src/doctor.js +289 -0
- package/src/execution-gateway.js +461 -0
- package/src/genome-files.js +198 -0
- package/src/genome-format.js +442 -0
- package/src/genome-schema.js +215 -0
- package/src/genomes/bindings.js +281 -0
- package/src/genomes.js +467 -0
- package/src/i18n/index.js +103 -0
- package/src/i18n/messages/en.js +784 -0
- package/src/i18n/messages/es.js +718 -0
- package/src/i18n/messages/fr.js +725 -0
- package/src/i18n/messages/pt-BR.js +818 -0
- package/src/i18n/scaffold.js +64 -0
- package/src/installer.js +232 -0
- package/src/lib/genomes/compat.js +206 -0
- package/src/lib/genomes/migrate.js +90 -0
- package/src/lib/squads/genome-repair.js +49 -0
- package/src/locales.js +84 -0
- package/src/onboarding.js +305 -0
- package/src/parser.js +53 -0
- package/src/prompt-tool.js +20 -0
- package/src/qa-html-report.js +472 -0
- package/src/runtime-store.js +1527 -0
- package/src/squads/apply-genome.js +21 -0
- package/src/squads/genome-binding-service.js +154 -0
- package/src/updater.js +32 -0
- package/src/utils.js +46 -0
- package/src/version.js +50 -0
- package/template/.aioson/advisors/.gitkeep +1 -0
- package/template/.aioson/agents/analyst.md +225 -0
- package/template/.aioson/agents/architect.md +221 -0
- package/template/.aioson/agents/dev.md +201 -0
- package/template/.aioson/agents/discovery-design-doc.md +196 -0
- package/template/.aioson/agents/genoma.md +300 -0
- package/template/.aioson/agents/orchestrator.md +107 -0
- package/template/.aioson/agents/pm.md +89 -0
- package/template/.aioson/agents/product.md +361 -0
- package/template/.aioson/agents/profiler-enricher.md +266 -0
- package/template/.aioson/agents/profiler-forge.md +188 -0
- package/template/.aioson/agents/profiler-researcher.md +245 -0
- package/template/.aioson/agents/qa.md +344 -0
- package/template/.aioson/agents/setup.md +381 -0
- package/template/.aioson/agents/squad.md +837 -0
- package/template/.aioson/agents/ux-ui.md +416 -0
- package/template/.aioson/config.md +56 -0
- package/template/.aioson/context/.gitkeep +0 -0
- package/template/.aioson/context/parallel/.gitkeep +0 -0
- package/template/.aioson/context/spec.md.template +37 -0
- package/template/.aioson/genomas/.gitkeep +0 -0
- package/template/.aioson/locales/en/agents/analyst.md +214 -0
- package/template/.aioson/locales/en/agents/architect.md +210 -0
- package/template/.aioson/locales/en/agents/dev.md +187 -0
- package/template/.aioson/locales/en/agents/discovery-design-doc.md +27 -0
- package/template/.aioson/locales/en/agents/genoma.md +212 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +105 -0
- package/template/.aioson/locales/en/agents/pm.md +77 -0
- package/template/.aioson/locales/en/agents/product.md +310 -0
- package/template/.aioson/locales/en/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/en/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/en/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/en/agents/qa.md +214 -0
- package/template/.aioson/locales/en/agents/setup.md +342 -0
- package/template/.aioson/locales/en/agents/squad.md +247 -0
- package/template/.aioson/locales/en/agents/ux-ui.md +320 -0
- package/template/.aioson/locales/es/agents/analyst.md +203 -0
- package/template/.aioson/locales/es/agents/architect.md +208 -0
- package/template/.aioson/locales/es/agents/dev.md +183 -0
- package/template/.aioson/locales/es/agents/discovery-design-doc.md +19 -0
- package/template/.aioson/locales/es/agents/genoma.md +102 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/es/agents/pm.md +81 -0
- package/template/.aioson/locales/es/agents/product.md +310 -0
- package/template/.aioson/locales/es/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/es/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/es/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/es/agents/qa.md +163 -0
- package/template/.aioson/locales/es/agents/setup.md +347 -0
- package/template/.aioson/locales/es/agents/squad.md +247 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +201 -0
- package/template/.aioson/locales/fr/agents/analyst.md +203 -0
- package/template/.aioson/locales/fr/agents/architect.md +208 -0
- package/template/.aioson/locales/fr/agents/dev.md +183 -0
- package/template/.aioson/locales/fr/agents/discovery-design-doc.md +19 -0
- package/template/.aioson/locales/fr/agents/genoma.md +102 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/fr/agents/pm.md +81 -0
- package/template/.aioson/locales/fr/agents/product.md +310 -0
- package/template/.aioson/locales/fr/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/fr/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/fr/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/fr/agents/qa.md +163 -0
- package/template/.aioson/locales/fr/agents/setup.md +347 -0
- package/template/.aioson/locales/fr/agents/squad.md +247 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +201 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +217 -0
- package/template/.aioson/locales/pt-BR/agents/architect.md +213 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +198 -0
- package/template/.aioson/locales/pt-BR/agents/discovery-design-doc.md +198 -0
- package/template/.aioson/locales/pt-BR/agents/genoma.md +297 -0
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/pt-BR/agents/pm.md +81 -0
- package/template/.aioson/locales/pt-BR/agents/product.md +316 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/qa.md +217 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +371 -0
- package/template/.aioson/locales/pt-BR/agents/squad.md +772 -0
- package/template/.aioson/locales/pt-BR/agents/ux-ui.md +322 -0
- package/template/.aioson/mcp/servers.md +24 -0
- package/template/.aioson/profiler-reports/.gitkeep +1 -0
- package/template/.aioson/schemas/content-blueprint.schema.json +30 -0
- package/template/.aioson/schemas/genome-meta.schema.json +150 -0
- package/template/.aioson/schemas/genome.schema.json +115 -0
- package/template/.aioson/schemas/readiness.schema.json +27 -0
- package/template/.aioson/schemas/squad-blueprint.schema.json +172 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +276 -0
- package/template/.aioson/skills/dynamic/README.md +30 -0
- package/template/.aioson/skills/dynamic/cardano-docs.md +16 -0
- package/template/.aioson/skills/dynamic/ethereum-docs.md +17 -0
- package/template/.aioson/skills/dynamic/flux-ui-docs.md +13 -0
- package/template/.aioson/skills/dynamic/laravel-docs.md +41 -0
- package/template/.aioson/skills/dynamic/npm-packages.md +16 -0
- package/template/.aioson/skills/dynamic/solana-docs.md +16 -0
- package/template/.aioson/skills/references/premium-command-center-ui/master-application-prompt.md +79 -0
- package/template/.aioson/skills/references/premium-command-center-ui/operational-ux-playbook.md +253 -0
- package/template/.aioson/skills/references/premium-command-center-ui/quality-validation-checklist.md +82 -0
- package/template/.aioson/skills/references/premium-command-center-ui/visual-system-and-component-patterns.md +270 -0
- package/template/.aioson/skills/static/django-patterns.md +342 -0
- package/template/.aioson/skills/static/fastapi-patterns.md +344 -0
- package/template/.aioson/skills/static/filament-patterns.md +267 -0
- package/template/.aioson/skills/static/flux-ui-components.md +262 -0
- package/template/.aioson/skills/static/git-conventions.md +227 -0
- package/template/.aioson/skills/static/interface-design.md +372 -0
- package/template/.aioson/skills/static/jetstream-setup.md +200 -0
- package/template/.aioson/skills/static/laravel-conventions.md +491 -0
- package/template/.aioson/skills/static/nextjs-patterns.md +321 -0
- package/template/.aioson/skills/static/node-express-patterns.md +317 -0
- package/template/.aioson/skills/static/node-typescript-patterns.md +282 -0
- package/template/.aioson/skills/static/premium-command-center-ui.md +190 -0
- package/template/.aioson/skills/static/rails-conventions.md +307 -0
- package/template/.aioson/skills/static/react-motion-patterns.md +577 -0
- package/template/.aioson/skills/static/static-html-patterns.md +1935 -0
- package/template/.aioson/skills/static/tall-stack-patterns.md +286 -0
- package/template/.aioson/skills/static/ui-ux-modern.md +75 -0
- package/template/.aioson/skills/static/web3-cardano-patterns.md +337 -0
- package/template/.aioson/skills/static/web3-ethereum-patterns.md +310 -0
- package/template/.aioson/skills/static/web3-security-checklist.md +284 -0
- package/template/.aioson/skills/static/web3-solana-patterns.md +324 -0
- package/template/.aioson/squads/.artisan/.gitkeep +0 -0
- package/template/.aioson/squads/.gitkeep +0 -0
- package/template/.aioson/squads/memory.md +5 -0
- package/template/.aioson/tasks/squad-analyze.md +83 -0
- package/template/.aioson/tasks/squad-create.md +99 -0
- package/template/.aioson/tasks/squad-design.md +100 -0
- package/template/.aioson/tasks/squad-export.md +20 -0
- package/template/.aioson/tasks/squad-extend.md +68 -0
- package/template/.aioson/tasks/squad-pipeline.md +122 -0
- package/template/.aioson/tasks/squad-repair.md +85 -0
- package/template/.aioson/tasks/squad-validate.md +58 -0
- package/template/.aioson/templates/squads/content-basic/template.json +21 -0
- package/template/.aioson/templates/squads/media-channel/template.json +24 -0
- package/template/.aioson/templates/squads/research-analysis/template.json +22 -0
- package/template/.aioson/templates/squads/software-delivery/template.json +21 -0
- package/template/.claude/commands/aioson/analyst.md +5 -0
- package/template/.claude/commands/aioson/architect.md +5 -0
- package/template/.claude/commands/aioson/dev.md +5 -0
- package/template/.claude/commands/aioson/orchestrator.md +5 -0
- package/template/.claude/commands/aioson/pm.md +5 -0
- package/template/.claude/commands/aioson/qa.md +5 -0
- package/template/.claude/commands/aioson/setup.md +5 -0
- package/template/.claude/commands/aioson/ux-ui.md +5 -0
- package/template/.gemini/GEMINI.md +10 -0
- package/template/.gemini/commands/aios-analyst.toml +4 -0
- package/template/.gemini/commands/aios-architect.toml +7 -0
- package/template/.gemini/commands/aios-dev.toml +8 -0
- package/template/.gemini/commands/aios-discovery-design-doc.toml +4 -0
- package/template/.gemini/commands/aios-orchestrator.toml +8 -0
- package/template/.gemini/commands/aios-pm.toml +8 -0
- package/template/.gemini/commands/aios-product.toml +4 -0
- package/template/.gemini/commands/aios-qa.toml +6 -0
- package/template/.gemini/commands/aios-setup.toml +3 -0
- package/template/.gemini/commands/aios-ux-ui.toml +8 -0
- package/template/AGENTS.md +67 -0
- package/template/CLAUDE.md +31 -0
- package/template/OPENCODE.md +24 -0
- package/template/aioson-models.json +40 -0
package/src/locales.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { AGENT_DEFINITIONS } = require('./constants');
|
|
6
|
+
const { exists, ensureDir } = require('./utils');
|
|
7
|
+
|
|
8
|
+
const SUPPORTED_AGENT_LOCALES = ['en', 'pt-BR', 'es', 'fr'];
|
|
9
|
+
|
|
10
|
+
function normalizeLanguageTag(value) {
|
|
11
|
+
return String(value || '').trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function localeForPath(value) {
|
|
15
|
+
return String(value || '').replace(/_/g, '-');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function resolveAgentLocale(languageTag) {
|
|
19
|
+
const tag = normalizeLanguageTag(languageTag);
|
|
20
|
+
if (!tag) return 'en';
|
|
21
|
+
const canonical = tag.replace(/_/g, '-');
|
|
22
|
+
|
|
23
|
+
const exact = SUPPORTED_AGENT_LOCALES.find(
|
|
24
|
+
(locale) => locale.toLowerCase() === canonical.toLowerCase()
|
|
25
|
+
);
|
|
26
|
+
if (exact) return exact;
|
|
27
|
+
|
|
28
|
+
const base = canonical.split('-')[0].toLowerCase();
|
|
29
|
+
if (base === 'pt') return 'pt-BR';
|
|
30
|
+
if (base === 'en') return 'en';
|
|
31
|
+
if (base === 'es') return 'es';
|
|
32
|
+
if (base === 'fr') return 'fr';
|
|
33
|
+
|
|
34
|
+
return 'en';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getLocalizedAgentPath(agentId, locale) {
|
|
38
|
+
return `.aioson/locales/${localeForPath(locale)}/agents/${agentId}.md`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getActiveAgentPath(agentId) {
|
|
42
|
+
return `.aioson/agents/${agentId}.md`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function applyAgentLocale(targetDir, locale, options = {}) {
|
|
46
|
+
const resolved = resolveAgentLocale(locale);
|
|
47
|
+
const dryRun = Boolean(options.dryRun);
|
|
48
|
+
const copied = [];
|
|
49
|
+
const missing = [];
|
|
50
|
+
|
|
51
|
+
for (const agent of AGENT_DEFINITIONS) {
|
|
52
|
+
const sourceRel = getLocalizedAgentPath(agent.id, resolved);
|
|
53
|
+
const destRel = getActiveAgentPath(agent.id);
|
|
54
|
+
const sourceAbs = path.join(targetDir, sourceRel);
|
|
55
|
+
const destAbs = path.join(targetDir, destRel);
|
|
56
|
+
|
|
57
|
+
if (!(await exists(sourceAbs))) {
|
|
58
|
+
missing.push(sourceRel);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!dryRun) {
|
|
63
|
+
await ensureDir(path.dirname(destAbs));
|
|
64
|
+
await fs.copyFile(sourceAbs, destAbs);
|
|
65
|
+
}
|
|
66
|
+
copied.push({ source: sourceRel, target: destRel });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
locale: resolved,
|
|
71
|
+
copied,
|
|
72
|
+
missing,
|
|
73
|
+
dryRun
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = {
|
|
78
|
+
SUPPORTED_AGENT_LOCALES,
|
|
79
|
+
normalizeLanguageTag,
|
|
80
|
+
resolveAgentLocale,
|
|
81
|
+
getLocalizedAgentPath,
|
|
82
|
+
getActiveAgentPath,
|
|
83
|
+
applyAgentLocale
|
|
84
|
+
};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const BACKEND_CHOICES = {
|
|
4
|
+
'1': 'Laravel',
|
|
5
|
+
'2': 'Rails',
|
|
6
|
+
'3': 'Django',
|
|
7
|
+
'4': 'Node/Express',
|
|
8
|
+
'5': 'Next.js',
|
|
9
|
+
'6': 'Nuxt',
|
|
10
|
+
'7': 'Hardhat',
|
|
11
|
+
'8': 'Foundry',
|
|
12
|
+
'9': 'Truffle',
|
|
13
|
+
'10': 'Anchor',
|
|
14
|
+
'11': 'Solana Web3',
|
|
15
|
+
'12': 'Cardano',
|
|
16
|
+
'13': 'Other'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const FRONTEND_CHOICES = {
|
|
20
|
+
'1': 'TALL Stack',
|
|
21
|
+
'2': 'VILT Stack',
|
|
22
|
+
'3': 'Blade',
|
|
23
|
+
'4': 'Next.js',
|
|
24
|
+
'5': 'Nuxt',
|
|
25
|
+
'6': 'React',
|
|
26
|
+
'7': 'Vue',
|
|
27
|
+
'8': 'Other'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const AUTH_CHOICES = {
|
|
31
|
+
'1': 'Breeze',
|
|
32
|
+
'2': 'Jetstream + Livewire',
|
|
33
|
+
'3': 'Filament Shield',
|
|
34
|
+
'4': 'Custom'
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const UIUX_CHOICES = {
|
|
38
|
+
'1': 'Tailwind',
|
|
39
|
+
'2': 'Flux UI',
|
|
40
|
+
'3': 'shadcn/ui',
|
|
41
|
+
'4': 'Filament'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const DATABASE_CHOICES = {
|
|
45
|
+
'1': 'MySQL',
|
|
46
|
+
'2': 'PostgreSQL',
|
|
47
|
+
'3': 'SQLite',
|
|
48
|
+
'4': 'MongoDB',
|
|
49
|
+
'5': 'Supabase',
|
|
50
|
+
'6': 'PlanetScale'
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const SERVICE_CHOICES = {
|
|
54
|
+
queues: 'Queues (Redis/Horizon)',
|
|
55
|
+
storage: 'Storage (S3-compatible)',
|
|
56
|
+
websockets: 'WebSockets',
|
|
57
|
+
payments: 'Payments',
|
|
58
|
+
email: 'Transactional Email',
|
|
59
|
+
cache: 'Cache (Redis)',
|
|
60
|
+
search: 'Full-text Search'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const SERVICE_ALIASES = {
|
|
64
|
+
queues: ['queues', 'queue', 'horizon', 'redis queue', 'redis'],
|
|
65
|
+
storage: ['storage', 's3', 'r2', 'object storage'],
|
|
66
|
+
websockets: ['websockets', 'websocket', 'reverb', 'pusher'],
|
|
67
|
+
payments: ['payments', 'payment', 'stripe', 'mercadopago', 'pagseguro'],
|
|
68
|
+
email: ['email', 'transactional email', 'mailgun', 'resend', 'ses'],
|
|
69
|
+
cache: ['cache', 'redis cache'],
|
|
70
|
+
search: ['search', 'full-text', 'full text', 'meilisearch', 'algolia']
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const PROFILE_CHOICES = {
|
|
74
|
+
'1': 'developer',
|
|
75
|
+
'2': 'beginner',
|
|
76
|
+
'3': 'team'
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
function normalizeText(value) {
|
|
80
|
+
return String(value || '').trim();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function normalizeChoice(value, choices, fallback = '') {
|
|
84
|
+
const input = normalizeText(value);
|
|
85
|
+
if (!input) return fallback;
|
|
86
|
+
if (Object.prototype.hasOwnProperty.call(choices, input)) {
|
|
87
|
+
return choices[input];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const lowerInput = input.toLowerCase();
|
|
91
|
+
for (const selected of Object.values(choices)) {
|
|
92
|
+
if (selected.toLowerCase() === lowerInput) return selected;
|
|
93
|
+
}
|
|
94
|
+
return input;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function normalizeProfile(value, fallback = 'developer') {
|
|
98
|
+
const input = normalizeText(value);
|
|
99
|
+
if (!input) return fallback;
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(PROFILE_CHOICES, input)) {
|
|
101
|
+
return PROFILE_CHOICES[input];
|
|
102
|
+
}
|
|
103
|
+
const lower = input.toLowerCase();
|
|
104
|
+
if (['developer', 'beginner', 'team'].includes(lower)) return lower;
|
|
105
|
+
return fallback;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function parseServices(input) {
|
|
109
|
+
const text = normalizeText(input);
|
|
110
|
+
if (!text) return [];
|
|
111
|
+
return text
|
|
112
|
+
.split(',')
|
|
113
|
+
.map((item) => item.trim().toLowerCase())
|
|
114
|
+
.filter(Boolean)
|
|
115
|
+
.map((token) => {
|
|
116
|
+
const canonical = Object.entries(SERVICE_ALIASES).find(([, aliases]) =>
|
|
117
|
+
aliases.includes(token)
|
|
118
|
+
);
|
|
119
|
+
if (canonical) {
|
|
120
|
+
return SERVICE_CHOICES[canonical[0]];
|
|
121
|
+
}
|
|
122
|
+
return SERVICE_CHOICES[token] || token;
|
|
123
|
+
})
|
|
124
|
+
.filter((value, index, arr) => arr.indexOf(value) === index);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function inferProjectTypeFromFramework(framework) {
|
|
128
|
+
const value = normalizeText(framework).toLowerCase();
|
|
129
|
+
if (['hardhat', 'foundry', 'truffle', 'anchor', 'solana web3', 'cardano'].includes(value)) {
|
|
130
|
+
return 'dapp';
|
|
131
|
+
}
|
|
132
|
+
return 'web_app';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function inferWeb3NetworkFromFramework(framework) {
|
|
136
|
+
const value = normalizeText(framework).toLowerCase();
|
|
137
|
+
if (['hardhat', 'foundry', 'truffle'].includes(value)) return 'ethereum';
|
|
138
|
+
if (['anchor', 'solana web3'].includes(value)) return 'solana';
|
|
139
|
+
if (value === 'cardano') return 'cardano';
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function buildDeveloperProfile(input) {
|
|
144
|
+
const backend = normalizeChoice(
|
|
145
|
+
input.backendChoice,
|
|
146
|
+
BACKEND_CHOICES,
|
|
147
|
+
input.backend || input.framework || 'Laravel'
|
|
148
|
+
);
|
|
149
|
+
const frontend = normalizeChoice(input.frontendChoice, FRONTEND_CHOICES, input.frontend || '');
|
|
150
|
+
const auth = normalizeChoice(input.authChoice, AUTH_CHOICES, input.auth || '');
|
|
151
|
+
const uiux = normalizeChoice(input.uiuxChoice, UIUX_CHOICES, input.uiux || '');
|
|
152
|
+
const database = normalizeChoice(input.databaseChoice, DATABASE_CHOICES, input.database || '');
|
|
153
|
+
const services = parseServices(input.servicesChoice || input.services || '');
|
|
154
|
+
const laravelVersion = normalizeText(input.laravelVersion);
|
|
155
|
+
const teamsEnabled = input.teamsEnabled === true;
|
|
156
|
+
|
|
157
|
+
const backendValue =
|
|
158
|
+
backend === 'Other'
|
|
159
|
+
? normalizeText(input.backend || input.framework) || 'Custom backend'
|
|
160
|
+
: backend;
|
|
161
|
+
const frontendValue =
|
|
162
|
+
frontend === 'Other'
|
|
163
|
+
? normalizeText(input.frontendText || input.frontend) || 'Custom frontend'
|
|
164
|
+
: frontend;
|
|
165
|
+
const framework = backendValue === 'Laravel' && laravelVersion ? `Laravel ${laravelVersion}` : backendValue;
|
|
166
|
+
const projectType = inferProjectTypeFromFramework(backendValue);
|
|
167
|
+
const web3Network = inferWeb3NetworkFromFramework(backendValue);
|
|
168
|
+
|
|
169
|
+
const notes = [];
|
|
170
|
+
if (backend === 'Laravel' && auth === 'Jetstream + Livewire') {
|
|
171
|
+
notes.push(`Jetstream teams: ${teamsEnabled ? 'enabled' : 'disabled'}`);
|
|
172
|
+
}
|
|
173
|
+
if (services.length > 0) {
|
|
174
|
+
notes.push(`Selected services: ${services.join(', ')}`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
profile: 'developer',
|
|
179
|
+
projectType,
|
|
180
|
+
framework,
|
|
181
|
+
backend: backendValue,
|
|
182
|
+
frontend: frontendValue,
|
|
183
|
+
auth,
|
|
184
|
+
uiux,
|
|
185
|
+
database,
|
|
186
|
+
services,
|
|
187
|
+
web3Enabled: projectType === 'dapp',
|
|
188
|
+
web3Networks: web3Network,
|
|
189
|
+
contractFramework: projectType === 'dapp' ? backendValue : '',
|
|
190
|
+
notes
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function recommendBeginnerProfile(input = {}) {
|
|
195
|
+
const expectedUsers = normalizeText(input.expectedUsers).toLowerCase();
|
|
196
|
+
const mobileNeed = normalizeText(input.mobileRequirement).toLowerCase();
|
|
197
|
+
const hosting = normalizeText(input.hostingPreference).toLowerCase();
|
|
198
|
+
const summary = normalizeText(input.projectSummary);
|
|
199
|
+
|
|
200
|
+
const recommendation = {
|
|
201
|
+
profile: 'beginner',
|
|
202
|
+
projectType: 'web_app',
|
|
203
|
+
framework: 'Laravel',
|
|
204
|
+
backend: 'Laravel',
|
|
205
|
+
frontend: 'TALL Stack',
|
|
206
|
+
auth: 'Jetstream + Livewire',
|
|
207
|
+
uiux: 'Flux UI',
|
|
208
|
+
database: 'SQLite',
|
|
209
|
+
services: [],
|
|
210
|
+
web3Enabled: false,
|
|
211
|
+
web3Networks: '',
|
|
212
|
+
contractFramework: '',
|
|
213
|
+
notes: []
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
if (expectedUsers === '2' || expectedUsers.includes('small')) {
|
|
217
|
+
recommendation.database = 'MySQL';
|
|
218
|
+
}
|
|
219
|
+
if (expectedUsers === '3' || expectedUsers.includes('external')) {
|
|
220
|
+
recommendation.database = 'PostgreSQL';
|
|
221
|
+
recommendation.services.push('Queues (Redis/Horizon)');
|
|
222
|
+
recommendation.services.push('Transactional Email');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (mobileNeed === '1' || mobileNeed.includes('app')) {
|
|
226
|
+
recommendation.frontend = 'Next.js';
|
|
227
|
+
recommendation.notes.push('Mobile-first requirement detected; consider React Native/Expo as follow-up.');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (hosting === '2' || hosting.includes('vps')) {
|
|
231
|
+
recommendation.notes.push('VPS preference detected; keep deployment scripts simple and reproducible.');
|
|
232
|
+
}
|
|
233
|
+
if (hosting === '3' || hosting.includes('cloud')) {
|
|
234
|
+
recommendation.database = recommendation.database === 'SQLite' ? 'PostgreSQL' : recommendation.database;
|
|
235
|
+
recommendation.services.push('Storage (S3-compatible)');
|
|
236
|
+
recommendation.notes.push('Cloud profile detected; use managed DB and object storage from day one.');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (/wallet|token|nft|blockchain|web3|smart contract/i.test(summary)) {
|
|
240
|
+
recommendation.projectType = 'dapp';
|
|
241
|
+
recommendation.framework = 'Hardhat';
|
|
242
|
+
recommendation.backend = 'Hardhat';
|
|
243
|
+
recommendation.frontend = 'Next.js';
|
|
244
|
+
recommendation.auth = 'Custom';
|
|
245
|
+
recommendation.database = 'PostgreSQL';
|
|
246
|
+
recommendation.web3Enabled = true;
|
|
247
|
+
recommendation.web3Networks = 'ethereum';
|
|
248
|
+
recommendation.contractFramework = 'Hardhat';
|
|
249
|
+
recommendation.services = ['Payments', 'Cache (Redis)'];
|
|
250
|
+
recommendation.notes.push('Web3 terms detected; dApp starter recommendation applied.');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
recommendation.services = recommendation.services.filter(
|
|
254
|
+
(value, index, arr) => arr.indexOf(value) === index
|
|
255
|
+
);
|
|
256
|
+
recommendation.notes.push('This recommendation is a starter profile; adjust once requirements are clearer.');
|
|
257
|
+
return recommendation;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function buildTeamProfile(input = {}) {
|
|
261
|
+
const framework = normalizeText(input.framework || input.backend || 'Node/Express');
|
|
262
|
+
const projectType = normalizeChoice(
|
|
263
|
+
input.projectType,
|
|
264
|
+
{ web_app: 'web_app', dapp: 'dapp', api: 'api', site: 'site', script: 'script' },
|
|
265
|
+
inferProjectTypeFromFramework(framework)
|
|
266
|
+
);
|
|
267
|
+
const web3Enabled = projectType === 'dapp' || String(input.web3Enabled).toLowerCase() === 'true';
|
|
268
|
+
return {
|
|
269
|
+
profile: 'team',
|
|
270
|
+
projectType,
|
|
271
|
+
framework,
|
|
272
|
+
backend: normalizeText(input.backend || framework),
|
|
273
|
+
frontend: normalizeText(input.frontend || ''),
|
|
274
|
+
auth: normalizeText(input.auth || ''),
|
|
275
|
+
uiux: normalizeText(input.uiux || ''),
|
|
276
|
+
database: normalizeText(input.database || ''),
|
|
277
|
+
services: parseServices(input.services || ''),
|
|
278
|
+
web3Enabled,
|
|
279
|
+
web3Networks: normalizeText(
|
|
280
|
+
input.web3Networks || (web3Enabled ? inferWeb3NetworkFromFramework(framework) : '')
|
|
281
|
+
),
|
|
282
|
+
contractFramework: normalizeText(
|
|
283
|
+
input.contractFramework || (web3Enabled ? framework : '')
|
|
284
|
+
),
|
|
285
|
+
notes: ['Team profile selected; preserve explicit team conventions and CI rules.']
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
module.exports = {
|
|
290
|
+
BACKEND_CHOICES,
|
|
291
|
+
FRONTEND_CHOICES,
|
|
292
|
+
AUTH_CHOICES,
|
|
293
|
+
UIUX_CHOICES,
|
|
294
|
+
DATABASE_CHOICES,
|
|
295
|
+
PROFILE_CHOICES,
|
|
296
|
+
SERVICE_CHOICES,
|
|
297
|
+
normalizeChoice,
|
|
298
|
+
normalizeProfile,
|
|
299
|
+
parseServices,
|
|
300
|
+
inferProjectTypeFromFramework,
|
|
301
|
+
inferWeb3NetworkFromFramework,
|
|
302
|
+
buildDeveloperProfile,
|
|
303
|
+
recommendBeginnerProfile,
|
|
304
|
+
buildTeamProfile
|
|
305
|
+
};
|
package/src/parser.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function parseArgv(argv) {
|
|
4
|
+
const [, , ...tokens] = argv;
|
|
5
|
+
const args = [];
|
|
6
|
+
const options = {};
|
|
7
|
+
let command = 'help';
|
|
8
|
+
|
|
9
|
+
for (let i = 0; i < tokens.length; i += 1) {
|
|
10
|
+
const token = tokens[i];
|
|
11
|
+
|
|
12
|
+
if (token.startsWith('--')) {
|
|
13
|
+
const [k, v] = token.replace(/^--/, '').split('=');
|
|
14
|
+
if (v !== undefined) {
|
|
15
|
+
options[k] = v;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const next = tokens[i + 1];
|
|
20
|
+
if (next && !next.startsWith('-')) {
|
|
21
|
+
options[k] = next;
|
|
22
|
+
i += 1;
|
|
23
|
+
} else {
|
|
24
|
+
options[k] = true;
|
|
25
|
+
}
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (token.startsWith('-')) {
|
|
30
|
+
const shortFlags = token.replace(/^-/, '').split('');
|
|
31
|
+
for (const flag of shortFlags) {
|
|
32
|
+
if (flag === 'f') options.force = true;
|
|
33
|
+
if (flag === 'd') options['dry-run'] = true;
|
|
34
|
+
if (flag === 'h') options.help = true;
|
|
35
|
+
if (flag === 'j') options.json = true;
|
|
36
|
+
if (flag === 'v') options.version = true;
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (command === 'help') {
|
|
42
|
+
command = token;
|
|
43
|
+
} else {
|
|
44
|
+
args.push(token);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return { command, args, options };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = {
|
|
52
|
+
parseArgv
|
|
53
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SUPPORTED_PROMPT_TOOLS = new Set(['codex', 'claude', 'gemini', 'opencode']);
|
|
4
|
+
|
|
5
|
+
function resolvePromptTool(value) {
|
|
6
|
+
const normalized = String(value || '')
|
|
7
|
+
.trim()
|
|
8
|
+
.toLowerCase();
|
|
9
|
+
|
|
10
|
+
if (SUPPORTED_PROMPT_TOOLS.has(normalized)) {
|
|
11
|
+
return normalized;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return 'codex';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
SUPPORTED_PROMPT_TOOLS,
|
|
19
|
+
resolvePromptTool
|
|
20
|
+
};
|