@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
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
const os = require('node:os');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const { ensureDir } = require('../utils');
|
|
7
|
+
const { runInstall } = require('./install');
|
|
8
|
+
const { runSetupContext } = require('./setup-context');
|
|
9
|
+
const { runLocaleApply } = require('./locale-apply');
|
|
10
|
+
const { runAgentsList, runAgentPrompt } = require('./agents');
|
|
11
|
+
const { runContextValidate } = require('./context-validate');
|
|
12
|
+
const { runDoctor } = require('../doctor');
|
|
13
|
+
const { runUpdate } = require('./update');
|
|
14
|
+
const { detectFramework } = require('../detector');
|
|
15
|
+
const { validateProjectContextFile } = require('../context');
|
|
16
|
+
const { runParallelInit } = require('./parallel-init');
|
|
17
|
+
const { runParallelAssign } = require('./parallel-assign');
|
|
18
|
+
const { runParallelStatus } = require('./parallel-status');
|
|
19
|
+
const { runParallelDoctor } = require('./parallel-doctor');
|
|
20
|
+
|
|
21
|
+
const WEB3_SMOKE_TARGETS = ['ethereum', 'solana', 'cardano'];
|
|
22
|
+
const SMOKE_PROFILES = ['standard', 'mixed', 'parallel'];
|
|
23
|
+
const WEB3_PROFILE_BY_TARGET = {
|
|
24
|
+
ethereum: {
|
|
25
|
+
framework: 'Hardhat',
|
|
26
|
+
network: 'ethereum',
|
|
27
|
+
seedPackage: {
|
|
28
|
+
name: 'demo-dapp',
|
|
29
|
+
devDependencies: { hardhat: '^2.24.0' }
|
|
30
|
+
},
|
|
31
|
+
files: [{ path: 'hardhat.config.ts', content: 'export default {};\n' }]
|
|
32
|
+
},
|
|
33
|
+
solana: {
|
|
34
|
+
framework: 'Anchor',
|
|
35
|
+
network: 'solana',
|
|
36
|
+
seedPackage: {
|
|
37
|
+
name: 'demo-dapp',
|
|
38
|
+
dependencies: { '@coral-xyz/anchor': '^0.30.1' }
|
|
39
|
+
},
|
|
40
|
+
files: [{ path: 'Anchor.toml', content: '[provider]\ncluster="devnet"\n' }]
|
|
41
|
+
},
|
|
42
|
+
cardano: {
|
|
43
|
+
framework: 'Cardano',
|
|
44
|
+
network: 'cardano',
|
|
45
|
+
seedPackage: {
|
|
46
|
+
name: 'demo-dapp',
|
|
47
|
+
dependencies: { 'lucid-cardano': '^0.10.11' }
|
|
48
|
+
},
|
|
49
|
+
files: [{ path: 'aiken.toml', content: 'name = "demo"\nversion = "0.1.0"\n' }]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function createQuietLogger() {
|
|
54
|
+
return {
|
|
55
|
+
log() {},
|
|
56
|
+
error() {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function assertStep(condition, t, key, params = {}) {
|
|
61
|
+
if (!condition) {
|
|
62
|
+
throw new Error(t(key, params));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function normalizeWeb3Target(raw) {
|
|
67
|
+
const value = String(raw || '').trim().toLowerCase();
|
|
68
|
+
if (!value) return '';
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function resolveWeb3Profile(rawTarget) {
|
|
73
|
+
const target = normalizeWeb3Target(rawTarget);
|
|
74
|
+
if (!target) return null;
|
|
75
|
+
if (!WEB3_SMOKE_TARGETS.includes(target)) return { invalid: true, target };
|
|
76
|
+
return {
|
|
77
|
+
target,
|
|
78
|
+
...WEB3_PROFILE_BY_TARGET[target]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function seedWeb3Workspace(projectDir, profile) {
|
|
83
|
+
const pkgPath = path.join(projectDir, 'package.json');
|
|
84
|
+
await fs.writeFile(pkgPath, `${JSON.stringify(profile.seedPackage, null, 2)}\n`, 'utf8');
|
|
85
|
+
for (const file of profile.files) {
|
|
86
|
+
await fs.writeFile(path.join(projectDir, file.path), file.content, 'utf8');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function seedMixedWorkspace(projectDir) {
|
|
91
|
+
const rootPackage = {
|
|
92
|
+
name: 'demo-monorepo',
|
|
93
|
+
private: true,
|
|
94
|
+
workspaces: ['apps/web', 'packages/contracts'],
|
|
95
|
+
dependencies: {
|
|
96
|
+
next: '^15.0.0'
|
|
97
|
+
},
|
|
98
|
+
devDependencies: {
|
|
99
|
+
hardhat: '^2.24.0'
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
await ensureDir(path.join(projectDir, 'apps/web'));
|
|
104
|
+
await ensureDir(path.join(projectDir, 'packages/contracts'));
|
|
105
|
+
|
|
106
|
+
await fs.writeFile(path.join(projectDir, 'package.json'), `${JSON.stringify(rootPackage, null, 2)}\n`, 'utf8');
|
|
107
|
+
await fs.writeFile(path.join(projectDir, 'next.config.js'), 'module.exports = {};\n', 'utf8');
|
|
108
|
+
await fs.writeFile(path.join(projectDir, 'hardhat.config.ts'), 'export default {};\n', 'utf8');
|
|
109
|
+
|
|
110
|
+
await fs.writeFile(
|
|
111
|
+
path.join(projectDir, 'apps/web/package.json'),
|
|
112
|
+
`${JSON.stringify({ name: '@demo/web', private: true, dependencies: { next: '^15.0.0' } }, null, 2)}\n`,
|
|
113
|
+
'utf8'
|
|
114
|
+
);
|
|
115
|
+
await fs.writeFile(
|
|
116
|
+
path.join(projectDir, 'packages/contracts/package.json'),
|
|
117
|
+
`${JSON.stringify({ name: '@demo/contracts', private: true, devDependencies: { hardhat: '^2.24.0' } }, null, 2)}\n`,
|
|
118
|
+
'utf8'
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function seedParallelContextDocs(projectDir) {
|
|
123
|
+
const contextDir = path.join(projectDir, '.aioson/context');
|
|
124
|
+
await ensureDir(contextDir);
|
|
125
|
+
|
|
126
|
+
const discovery = `# Discovery
|
|
127
|
+
|
|
128
|
+
## Scope candidates
|
|
129
|
+
- Authentication
|
|
130
|
+
- Billing
|
|
131
|
+
- Notifications
|
|
132
|
+
`;
|
|
133
|
+
const architecture = `# Architecture
|
|
134
|
+
|
|
135
|
+
## Authentication Module
|
|
136
|
+
## Billing Module
|
|
137
|
+
## Notification Pipeline
|
|
138
|
+
`;
|
|
139
|
+
const prd = `# PRD
|
|
140
|
+
|
|
141
|
+
## Modules
|
|
142
|
+
- Authentication
|
|
143
|
+
- Billing
|
|
144
|
+
- Notifications
|
|
145
|
+
`;
|
|
146
|
+
|
|
147
|
+
await fs.writeFile(path.join(contextDir, 'discovery.md'), discovery, 'utf8');
|
|
148
|
+
await fs.writeFile(path.join(contextDir, 'architecture.md'), architecture, 'utf8');
|
|
149
|
+
await fs.writeFile(path.join(contextDir, 'prd.md'), prd, 'utf8');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function runSmokeTest({ args, options, logger, t }) {
|
|
153
|
+
const language = String(options.language || options.lang || 'en');
|
|
154
|
+
const keep = Boolean(options.keep);
|
|
155
|
+
const jsonMode = Boolean(options.json);
|
|
156
|
+
const smokeProfile = String(options.profile || 'standard').trim().toLowerCase();
|
|
157
|
+
if (!SMOKE_PROFILES.includes(smokeProfile)) {
|
|
158
|
+
throw new Error(t('smoke.invalid_profile', { profile: smokeProfile }));
|
|
159
|
+
}
|
|
160
|
+
const web3Profile = resolveWeb3Profile(options.web3);
|
|
161
|
+
if (web3Profile && web3Profile.invalid) {
|
|
162
|
+
throw new Error(t('smoke.invalid_web3_target', { target: web3Profile.target }));
|
|
163
|
+
}
|
|
164
|
+
if (smokeProfile === 'mixed' && web3Profile) {
|
|
165
|
+
throw new Error(t('smoke.profile_conflict'));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const baseDir = path.resolve(process.cwd(), args[0] || os.tmpdir());
|
|
169
|
+
await ensureDir(baseDir);
|
|
170
|
+
|
|
171
|
+
const workspaceRoot = await fs.mkdtemp(path.join(baseDir, 'aioson-smoke-'));
|
|
172
|
+
const projectDir = path.join(workspaceRoot, 'demo');
|
|
173
|
+
await ensureDir(projectDir);
|
|
174
|
+
|
|
175
|
+
const steps = [];
|
|
176
|
+
const quietLogger = createQuietLogger();
|
|
177
|
+
const log = jsonMode ? () => {} : logger.log.bind(logger);
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
log(t('smoke.start', { projectDir }));
|
|
181
|
+
if (web3Profile) {
|
|
182
|
+
log(t('smoke.using_web3_profile', { target: web3Profile.target }));
|
|
183
|
+
await seedWeb3Workspace(projectDir, web3Profile);
|
|
184
|
+
steps.push(`seed:web3:${web3Profile.target}`);
|
|
185
|
+
log(t('smoke.seeded_web3_workspace', { target: web3Profile.target }));
|
|
186
|
+
} else if (smokeProfile === 'mixed') {
|
|
187
|
+
log(t('smoke.using_mixed_profile'));
|
|
188
|
+
await seedMixedWorkspace(projectDir);
|
|
189
|
+
steps.push('seed:mixed');
|
|
190
|
+
log(t('smoke.seeded_mixed_workspace'));
|
|
191
|
+
} else if (smokeProfile === 'parallel') {
|
|
192
|
+
log(t('smoke.using_parallel_profile'));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const installResult = await runInstall({
|
|
196
|
+
args: [projectDir],
|
|
197
|
+
options: {},
|
|
198
|
+
logger: quietLogger,
|
|
199
|
+
t
|
|
200
|
+
});
|
|
201
|
+
assertStep(installResult.copied.length > 0, t, 'smoke.assert_install_files');
|
|
202
|
+
steps.push('install');
|
|
203
|
+
log(t('smoke.step_ok', { step: 'install' }));
|
|
204
|
+
|
|
205
|
+
if (web3Profile) {
|
|
206
|
+
const detection = await detectFramework(projectDir);
|
|
207
|
+
assertStep(
|
|
208
|
+
detection.framework === web3Profile.framework,
|
|
209
|
+
t,
|
|
210
|
+
'smoke.assert_web3_framework',
|
|
211
|
+
{ framework: detection.framework }
|
|
212
|
+
);
|
|
213
|
+
steps.push(`detect:web3:${web3Profile.target}`);
|
|
214
|
+
log(
|
|
215
|
+
t('smoke.web3_detected', {
|
|
216
|
+
framework: detection.framework,
|
|
217
|
+
network: web3Profile.network
|
|
218
|
+
})
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const setupResult = await runSetupContext({
|
|
223
|
+
args: [projectDir],
|
|
224
|
+
options: {
|
|
225
|
+
defaults: true,
|
|
226
|
+
'project-name': 'demo',
|
|
227
|
+
language,
|
|
228
|
+
...(web3Profile || smokeProfile === 'mixed'
|
|
229
|
+
? {}
|
|
230
|
+
: {
|
|
231
|
+
'project-type': 'web_app',
|
|
232
|
+
profile: 'developer',
|
|
233
|
+
framework: 'Node',
|
|
234
|
+
'framework-installed': true
|
|
235
|
+
}),
|
|
236
|
+
...(smokeProfile === 'parallel'
|
|
237
|
+
? {
|
|
238
|
+
classification: 'MEDIUM'
|
|
239
|
+
}
|
|
240
|
+
: {})
|
|
241
|
+
},
|
|
242
|
+
logger: quietLogger,
|
|
243
|
+
t
|
|
244
|
+
});
|
|
245
|
+
assertStep(Boolean(setupResult.filePath), t, 'smoke.assert_setup_written');
|
|
246
|
+
if (web3Profile) {
|
|
247
|
+
assertStep(setupResult.data.projectType === 'dapp', t, 'smoke.assert_setup_project_type_dapp');
|
|
248
|
+
assertStep(
|
|
249
|
+
String(setupResult.data.web3Networks || '').includes(web3Profile.network),
|
|
250
|
+
t,
|
|
251
|
+
'smoke.assert_setup_web3_network'
|
|
252
|
+
);
|
|
253
|
+
assertStep(
|
|
254
|
+
setupResult.data.framework === web3Profile.framework,
|
|
255
|
+
t,
|
|
256
|
+
'smoke.assert_setup_web3_framework'
|
|
257
|
+
);
|
|
258
|
+
} else if (smokeProfile === 'mixed') {
|
|
259
|
+
assertStep(setupResult.data.projectType === 'dapp', t, 'smoke.assert_mixed_project_type_dapp');
|
|
260
|
+
assertStep(setupResult.data.web3Enabled === true, t, 'smoke.assert_mixed_web3_enabled');
|
|
261
|
+
assertStep(setupResult.data.framework === 'Hardhat', t, 'smoke.assert_mixed_framework');
|
|
262
|
+
steps.push('verify:mixed-context');
|
|
263
|
+
log(t('smoke.mixed_context_verified', { framework: setupResult.data.framework }));
|
|
264
|
+
}
|
|
265
|
+
steps.push('setup:context');
|
|
266
|
+
log(t('smoke.step_ok', { step: 'setup:context' }));
|
|
267
|
+
|
|
268
|
+
const localeResult = await runLocaleApply({
|
|
269
|
+
args: [projectDir],
|
|
270
|
+
options: { lang: language },
|
|
271
|
+
logger: quietLogger,
|
|
272
|
+
t
|
|
273
|
+
});
|
|
274
|
+
assertStep(localeResult.copied.length > 0, t, 'smoke.assert_locale_apply_files');
|
|
275
|
+
steps.push('locale:apply');
|
|
276
|
+
log(t('smoke.step_ok', { step: 'locale:apply' }));
|
|
277
|
+
|
|
278
|
+
const agentsResult = await runAgentsList({
|
|
279
|
+
args: [projectDir],
|
|
280
|
+
options: { lang: language },
|
|
281
|
+
logger: quietLogger,
|
|
282
|
+
t
|
|
283
|
+
});
|
|
284
|
+
assertStep(agentsResult.count >= 7, t, 'smoke.assert_agents_count');
|
|
285
|
+
steps.push('agents');
|
|
286
|
+
log(t('smoke.step_ok', { step: 'agents' }));
|
|
287
|
+
|
|
288
|
+
const promptResult = await runAgentPrompt({
|
|
289
|
+
args: ['setup', projectDir],
|
|
290
|
+
options: { tool: 'codex', lang: language },
|
|
291
|
+
logger: quietLogger,
|
|
292
|
+
t
|
|
293
|
+
});
|
|
294
|
+
assertStep(
|
|
295
|
+
promptResult.prompt.includes('.aioson'),
|
|
296
|
+
t,
|
|
297
|
+
'smoke.assert_prompt_path'
|
|
298
|
+
);
|
|
299
|
+
steps.push('agent:prompt');
|
|
300
|
+
log(t('smoke.step_ok', { step: 'agent:prompt' }));
|
|
301
|
+
|
|
302
|
+
const contextResult = await runContextValidate({
|
|
303
|
+
args: [projectDir],
|
|
304
|
+
options: {},
|
|
305
|
+
logger: quietLogger,
|
|
306
|
+
t
|
|
307
|
+
});
|
|
308
|
+
assertStep(contextResult.ok, t, 'smoke.assert_context_validate');
|
|
309
|
+
steps.push('context:validate');
|
|
310
|
+
log(t('smoke.step_ok', { step: 'context:validate' }));
|
|
311
|
+
|
|
312
|
+
if (web3Profile) {
|
|
313
|
+
const parsedContext = await validateProjectContextFile(projectDir);
|
|
314
|
+
assertStep(parsedContext.valid, t, 'smoke.assert_web3_context_valid');
|
|
315
|
+
assertStep(parsedContext.data.project_type === 'dapp', t, 'smoke.assert_web3_context_project_type');
|
|
316
|
+
assertStep(parsedContext.data.web3_enabled === true, t, 'smoke.assert_web3_context_enabled');
|
|
317
|
+
assertStep(
|
|
318
|
+
String(parsedContext.data.web3_networks || '').includes(web3Profile.network),
|
|
319
|
+
t,
|
|
320
|
+
'smoke.assert_web3_context_network'
|
|
321
|
+
);
|
|
322
|
+
steps.push(`verify:web3-context:${web3Profile.target}`);
|
|
323
|
+
log(t('smoke.web3_context_verified', { network: web3Profile.network }));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const doctorResult = await runDoctor(projectDir);
|
|
327
|
+
assertStep(doctorResult.ok, t, 'smoke.assert_doctor_ok');
|
|
328
|
+
steps.push('doctor');
|
|
329
|
+
log(t('smoke.step_ok', { step: 'doctor' }));
|
|
330
|
+
|
|
331
|
+
if (smokeProfile === 'parallel') {
|
|
332
|
+
await seedParallelContextDocs(projectDir);
|
|
333
|
+
steps.push('seed:parallel-context');
|
|
334
|
+
log(t('smoke.seeded_parallel_context'));
|
|
335
|
+
|
|
336
|
+
const parallelInit = await runParallelInit({
|
|
337
|
+
args: [projectDir],
|
|
338
|
+
options: { workers: 3 },
|
|
339
|
+
logger: quietLogger,
|
|
340
|
+
t
|
|
341
|
+
});
|
|
342
|
+
assertStep(parallelInit.ok, t, 'smoke.assert_parallel_init_ok');
|
|
343
|
+
assertStep(parallelInit.workers === 3, t, 'smoke.assert_parallel_init_workers');
|
|
344
|
+
steps.push('parallel:init');
|
|
345
|
+
log(t('smoke.step_ok', { step: 'parallel:init' }));
|
|
346
|
+
|
|
347
|
+
const parallelAssign = await runParallelAssign({
|
|
348
|
+
args: [projectDir],
|
|
349
|
+
options: { source: 'architecture', workers: 3 },
|
|
350
|
+
logger: quietLogger,
|
|
351
|
+
t
|
|
352
|
+
});
|
|
353
|
+
assertStep(parallelAssign.ok, t, 'smoke.assert_parallel_assign_ok');
|
|
354
|
+
assertStep(parallelAssign.scopeCount > 0, t, 'smoke.assert_parallel_assign_scope');
|
|
355
|
+
steps.push('parallel:assign');
|
|
356
|
+
log(t('smoke.step_ok', { step: 'parallel:assign' }));
|
|
357
|
+
|
|
358
|
+
const parallelStatus = await runParallelStatus({
|
|
359
|
+
args: [projectDir],
|
|
360
|
+
options: {},
|
|
361
|
+
logger: quietLogger,
|
|
362
|
+
t
|
|
363
|
+
});
|
|
364
|
+
assertStep(parallelStatus.ok, t, 'smoke.assert_parallel_status_ok');
|
|
365
|
+
assertStep(parallelStatus.laneCount === 3, t, 'smoke.assert_parallel_status_lanes');
|
|
366
|
+
steps.push('parallel:status');
|
|
367
|
+
log(t('smoke.parallel_status_verified', { count: parallelStatus.laneCount }));
|
|
368
|
+
|
|
369
|
+
const parallelDoctor = await runParallelDoctor({
|
|
370
|
+
args: [projectDir],
|
|
371
|
+
options: { workers: 3 },
|
|
372
|
+
logger: quietLogger,
|
|
373
|
+
t
|
|
374
|
+
});
|
|
375
|
+
assertStep(parallelDoctor.ok, t, 'smoke.assert_parallel_doctor_ok');
|
|
376
|
+
assertStep(parallelDoctor.summary.failed === 0, t, 'smoke.assert_parallel_doctor_summary');
|
|
377
|
+
steps.push('parallel:doctor');
|
|
378
|
+
log(t('smoke.step_ok', { step: 'parallel:doctor' }));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
await runUpdate({
|
|
382
|
+
args: [projectDir],
|
|
383
|
+
options: {},
|
|
384
|
+
logger: quietLogger,
|
|
385
|
+
t
|
|
386
|
+
});
|
|
387
|
+
steps.push('update');
|
|
388
|
+
log(t('smoke.step_ok', { step: 'update' }));
|
|
389
|
+
|
|
390
|
+
const output = {
|
|
391
|
+
ok: true,
|
|
392
|
+
language,
|
|
393
|
+
targetDir: projectDir,
|
|
394
|
+
web3Target: web3Profile ? web3Profile.target : null,
|
|
395
|
+
profile: smokeProfile,
|
|
396
|
+
steps,
|
|
397
|
+
stepCount: steps.length,
|
|
398
|
+
workspaceRoot,
|
|
399
|
+
projectDir,
|
|
400
|
+
kept: keep
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
if (jsonMode) {
|
|
404
|
+
return output;
|
|
405
|
+
}
|
|
406
|
+
logger.log(t('smoke.completed'));
|
|
407
|
+
logger.log(t('smoke.steps_count', { count: steps.length }));
|
|
408
|
+
|
|
409
|
+
return output;
|
|
410
|
+
} finally {
|
|
411
|
+
if (!keep) {
|
|
412
|
+
await fs.rm(workspaceRoot, { recursive: true, force: true });
|
|
413
|
+
if (!jsonMode) {
|
|
414
|
+
logger.log(t('smoke.workspace_removed', { path: workspaceRoot }));
|
|
415
|
+
}
|
|
416
|
+
} else {
|
|
417
|
+
if (!jsonMode) {
|
|
418
|
+
logger.log(t('smoke.workspace_kept', { path: workspaceRoot }));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
module.exports = {
|
|
425
|
+
runSmokeTest
|
|
426
|
+
};
|