agentic-dev 0.1.0 → 0.2.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/.agent/prd.json +29 -0
- package/.agent/progress.txt +1 -0
- package/.agent/prompt.md +21 -0
- package/.agent/ralph-loop-state.json +13 -0
- package/.agent/ralph-supervisor-state.json +12 -0
- package/.agent/ralph-supervisor.sh +238 -0
- package/.agent/ralph.sh +305 -0
- package/.agent/runs/README.md +7 -0
- package/.agent/sdd-build-ast-audit.json +13 -0
- package/.claude/CLAUDE.md +44 -0
- package/.claude/agentic-dev.json +3 -0
- package/.claude/agents/ai-dev.md +27 -0
- package/.claude/agents/backend-dev.md +26 -0
- package/.claude/agents/db-dev.md +26 -0
- package/.claude/agents/devops.md +27 -0
- package/.claude/agents/frontend-dev.md +25 -0
- package/.claude/agents/github-ops.md +25 -0
- package/.claude/agents/test-dev.md +26 -0
- package/.claude/agents/uiux-designer.md +25 -0
- package/.claude/settings.json +49 -0
- package/.claude/settings.local.json +8 -0
- package/.claude/skills/commit/SKILL.md +37 -0
- package/.claude/skills/dev-browser/SKILL.md +30 -0
- package/.claude/skills/otro/SKILL.md +43 -0
- package/.claude/skills/planning-with-files/SKILL.md +37 -0
- package/.claude/skills/prd/SKILL.md +27 -0
- package/.claude/skills/ralph-loop/SKILL.md +42 -0
- package/.claude/skills/sdd/SKILL.md +13 -0
- package/.claude/skills/sdd-dev/SKILL.md +71 -0
- package/.claude/skills/sdd-development/SKILL.md +13 -0
- package/.claude/workspace-config.json +3 -0
- package/.codex/agentic-dev.json +3 -0
- package/.codex/agents/README.md +22 -0
- package/.codex/agents/api.toml +11 -0
- package/.codex/agents/architecture.toml +11 -0
- package/.codex/agents/ci.toml +11 -0
- package/.codex/agents/gitops.toml +11 -0
- package/.codex/agents/orchestrator.toml +11 -0
- package/.codex/agents/quality.toml +11 -0
- package/.codex/agents/runtime.toml +11 -0
- package/.codex/agents/security.toml +11 -0
- package/.codex/agents/specs.toml +11 -0
- package/.codex/agents/ui.toml +11 -0
- package/.codex/config.toml +46 -0
- package/.codex/skills/SKILL.md +13 -0
- package/.codex/skills/agents/openai.yaml +4 -0
- package/.codex/skills/commit/SKILL.md +219 -0
- package/.codex/skills/commit/references/commit_examples.md +292 -0
- package/.codex/skills/dev-browser/SKILL.md +211 -0
- package/.codex/skills/dev-browser/bun.lock +443 -0
- package/.codex/skills/dev-browser/package-lock.json +2988 -0
- package/.codex/skills/dev-browser/package.json +31 -0
- package/.codex/skills/dev-browser/references/scraping.md +155 -0
- package/.codex/skills/dev-browser/scripts/start-relay.ts +32 -0
- package/.codex/skills/dev-browser/scripts/start-server.ts +117 -0
- package/.codex/skills/dev-browser/server.sh +24 -0
- package/.codex/skills/dev-browser/src/client.ts +474 -0
- package/.codex/skills/dev-browser/src/index.ts +287 -0
- package/.codex/skills/dev-browser/src/relay.ts +731 -0
- package/.codex/skills/dev-browser/src/snapshot/__tests__/snapshot.test.ts +223 -0
- package/.codex/skills/dev-browser/src/snapshot/browser-script.ts +877 -0
- package/.codex/skills/dev-browser/src/snapshot/index.ts +14 -0
- package/.codex/skills/dev-browser/src/snapshot/inject.ts +13 -0
- package/.codex/skills/dev-browser/src/types.ts +34 -0
- package/.codex/skills/dev-browser/tsconfig.json +36 -0
- package/.codex/skills/dev-browser/vitest.config.ts +12 -0
- package/.codex/skills/otro/SKILL.md +74 -0
- package/.codex/skills/otro/agents/openai.yaml +4 -0
- package/.codex/skills/otro/references/agent-prompts.md +61 -0
- package/.codex/skills/otro/references/contracts.md +146 -0
- package/.codex/skills/otro/references/orchestration-loop.md +51 -0
- package/.codex/skills/otro/references/runtime.md +79 -0
- package/.codex/skills/otro/runs/README.md +11 -0
- package/.codex/skills/otro/schemas/step_plan.schema.json +289 -0
- package/.codex/skills/otro/schemas/task_result.schema.json +142 -0
- package/.codex/skills/otro/schemas/wave_plan.schema.json +4 -0
- package/.codex/skills/otro/scripts/README.md +38 -0
- package/.codex/skills/otro/scripts/bump_validation_header.py +179 -0
- package/.codex/skills/otro/scripts/check_validation_header.py +84 -0
- package/.codex/skills/otro/scripts/common.py +303 -0
- package/.codex/skills/otro/scripts/init_run.sh +68 -0
- package/.codex/skills/otro/scripts/plan_loop.py +8 -0
- package/.codex/skills/otro/scripts/plan_step.py +367 -0
- package/.codex/skills/otro/scripts/plan_wave.py +8 -0
- package/.codex/skills/otro/scripts/reconcile_loop.py +8 -0
- package/.codex/skills/otro/scripts/reconcile_step.py +37 -0
- package/.codex/skills/otro/scripts/reconcile_wave.py +8 -0
- package/.codex/skills/otro/scripts/run_loop.py +300 -0
- package/.codex/skills/otro/scripts/run_loop_step.py +8 -0
- package/.codex/skills/otro/scripts/run_step.py +246 -0
- package/.codex/skills/otro/scripts/run_wave.py +8 -0
- package/.codex/skills/otro/validation/validation.md +15 -0
- package/.codex/skills/planning-with-files/SKILL.md +42 -0
- package/.codex/skills/planning-with-files/agents/openai.yaml +4 -0
- package/.codex/skills/planning-with-files/assets/plan-template.md +37 -0
- package/.codex/skills/planning-with-files/references/plan-rules.md +35 -0
- package/.codex/skills/planning-with-files/scripts/new_plan.sh +65 -0
- package/.codex/skills/prd/SKILL.md +235 -0
- package/.codex/skills/ralph-loop/SKILL.md +46 -0
- package/.codex/skills/ralph-loop/agents/openai.yaml +4 -0
- package/.codex/skills/ralph-loop/references/failure-triage.md +32 -0
- package/.codex/skills/ralph-loop/scripts/loop_until_success.sh +97 -0
- package/.codex/skills/sdd/SKILL.md +184 -0
- package/.codex/skills/sdd/agents/openai.yaml +4 -0
- package/.codex/skills/sdd/references/section-map.md +67 -0
- package/.dockerignore +8 -0
- package/.env.example +50 -0
- package/.gitignore +16 -0
- package/AGENTS.md +78 -0
- package/README.md +83 -47
- package/SDD_SKILL.md +589 -0
- package/bin/agentic-dev.mjs +97 -0
- package/client/admin/.dockerignore +3 -0
- package/client/admin/.env.example +1 -0
- package/client/admin/Dockerfile +16 -0
- package/client/admin/Dockerfile.dev +18 -0
- package/client/admin/README.md +20 -0
- package/client/admin/index.html +12 -0
- package/client/admin/package.json +41 -0
- package/client/admin/postcss.config.js +6 -0
- package/client/admin/scripts/ui-parity-admin-adapter.mjs +65 -0
- package/client/admin/src/api/alerts.ts +33 -0
- package/client/admin/src/api/client.ts +71 -0
- package/client/admin/src/api/orders.ts +33 -0
- package/client/admin/src/api/support.ts +11 -0
- package/client/admin/src/app/App.tsx +23 -0
- package/client/admin/src/auth/AuthProvider.tsx +122 -0
- package/client/admin/src/auth/ProtectedRoute.tsx +22 -0
- package/client/admin/src/auth/auth-client.ts +38 -0
- package/client/admin/src/auth/types.ts +18 -0
- package/client/admin/src/components/AdminNotificationsDrawer.tsx +162 -0
- package/client/admin/src/components/AdminShell.tsx +76 -0
- package/client/admin/src/components/ui/button.tsx +34 -0
- package/client/admin/src/components/ui/input.tsx +21 -0
- package/client/admin/src/lib/cn.ts +6 -0
- package/client/admin/src/lib/specRouteCatalog.json +30 -0
- package/client/admin/src/lib/specScreens.json +22 -0
- package/client/admin/src/main.tsx +17 -0
- package/client/admin/src/pages/AdminDashboardPage.tsx +171 -0
- package/client/admin/src/pages/AdminLoginPage.tsx +75 -0
- package/client/admin/src/pages/AdminQueuePage.tsx +107 -0
- package/client/admin/src/pages/AdminSupportPage.tsx +61 -0
- package/client/admin/src/styles/globals.css +17 -0
- package/client/admin/src/theme-vars.ts +18 -0
- package/client/admin/src/theme.ts +25 -0
- package/client/admin/src/vite-env.d.ts +1 -0
- package/client/admin/tailwind.config.js +8 -0
- package/client/admin/tsconfig.json +25 -0
- package/client/admin/vite.config.ts +12 -0
- package/client/landing/.dockerignore +3 -0
- package/client/landing/.env.example +1 -0
- package/client/landing/Dockerfile +16 -0
- package/client/landing/Dockerfile.dev +18 -0
- package/client/landing/README.md +18 -0
- package/client/landing/index.html +12 -0
- package/client/landing/package.json +41 -0
- package/client/landing/postcss.config.js +6 -0
- package/client/landing/scripts/ui-parity-landing-adapter.mjs +65 -0
- package/client/landing/src/App.tsx +21 -0
- package/client/landing/src/api/catalog.ts +30 -0
- package/client/landing/src/api/client.ts +30 -0
- package/client/landing/src/auth/AuthProvider.tsx +122 -0
- package/client/landing/src/auth/ProtectedRoute.tsx +22 -0
- package/client/landing/src/auth/auth-client.ts +38 -0
- package/client/landing/src/auth/types.ts +18 -0
- package/client/landing/src/components/LandingShell.tsx +34 -0
- package/client/landing/src/lib/specRouteCatalog.json +23 -0
- package/client/landing/src/lib/specScreens.json +17 -0
- package/client/landing/src/main.tsx +17 -0
- package/client/landing/src/pages/LandingHomePage.tsx +215 -0
- package/client/landing/src/pages/LandingLoginPage.tsx +90 -0
- package/client/landing/src/pages/LandingWorkspacePage.tsx +126 -0
- package/client/landing/src/styles/globals.css +17 -0
- package/client/landing/src/theme-vars.ts +16 -0
- package/client/landing/src/theme.ts +21 -0
- package/client/landing/src/vite-env.d.ts +1 -0
- package/client/landing/tailwind.config.js +8 -0
- package/client/landing/tsconfig.json +25 -0
- package/client/landing/vite.config.ts +12 -0
- package/client/mobile/.dockerignore +2 -0
- package/client/mobile/.env.example +1 -0
- package/client/mobile/Dockerfile +16 -0
- package/client/mobile/Dockerfile.dev +18 -0
- package/client/mobile/README.md +19 -0
- package/client/mobile/index.html +12 -0
- package/client/mobile/package.json +42 -0
- package/client/mobile/postcss.config.js +6 -0
- package/client/mobile/scripts/ui-parity-mobile-adapter.mjs +67 -0
- package/client/mobile/src/App.tsx +1 -0
- package/client/mobile/src/api/client.ts +62 -0
- package/client/mobile/src/api/fulfillment.ts +55 -0
- package/client/mobile/src/api/shipping.ts +56 -0
- package/client/mobile/src/app/App.tsx +23 -0
- package/client/mobile/src/auth/AuthProvider.tsx +122 -0
- package/client/mobile/src/auth/ProtectedRoute.tsx +27 -0
- package/client/mobile/src/auth/auth-client.ts +38 -0
- package/client/mobile/src/auth/types.ts +18 -0
- package/client/mobile/src/components/InShell.tsx +74 -0
- package/client/mobile/src/components/ui/button.tsx +35 -0
- package/client/mobile/src/components/ui/card.tsx +15 -0
- package/client/mobile/src/components/ui/input.tsx +21 -0
- package/client/mobile/src/lib/cn.ts +6 -0
- package/client/mobile/src/lib/specRouteCatalog.json +26 -0
- package/client/mobile/src/lib/specScreens.json +22 -0
- package/client/mobile/src/lib/useSpeechRecognitionInput.ts +271 -0
- package/client/mobile/src/main.tsx +17 -0
- package/client/mobile/src/pages/DashboardPage.tsx +172 -0
- package/client/mobile/src/pages/FulfillmentPage.tsx +138 -0
- package/client/mobile/src/pages/LoginPage.tsx +74 -0
- package/client/mobile/src/pages/ShippingPage.tsx +338 -0
- package/client/mobile/src/styles/globals.css +23 -0
- package/client/mobile/src/theme-vars.ts +16 -0
- package/client/mobile/src/theme.ts +21 -0
- package/client/mobile/src/vite-env.d.ts +1 -0
- package/client/mobile/tailwind.config.js +8 -0
- package/client/mobile/tsconfig.json +25 -0
- package/client/mobile/vite.config.ts +12 -0
- package/client/platform/.dockerignore +3 -0
- package/client/platform/.env.example +1 -0
- package/client/platform/Dockerfile +16 -0
- package/client/platform/Dockerfile.dev +18 -0
- package/client/platform/README.md +47 -0
- package/client/platform/index.html +12 -0
- package/client/platform/package.json +42 -0
- package/client/platform/postcss.config.js +6 -0
- package/client/platform/scripts/ui-parity-platform-adapter.mjs +66 -0
- package/client/platform/src/api/client.ts +30 -0
- package/client/platform/src/api/orders.ts +42 -0
- package/client/platform/src/app/App.tsx +21 -0
- package/client/platform/src/auth/AuthProvider.tsx +122 -0
- package/client/platform/src/auth/ProtectedRoute.tsx +22 -0
- package/client/platform/src/auth/auth-client.ts +38 -0
- package/client/platform/src/auth/types.ts +18 -0
- package/client/platform/src/components/AppShell.tsx +59 -0
- package/client/platform/src/components/ui/button.tsx +35 -0
- package/client/platform/src/components/ui/card.tsx +7 -0
- package/client/platform/src/components/ui/input.tsx +21 -0
- package/client/platform/src/lib/cn.ts +6 -0
- package/client/platform/src/lib/specRouteCatalog.json +23 -0
- package/client/platform/src/lib/specScreens.json +17 -0
- package/client/platform/src/main.tsx +17 -0
- package/client/platform/src/pages/DashboardPage.tsx +158 -0
- package/client/platform/src/pages/LoginPage.tsx +72 -0
- package/client/platform/src/pages/OrdersPage.tsx +123 -0
- package/client/platform/src/styles/globals.css +17 -0
- package/client/platform/src/theme-vars.ts +18 -0
- package/client/platform/src/theme.ts +25 -0
- package/client/platform/src/vite-env.d.ts +1 -0
- package/client/platform/tailwind.config.js +8 -0
- package/client/platform/tsconfig.json +25 -0
- package/client/platform/vite.config.ts +12 -0
- package/compose.yml +206 -0
- package/infra/compose/.env.dev.example +28 -0
- package/infra/compose/.env.prod.example +29 -0
- package/infra/compose/README.md +35 -0
- package/infra/compose/dev.yml +125 -0
- package/infra/compose/prod.yml +126 -0
- package/infra/terraform/README.md +34 -0
- package/infra/terraform/aws/data/.terraform.lock.hcl +25 -0
- package/infra/terraform/aws/data/README.md +18 -0
- package/infra/terraform/aws/data/main.tf +147 -0
- package/infra/terraform/aws/data/outputs.tf +14 -0
- package/infra/terraform/aws/data/variables.tf +57 -0
- package/infra/terraform/aws/data/versions.tf +10 -0
- package/infra/terraform/aws/domain/.terraform.lock.hcl +25 -0
- package/infra/terraform/aws/domain/README.md +20 -0
- package/infra/terraform/aws/domain/env/dev.tfvars.example +6 -0
- package/infra/terraform/aws/domain/env/prod.tfvars.example +7 -0
- package/infra/terraform/aws/domain/main.tf +149 -0
- package/infra/terraform/aws/domain/outputs.tf +29 -0
- package/infra/terraform/aws/domain/variables.tf +58 -0
- package/infra/terraform/aws/domain/versions.tf +10 -0
- package/infra/terraform/openstack/README.md +38 -0
- package/infra/terraform/openstack/dev/.terraform.lock.hcl +24 -0
- package/infra/terraform/openstack/dev/README.md +18 -0
- package/infra/terraform/openstack/dev/main.tf +49 -0
- package/infra/terraform/openstack/dev/providers.tf +15 -0
- package/infra/terraform/openstack/dev/terraform.tfvars.example +54 -0
- package/infra/terraform/openstack/dev/variables.tf +210 -0
- package/infra/terraform/openstack/dev/versions.tf +10 -0
- package/infra/terraform/openstack/modules/environment_host/main.tf +143 -0
- package/infra/terraform/openstack/modules/environment_host/outputs.tf +25 -0
- package/infra/terraform/openstack/modules/environment_host/templates/docker-host-user-data.sh.tftpl +40 -0
- package/infra/terraform/openstack/modules/environment_host/variables.tf +145 -0
- package/infra/terraform/openstack/modules/environment_host/versions.tf +7 -0
- package/infra/terraform/openstack/prod/.terraform.lock.hcl +24 -0
- package/infra/terraform/openstack/prod/README.md +18 -0
- package/infra/terraform/openstack/prod/main.tf +49 -0
- package/infra/terraform/openstack/prod/providers.tf +15 -0
- package/infra/terraform/openstack/prod/terraform.tfvars.example +55 -0
- package/infra/terraform/openstack/prod/variables.tf +210 -0
- package/infra/terraform/openstack/prod/versions.tf +10 -0
- package/infra/terraform/openstack/server/.terraform.lock.hcl +45 -0
- package/infra/terraform/openstack/server/README.md +47 -0
- package/infra/terraform/openstack/server/main.tf +161 -0
- package/infra/terraform/openstack/server/outputs.tf +30 -0
- package/infra/terraform/openstack/server/providers.tf +30 -0
- package/infra/terraform/openstack/server/templates/server-user-data.sh.tftpl +50 -0
- package/infra/terraform/openstack/server/variables.tf +233 -0
- package/infra/terraform/openstack/server/zz_aspace.auto.tfvars.example.json +29 -0
- package/lib/scaffold.mjs +373 -0
- package/package.json +33 -12
- package/pnpm-workspace.yaml +2 -0
- package/scripts/dev/audit_sdd_build_ast.py +277 -0
- package/sdd/01_planning/01_feature/INDEX.md +16 -0
- package/sdd/01_planning/01_feature/README.md +76 -0
- package/sdd/01_planning/01_feature/alerts_feature_spec.md +55 -0
- package/sdd/01_planning/01_feature/auth_feature_spec.md +57 -0
- package/sdd/01_planning/01_feature/catalog_feature_spec.md +61 -0
- package/sdd/01_planning/01_feature/fulfillment_feature_spec.md +58 -0
- package/sdd/01_planning/01_feature/health_feature_spec.md +52 -0
- package/sdd/01_planning/01_feature/inventory_feature_spec.md +60 -0
- package/sdd/01_planning/01_feature/order_feature_spec.md +63 -0
- package/sdd/01_planning/01_feature/shipping_feature_spec.md +55 -0
- package/sdd/01_planning/01_feature/support_feature_spec.md +53 -0
- package/sdd/01_planning/01_feature/user_feature_spec.md +54 -0
- package/sdd/01_planning/02_screen/INDEX.md +13 -0
- package/sdd/01_planning/02_screen/README.md +41 -0
- package/sdd/01_planning/02_screen/admin_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/assets/README.md +16 -0
- package/sdd/01_planning/02_screen/assets/example/README.md +13 -0
- package/sdd/01_planning/02_screen/landing_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/mobile_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/platform_screen_spec.pdf +0 -0
- package/sdd/01_planning/03_architecture/INDEX.md +9 -0
- package/sdd/01_planning/03_architecture/README.md +25 -0
- package/sdd/01_planning/03_architecture/architecture_document_structure.md +77 -0
- package/sdd/01_planning/03_architecture/backend/README.md +10 -0
- package/sdd/01_planning/03_architecture/frontend/README.md +12 -0
- package/sdd/01_planning/03_architecture/infra/README.md +10 -0
- package/sdd/01_planning/03_architecture/tech-research/README.md +4 -0
- package/sdd/01_planning/03_architecture/templates_system_architecture.md +84 -0
- package/sdd/01_planning/04_data/INDEX.md +4 -0
- package/sdd/01_planning/04_data/README.md +10 -0
- package/sdd/01_planning/04_data/templates_data_modeling.md +119 -0
- package/sdd/01_planning/05_api/README.md +12 -0
- package/sdd/01_planning/05_api/templates_api_contract.md +90 -0
- package/sdd/01_planning/06_iac/README.md +11 -0
- package/sdd/01_planning/06_iac/templates_runtime_and_cicd_baseline.md +46 -0
- package/sdd/01_planning/07_integration/README.md +11 -0
- package/sdd/01_planning/07_integration/templates_frontend_api_integration.md +46 -0
- package/sdd/01_planning/08_nonfunctional/README.md +7 -0
- package/sdd/01_planning/09_security/README.md +7 -0
- package/sdd/01_planning/10_test/README.md +12 -0
- package/sdd/01_planning/10_test/templates_test_strategy.md +60 -0
- package/sdd/01_planning/INDEX.md +19 -0
- package/sdd/01_planning/README.md +17 -0
- package/sdd/02_plan/01_feature/README.md +34 -0
- package/sdd/02_plan/01_feature/_feature_todo_template.md +29 -0
- package/sdd/02_plan/02_screen/INDEX.md +19 -0
- package/sdd/02_plan/02_screen/README.md +39 -0
- package/sdd/02_plan/02_screen/_screen_todo_template.md +60 -0
- package/sdd/02_plan/03_architecture/README.md +23 -0
- package/sdd/02_plan/03_architecture/architecture_document_governance.md +40 -0
- package/sdd/02_plan/03_architecture/build_ast_runtime_tree_governance.md +53 -0
- package/sdd/02_plan/03_architecture/repository_governance.md +39 -0
- package/sdd/02_plan/03_architecture/runtime_and_structure_governance.md +38 -0
- package/sdd/02_plan/03_architecture/templates-hexagonal-template-architecture.md +9 -0
- package/sdd/02_plan/03_architecture/toolchain_governance.md +98 -0
- package/sdd/02_plan/04_data/README.md +5 -0
- package/sdd/02_plan/05_api/README.md +5 -0
- package/sdd/02_plan/06_iac/README.md +11 -0
- package/sdd/02_plan/06_iac/dev_runtime_delivery.md +36 -0
- package/sdd/02_plan/06_iac/template_runtime_delivery.md +50 -0
- package/sdd/02_plan/07_integration/README.md +5 -0
- package/sdd/02_plan/07_integration/frontend_live_integration.md +31 -0
- package/sdd/02_plan/08_nonfunctional/README.md +5 -0
- package/sdd/02_plan/08_nonfunctional/repository_hygiene.md +26 -0
- package/sdd/02_plan/09_security/README.md +5 -0
- package/sdd/02_plan/10_test/README.md +11 -0
- package/sdd/02_plan/10_test/regression_verification.md +39 -0
- package/sdd/02_plan/10_test/templates/README.md +8 -0
- package/sdd/02_plan/10_test/templates/ui_parity_platform_contract.template.yaml +23 -0
- package/sdd/02_plan/10_test/verification_strategy.md +43 -0
- package/sdd/02_plan/99_generated/from_planning/ui_parity/.gitkeep +1 -0
- package/sdd/02_plan/README.md +40 -0
- package/sdd/03_build/01_feature/README.md +20 -0
- package/sdd/03_build/01_feature/domain/README.md +3 -0
- package/sdd/03_build/01_feature/domain/account_and_access.md +20 -0
- package/sdd/03_build/01_feature/domain/catalog_and_inventory.md +20 -0
- package/sdd/03_build/01_feature/domain/ordering_and_fulfillment.md +21 -0
- package/sdd/03_build/01_feature/domain/support_and_observability.md +21 -0
- package/sdd/03_build/01_feature/domain_surfaces.md +28 -0
- package/sdd/03_build/01_feature/service/README.md +3 -0
- package/sdd/03_build/01_feature/service/admin_surface.md +15 -0
- package/sdd/03_build/01_feature/service/landing_surface.md +13 -0
- package/sdd/03_build/01_feature/service/mobile_surface.md +14 -0
- package/sdd/03_build/01_feature/service/platform_surface.md +14 -0
- package/sdd/03_build/02_screen/README.md +25 -0
- package/sdd/03_build/02_screen/_screen_build_template.md +26 -0
- package/sdd/03_build/02_screen/admin/README.md +5 -0
- package/sdd/03_build/02_screen/landing/README.md +5 -0
- package/sdd/03_build/02_screen/mobile/README.md +5 -0
- package/sdd/03_build/02_screen/platform/README.md +5 -0
- package/sdd/03_build/03_architecture/README.md +10 -0
- package/sdd/03_build/03_architecture/architecture_document_governance.md +30 -0
- package/sdd/03_build/03_architecture/build_ast_runtime_tree_governance.md +24 -0
- package/sdd/03_build/03_architecture/repository_governance.md +18 -0
- package/sdd/03_build/03_architecture/toolchain_governance.md +36 -0
- package/sdd/03_build/06_iac/README.md +3 -0
- package/sdd/03_build/06_iac/dev_runtime_delivery.md +10 -0
- package/sdd/03_build/06_iac/template_runtime_delivery.md +49 -0
- package/sdd/03_build/07_integration/README.md +3 -0
- package/sdd/03_build/07_integration/frontend_live_integration.md +11 -0
- package/sdd/03_build/08_nonfunctional/README.md +3 -0
- package/sdd/03_build/08_nonfunctional/repository_hygiene.md +10 -0
- package/sdd/03_build/10_test/README.md +9 -0
- package/sdd/03_build/10_test/regression_verification.md +16 -0
- package/sdd/03_build/10_test/verification_harness.md +11 -0
- package/sdd/03_build/README.md +35 -0
- package/sdd/04_verify/01_feature/README.md +5 -0
- package/sdd/04_verify/01_feature/domain_verification.md +14 -0
- package/sdd/04_verify/01_feature/service_verification.md +22 -0
- package/sdd/04_verify/02_screen/README.md +6 -0
- package/sdd/04_verify/02_screen/_screen_verify_template.md +20 -0
- package/sdd/04_verify/02_screen/admin/README.md +4 -0
- package/sdd/04_verify/02_screen/landing/README.md +4 -0
- package/sdd/04_verify/02_screen/mobile/README.md +4 -0
- package/sdd/04_verify/02_screen/platform/README.md +4 -0
- package/sdd/04_verify/03_architecture/README.md +10 -0
- package/sdd/04_verify/03_architecture/architecture_document_governance.md +15 -0
- package/sdd/04_verify/03_architecture/build_ast_runtime_tree_governance.md +28 -0
- package/sdd/04_verify/03_architecture/repository_governance.md +16 -0
- package/sdd/04_verify/03_architecture/toolchain_governance.md +58 -0
- package/sdd/04_verify/06_iac/README.md +3 -0
- package/sdd/04_verify/06_iac/dev_runtime_delivery.md +10 -0
- package/sdd/04_verify/06_iac/template_runtime_delivery.md +42 -0
- package/sdd/04_verify/07_integration/README.md +3 -0
- package/sdd/04_verify/07_integration/frontend_live_integration.md +16 -0
- package/sdd/04_verify/08_nonfunctional/README.md +3 -0
- package/sdd/04_verify/08_nonfunctional/repository_hygiene.md +14 -0
- package/sdd/04_verify/10_test/README.md +9 -0
- package/sdd/04_verify/10_test/regression_verification.md +16 -0
- package/sdd/04_verify/10_test/ui_parity/README.md +4 -0
- package/sdd/04_verify/10_test/ui_parity/loop_runs/.gitkeep +0 -0
- package/sdd/04_verify/10_test/ui_parity/reference/.gitkeep +0 -0
- package/sdd/04_verify/10_test/ui_parity/staged_runs/.gitkeep +0 -0
- package/sdd/04_verify/10_test/verification_harness.md +17 -0
- package/sdd/04_verify/README.md +22 -0
- package/sdd/05_operate/01_runbooks/.gitkeep +1 -0
- package/sdd/05_operate/01_runbooks/README.md +4 -0
- package/sdd/05_operate/02_delivery_status/README.md +4 -0
- package/sdd/05_operate/02_delivery_status/service_status.md +16 -0
- package/sdd/05_operate/README.md +12 -0
- package/sdd/99_toolchain/01_automation/.gitkeep +1 -0
- package/sdd/99_toolchain/01_automation/README.md +76 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/analyze_proof_results.py +132 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/analyze_route_gap.py +85 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/assets/repo-contract.template.json +75 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/bootstrap_frontend_parity.sh +84 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/init_frontend_parity.sh +33 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/init_repo_contract.sh +51 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json +76 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/resolve_frontend_target.py +52 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/resolve_repo_contract.py +56 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/run_frontend_target.sh +100 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/run_repo_phase.sh +140 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/validate_json_schema.py +39 -0
- package/sdd/99_toolchain/01_automation/agentic-parity-harness-design.md +291 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/queue.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/support.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/home.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/workspace.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/fulfillment.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/orders.png +0 -0
- package/sdd/99_toolchain/01_automation/build_asset_recipes.py +10 -0
- package/sdd/99_toolchain/01_automation/build_screen_spec_pdf.py +427 -0
- package/sdd/99_toolchain/01_automation/capture_screen_assets.mjs +148 -0
- package/sdd/99_toolchain/01_automation/harness-layout.md +34 -0
- package/sdd/99_toolchain/01_automation/parity-execution-tooling-design.md +319 -0
- package/sdd/99_toolchain/01_automation/playwright_exactness_manifest.py +21 -0
- package/sdd/99_toolchain/01_automation/run_playwright_exactness.py +87 -0
- package/sdd/99_toolchain/01_automation/screen_spec_manifest.py +321 -0
- package/sdd/99_toolchain/01_automation/spec_asset_builder.py +274 -0
- package/sdd/99_toolchain/01_automation/ui-contract-projection.md +79 -0
- package/sdd/99_toolchain/01_automation/ui-parity/README.md +60 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/extract-reference-pages.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/materialize-reference-assets.mjs +58 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/normalize-reference-assets.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/route-gap-report.mjs +187 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/run-proof.mjs +50 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/scaffold-contract.mjs +62 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/upload-parity1.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/collector-metadata.schema.json +33 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/proof-result.schema.json +76 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/route-gap-report.schema.json +95 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/capture-runner.mjs +55 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/load-adapter.mjs +25 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/load-contract.mjs +81 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/paths.mjs +23 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/proof-runner.mjs +255 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-artifact-layout.md +23 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-proof-interface.md +60 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-route-gap-interface.md +82 -0
- package/sdd/99_toolchain/01_automation/ui-parity/runtime/playwright-runtime.mjs +16 -0
- package/sdd/99_toolchain/01_automation/ui-parity/runtime/static-runtime.mjs +6 -0
- package/sdd/99_toolchain/02_policies/.gitkeep +1 -0
- package/sdd/99_toolchain/02_policies/build-ast-governance-policy.md +22 -0
- package/sdd/99_toolchain/02_policies/compose-runtime-baseline-policy.md +24 -0
- package/sdd/99_toolchain/02_policies/convention-storage-policy.md +26 -0
- package/sdd/99_toolchain/02_policies/main-push-before-dev-deploy-policy.md +27 -0
- package/sdd/99_toolchain/02_policies/otro-orchestration-policy.md +30 -0
- package/sdd/99_toolchain/02_policies/regression-verification-policy.md +22 -0
- package/sdd/99_toolchain/03_templates/.gitkeep +1 -0
- package/sdd/99_toolchain/03_templates/asset_recipe_manifest.example.py +38 -0
- package/sdd/99_toolchain/03_templates/generated_assets/README.md +11 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-lockup.svg +3 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-mark.svg +3 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-wordmark.svg +3 -0
- package/sdd/99_toolchain/03_templates/playwright_exactness_manifest.example.py +21 -0
- package/sdd/99_toolchain/README.md +23 -0
- package/sdd/README.md +21 -0
- package/server/.dockerignore +4 -0
- package/server/.env.example +19 -0
- package/server/Dockerfile +22 -0
- package/server/Dockerfile.dev +19 -0
- package/server/README.md +33 -0
- package/server/__init__.py +0 -0
- package/server/api/__init__.py +1 -0
- package/server/api/http/__init__.py +4 -0
- package/server/api/http/app.py +53 -0
- package/server/api/http/router.py +24 -0
- package/server/config.py +52 -0
- package/server/contexts/__init__.py +12 -0
- package/server/contexts/alerts/__init__.py +1 -0
- package/server/contexts/alerts/application/__init__.py +13 -0
- package/server/contexts/alerts/application/services.py +41 -0
- package/server/contexts/alerts/contracts/__init__.py +3 -0
- package/server/contexts/alerts/contracts/http/__init__.py +3 -0
- package/server/contexts/alerts/contracts/http/router.py +37 -0
- package/server/contexts/alerts/domain/__init__.py +15 -0
- package/server/contexts/alerts/domain/models.py +29 -0
- package/server/contexts/alerts/infrastructure/__init__.py +11 -0
- package/server/contexts/alerts/infrastructure/repository.py +41 -0
- package/server/contexts/auth/__init__.py +1 -0
- package/server/contexts/auth/application/__init__.py +3 -0
- package/server/contexts/auth/application/ports.py +10 -0
- package/server/contexts/auth/application/services.py +64 -0
- package/server/contexts/auth/contracts/__init__.py +4 -0
- package/server/contexts/auth/contracts/http/__init__.py +4 -0
- package/server/contexts/auth/contracts/http/dependencies.py +37 -0
- package/server/contexts/auth/contracts/http/router.py +19 -0
- package/server/contexts/auth/domain/__init__.py +3 -0
- package/server/contexts/auth/domain/models.py +24 -0
- package/server/contexts/auth/infrastructure/__init__.py +4 -0
- package/server/contexts/auth/infrastructure/adapters/memory.py +19 -0
- package/server/contexts/auth/infrastructure/adapters/mongodb.py +24 -0
- package/server/contexts/auth/infrastructure/adapters/sqlalchemy.py +74 -0
- package/server/contexts/auth/infrastructure/repository.py +28 -0
- package/server/contexts/catalog/__init__.py +1 -0
- package/server/contexts/catalog/application/__init__.py +28 -0
- package/server/contexts/catalog/application/ports.py +15 -0
- package/server/contexts/catalog/application/services.py +154 -0
- package/server/contexts/catalog/contracts/__init__.py +3 -0
- package/server/contexts/catalog/contracts/http/__init__.py +3 -0
- package/server/contexts/catalog/contracts/http/router.py +60 -0
- package/server/contexts/catalog/domain/__init__.py +45 -0
- package/server/contexts/catalog/domain/models.py +113 -0
- package/server/contexts/catalog/infrastructure/__init__.py +4 -0
- package/server/contexts/catalog/infrastructure/adapters/memory.py +62 -0
- package/server/contexts/catalog/infrastructure/repository.py +8 -0
- package/server/contexts/fulfillment/__init__.py +1 -0
- package/server/contexts/fulfillment/application/__init__.py +13 -0
- package/server/contexts/fulfillment/application/ports.py +20 -0
- package/server/contexts/fulfillment/application/services.py +85 -0
- package/server/contexts/fulfillment/contracts/__init__.py +3 -0
- package/server/contexts/fulfillment/contracts/http/__init__.py +3 -0
- package/server/contexts/fulfillment/contracts/http/router.py +40 -0
- package/server/contexts/fulfillment/domain/__init__.py +25 -0
- package/server/contexts/fulfillment/domain/models.py +73 -0
- package/server/contexts/fulfillment/infrastructure/__init__.py +13 -0
- package/server/contexts/fulfillment/infrastructure/adapters/memory.py +43 -0
- package/server/contexts/fulfillment/infrastructure/repository.py +97 -0
- package/server/contexts/health/__init__.py +1 -0
- package/server/contexts/health/application/__init__.py +3 -0
- package/server/contexts/health/application/services.py +2 -0
- package/server/contexts/health/contracts/__init__.py +3 -0
- package/server/contexts/health/contracts/http/__init__.py +3 -0
- package/server/contexts/health/contracts/http/router.py +10 -0
- package/server/contexts/inventory/__init__.py +1 -0
- package/server/contexts/inventory/application/__init__.py +28 -0
- package/server/contexts/inventory/application/ports.py +11 -0
- package/server/contexts/inventory/application/services.py +214 -0
- package/server/contexts/inventory/contracts/__init__.py +3 -0
- package/server/contexts/inventory/contracts/http/__init__.py +3 -0
- package/server/contexts/inventory/contracts/http/router.py +82 -0
- package/server/contexts/inventory/domain/__init__.py +33 -0
- package/server/contexts/inventory/domain/models.py +93 -0
- package/server/contexts/inventory/infrastructure/__init__.py +4 -0
- package/server/contexts/inventory/infrastructure/adapters/memory.py +24 -0
- package/server/contexts/inventory/infrastructure/repository.py +8 -0
- package/server/contexts/orders/__init__.py +1 -0
- package/server/contexts/orders/application/__init__.py +19 -0
- package/server/contexts/orders/application/services.py +127 -0
- package/server/contexts/orders/contracts/__init__.py +3 -0
- package/server/contexts/orders/contracts/http/__init__.py +3 -0
- package/server/contexts/orders/contracts/http/router.py +82 -0
- package/server/contexts/orders/domain/__init__.py +29 -0
- package/server/contexts/orders/domain/models.py +95 -0
- package/server/contexts/orders/infrastructure/__init__.py +7 -0
- package/server/contexts/orders/infrastructure/repository.py +104 -0
- package/server/contexts/shipping/__init__.py +1 -0
- package/server/contexts/shipping/application/__init__.py +13 -0
- package/server/contexts/shipping/application/services.py +92 -0
- package/server/contexts/shipping/contracts/__init__.py +3 -0
- package/server/contexts/shipping/contracts/http/__init__.py +3 -0
- package/server/contexts/shipping/contracts/http/router.py +40 -0
- package/server/contexts/shipping/domain/__init__.py +19 -0
- package/server/contexts/shipping/domain/models.py +48 -0
- package/server/contexts/shipping/infrastructure/__init__.py +9 -0
- package/server/contexts/shipping/infrastructure/repository.py +50 -0
- package/server/contexts/support/__init__.py +1 -0
- package/server/contexts/support/application/__init__.py +13 -0
- package/server/contexts/support/application/services.py +29 -0
- package/server/contexts/support/contracts/__init__.py +3 -0
- package/server/contexts/support/contracts/http/__init__.py +3 -0
- package/server/contexts/support/contracts/http/router.py +40 -0
- package/server/contexts/support/domain/__init__.py +13 -0
- package/server/contexts/support/domain/models.py +27 -0
- package/server/contexts/support/infrastructure/__init__.py +11 -0
- package/server/contexts/support/infrastructure/repository.py +70 -0
- package/server/contexts/user/__init__.py +1 -0
- package/server/contexts/user/application/__init__.py +3 -0
- package/server/contexts/user/application/ports.py +11 -0
- package/server/contexts/user/application/services.py +44 -0
- package/server/contexts/user/contracts/__init__.py +3 -0
- package/server/contexts/user/contracts/http/__init__.py +3 -0
- package/server/contexts/user/contracts/http/router.py +26 -0
- package/server/contexts/user/domain/__init__.py +3 -0
- package/server/contexts/user/domain/models.py +22 -0
- package/server/contexts/user/infrastructure/__init__.py +3 -0
- package/server/contexts/user/infrastructure/adapters/memory.py +27 -0
- package/server/contexts/user/infrastructure/adapters/mongodb.py +41 -0
- package/server/contexts/user/infrastructure/adapters/sqlalchemy.py +94 -0
- package/server/contexts/user/infrastructure/factory.py +28 -0
- package/server/data/README.md +24 -0
- package/server/data/bootstrap/alerts.json +38 -0
- package/server/data/bootstrap/auth_accounts.json +18 -0
- package/server/data/bootstrap/catalog_products.json +179 -0
- package/server/data/bootstrap/fulfillment_events.json +5 -0
- package/server/data/bootstrap/fulfillment_notes.json +5 -0
- package/server/data/bootstrap/fulfillment_tasks.json +50 -0
- package/server/data/bootstrap/inventory_levels.json +80 -0
- package/server/data/bootstrap/orders.json +62 -0
- package/server/data/bootstrap/shipping_shipments.json +50 -0
- package/server/data/bootstrap/support_faqs.json +26 -0
- package/server/data/bootstrap/users.json +20 -0
- package/server/data/bootstrap_loader.py +15 -0
- package/server/docker-entrypoint.sh +56 -0
- package/server/main.py +3 -0
- package/server/pyproject.toml +36 -0
- package/server/shared/__init__.py +1 -0
- package/server/shared/application/__init__.py +3 -0
- package/server/shared/application/health.py +2 -0
- package/server/shared/infrastructure/__init__.py +10 -0
- package/server/shared/infrastructure/runtime.py +6 -0
- package/server/shared/infrastructure/security.py +33 -0
- package/server/tests/e2e/test_domain_feature_flows.py +483 -0
- package/server/tests/test_health.py +49 -0
- package/server/uv.lock +1169 -0
- package/bin/agentic-dev.js +0 -9
- package/src/cli.js +0 -37
- package/src/init-command.js +0 -230
- package/src/lib/command.js +0 -14
- package/src/lib/fs.js +0 -92
- package/src/lib/git.js +0 -57
- package/src/lib/github.js +0 -77
- package/src/lib/prompt.js +0 -52
- package/src/lib/system.js +0 -15
- package/src/lib/template.js +0 -143
package/bin/agentic-dev.js
DELETED
package/src/cli.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { runInit } from "./init-command.js";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
4
|
-
function printHelp() {
|
|
5
|
-
console.log(`agentic-dev
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
agentic-dev init
|
|
9
|
-
|
|
10
|
-
Commands:
|
|
11
|
-
init Materialize a new repo from agentic-core + a selected template repo.
|
|
12
|
-
`);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function main(argv = process.argv.slice(2)) {
|
|
16
|
-
const [command] = argv;
|
|
17
|
-
|
|
18
|
-
if (!command || command === "-h" || command === "--help") {
|
|
19
|
-
printHelp();
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (command === "init") {
|
|
24
|
-
await runInit();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
throw new Error(`unknown command: ${command}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
32
|
-
main().catch((error) => {
|
|
33
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
34
|
-
console.error(`agentic-dev: ${message}`);
|
|
35
|
-
process.exitCode = 1;
|
|
36
|
-
});
|
|
37
|
-
}
|
package/src/init-command.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
assertGhCliAuthenticated,
|
|
8
|
-
createProject,
|
|
9
|
-
ensureGitHubRepositoryExists,
|
|
10
|
-
getProject,
|
|
11
|
-
getRepositoryMetadata,
|
|
12
|
-
listTemplateRepositories,
|
|
13
|
-
} from "./lib/github.js";
|
|
14
|
-
import {
|
|
15
|
-
assertEmptyRepoRoot,
|
|
16
|
-
copyDirectory,
|
|
17
|
-
ensureDirectory,
|
|
18
|
-
readJsonFile,
|
|
19
|
-
writeJsonFile,
|
|
20
|
-
} from "./lib/fs.js";
|
|
21
|
-
import { checkoutRepository, readGitCommit, readOriginRemote, validateGitRepoRoot } from "./lib/git.js";
|
|
22
|
-
import { confirm, promptText, selectFromList } from "./lib/prompt.js";
|
|
23
|
-
import {
|
|
24
|
-
buildArtifactContract,
|
|
25
|
-
buildInitAnswers,
|
|
26
|
-
buildLockFile,
|
|
27
|
-
loadTemplateContract,
|
|
28
|
-
renderTokensInDirectory,
|
|
29
|
-
} from "./lib/template.js";
|
|
30
|
-
import { runCommand } from "./lib/command.js";
|
|
31
|
-
import { assertRequiredCommands } from "./lib/system.js";
|
|
32
|
-
|
|
33
|
-
const DEFAULT_CORE_REPOSITORY = "do4ai/agentic-core";
|
|
34
|
-
const PACKAGE_PATH = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
35
|
-
|
|
36
|
-
async function readInstallerVersion() {
|
|
37
|
-
const pkg = JSON.parse(await readFile(PACKAGE_PATH, "utf8"));
|
|
38
|
-
return pkg.version;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function formatRepositoryChoice(repository) {
|
|
42
|
-
const branch = repository.defaultBranch || "main";
|
|
43
|
-
return `${repository.nameWithOwner} (${branch})`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function chooseTemplate(org) {
|
|
47
|
-
const repositories = await listTemplateRepositories(org);
|
|
48
|
-
if (repositories.length === 0) {
|
|
49
|
-
throw new Error(`no template-* repositories found in ${org}`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const index = await selectFromList(
|
|
53
|
-
"Select the template repository to compose into this repo:",
|
|
54
|
-
repositories.map((repository) => formatRepositoryChoice(repository)),
|
|
55
|
-
);
|
|
56
|
-
return repositories[index];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function resolveRepositoryCoordinates(cwd) {
|
|
60
|
-
const remote = await readOriginRemote(cwd);
|
|
61
|
-
const remoteOwner = remote?.owner ?? "do4ai";
|
|
62
|
-
const remoteRepository = remote?.repo ?? path.basename(cwd);
|
|
63
|
-
|
|
64
|
-
const owner = await promptText("GitHub owner", remoteOwner);
|
|
65
|
-
const repository = await promptText("GitHub repository", remoteRepository);
|
|
66
|
-
await ensureGitHubRepositoryExists(`${owner}/${repository}`);
|
|
67
|
-
return { owner, repository };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async function resolveProject(owner, repository) {
|
|
71
|
-
const existingProjectNumber = await promptText(
|
|
72
|
-
"Existing GitHub Project number (leave blank to create a new project)",
|
|
73
|
-
"",
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
if (existingProjectNumber) {
|
|
77
|
-
const number = Number.parseInt(existingProjectNumber, 10);
|
|
78
|
-
if (!Number.isInteger(number) || number <= 0) {
|
|
79
|
-
throw new Error(`invalid project number: ${existingProjectNumber}`);
|
|
80
|
-
}
|
|
81
|
-
const project = await getProject(owner, number);
|
|
82
|
-
console.log(
|
|
83
|
-
`Warning: project ${owner}#${project.number} (${project.title}) already exists. ` +
|
|
84
|
-
"Continuing can create or update task items in that project.",
|
|
85
|
-
);
|
|
86
|
-
const proceed = await confirm("Continue with the existing project?", false);
|
|
87
|
-
if (!proceed) {
|
|
88
|
-
throw new Error("project bootstrap aborted by user");
|
|
89
|
-
}
|
|
90
|
-
return project;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const title = await promptText("New GitHub Project title", repository);
|
|
94
|
-
return createProject(owner, title);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async function bootstrapProjectContract({ cwd, coreCheckout, owner, repository, project }) {
|
|
98
|
-
const scriptPath = path.join(coreCheckout, "scripts/agentic-core/github_project_kit.py");
|
|
99
|
-
await runCommand("python3", [
|
|
100
|
-
scriptPath,
|
|
101
|
-
"bootstrap",
|
|
102
|
-
"--repo-root",
|
|
103
|
-
cwd,
|
|
104
|
-
"--owner",
|
|
105
|
-
owner,
|
|
106
|
-
"--project-number",
|
|
107
|
-
String(project.number),
|
|
108
|
-
"--repository",
|
|
109
|
-
`${owner}/${repository}`,
|
|
110
|
-
"--project-title",
|
|
111
|
-
project.title,
|
|
112
|
-
"--ensure-agent-role-field",
|
|
113
|
-
"--ensure-role-labels",
|
|
114
|
-
]);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async function writeRepoBridgeFiles(cwd) {
|
|
118
|
-
await ensureDirectory(path.join(cwd, ".claude"));
|
|
119
|
-
await ensureDirectory(path.join(cwd, ".codex"));
|
|
120
|
-
await writeJsonFile(path.join(cwd, ".claude/agentic-dev.json"), {
|
|
121
|
-
contract_path: "../sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json",
|
|
122
|
-
});
|
|
123
|
-
await writeJsonFile(path.join(cwd, ".codex/agentic-dev.json"), {
|
|
124
|
-
contract_path: "../sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json",
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async function writeInstallerLock({
|
|
129
|
-
cwd,
|
|
130
|
-
installerVersion,
|
|
131
|
-
coreRepository,
|
|
132
|
-
coreRef,
|
|
133
|
-
coreCheckout,
|
|
134
|
-
templateRepository,
|
|
135
|
-
templateRef,
|
|
136
|
-
templateCheckout,
|
|
137
|
-
}) {
|
|
138
|
-
const payload = buildLockFile({
|
|
139
|
-
installerVersion,
|
|
140
|
-
coreRepository,
|
|
141
|
-
coreRef,
|
|
142
|
-
coreCommit: await readGitCommit(coreCheckout),
|
|
143
|
-
templateRepository,
|
|
144
|
-
templateRef,
|
|
145
|
-
templateCommit: await readGitCommit(templateCheckout),
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
await writeJsonFile(path.join(cwd, ".agentic-dev-lock.json"), payload);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export async function runInit() {
|
|
152
|
-
const cwd = process.cwd();
|
|
153
|
-
await assertRequiredCommands(["git", "gh", "python3"]);
|
|
154
|
-
await validateGitRepoRoot(cwd);
|
|
155
|
-
await assertEmptyRepoRoot(cwd);
|
|
156
|
-
await assertGhCliAuthenticated();
|
|
157
|
-
|
|
158
|
-
const installerVersion = await readInstallerVersion();
|
|
159
|
-
|
|
160
|
-
const coreRepository = await promptText("agentic-core repository", DEFAULT_CORE_REPOSITORY);
|
|
161
|
-
const coreMetadata = await getRepositoryMetadata(coreRepository);
|
|
162
|
-
const coreRef = await promptText("agentic-core ref", coreMetadata.defaultBranch);
|
|
163
|
-
|
|
164
|
-
const templateOrganization = await promptText("Template organization", "do4ai");
|
|
165
|
-
const templateRepository = await chooseTemplate(templateOrganization);
|
|
166
|
-
const templateRef = await promptText("Template ref", templateRepository.defaultBranch);
|
|
167
|
-
|
|
168
|
-
const { owner, repository } = await resolveRepositoryCoordinates(cwd);
|
|
169
|
-
const project = await resolveProject(owner, repository);
|
|
170
|
-
const answers = await buildInitAnswers({ owner, repository, projectTitle: project.title });
|
|
171
|
-
|
|
172
|
-
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "agentic-dev-"));
|
|
173
|
-
const coreCheckout = path.join(tempRoot, "agentic-core");
|
|
174
|
-
const templateCheckout = path.join(tempRoot, "template");
|
|
175
|
-
|
|
176
|
-
try {
|
|
177
|
-
console.log(`Fetching ${coreRepository}@${coreRef}`);
|
|
178
|
-
await checkoutRepository(coreRepository, coreRef, coreCheckout);
|
|
179
|
-
|
|
180
|
-
console.log(`Fetching ${templateRepository.nameWithOwner}@${templateRef}`);
|
|
181
|
-
await checkoutRepository(templateRepository.nameWithOwner, templateRef, templateCheckout);
|
|
182
|
-
|
|
183
|
-
console.log("Materializing template files");
|
|
184
|
-
await copyDirectory(templateCheckout, cwd);
|
|
185
|
-
|
|
186
|
-
const templateContract = await loadTemplateContract(templateCheckout);
|
|
187
|
-
console.log("Rendering template tokens");
|
|
188
|
-
await renderTokensInDirectory(cwd, answers.tokens, templateContract?.render_excludes ?? []);
|
|
189
|
-
|
|
190
|
-
console.log("Syncing agentic-core baseline");
|
|
191
|
-
await runCommand("python3", [
|
|
192
|
-
path.join(coreCheckout, "scripts/agentic-core/sync.py"),
|
|
193
|
-
"sync",
|
|
194
|
-
"--core-root",
|
|
195
|
-
coreCheckout,
|
|
196
|
-
"--source-root",
|
|
197
|
-
coreCheckout,
|
|
198
|
-
"--target-root",
|
|
199
|
-
cwd,
|
|
200
|
-
]);
|
|
201
|
-
|
|
202
|
-
await writeRepoBridgeFiles(cwd);
|
|
203
|
-
|
|
204
|
-
console.log("Writing artifact contract");
|
|
205
|
-
const artifactContract = buildArtifactContract(templateContract);
|
|
206
|
-
await writeJsonFile(
|
|
207
|
-
path.join(cwd, "sdd/99_toolchain/01_automation/github-project-kit/artifact-contract.json"),
|
|
208
|
-
artifactContract,
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
console.log("Bootstrapping GitHub Project contract");
|
|
212
|
-
await bootstrapProjectContract({ cwd, coreCheckout, owner, repository, project });
|
|
213
|
-
|
|
214
|
-
console.log("Writing source lock manifest");
|
|
215
|
-
await writeInstallerLock({
|
|
216
|
-
cwd,
|
|
217
|
-
installerVersion,
|
|
218
|
-
coreRepository,
|
|
219
|
-
coreRef,
|
|
220
|
-
coreCheckout,
|
|
221
|
-
templateRepository: templateRepository.nameWithOwner,
|
|
222
|
-
templateRef,
|
|
223
|
-
templateCheckout,
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
console.log("agentic-dev init complete");
|
|
227
|
-
} finally {
|
|
228
|
-
await rm(tempRoot, { recursive: true, force: true });
|
|
229
|
-
}
|
|
230
|
-
}
|
package/src/lib/command.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
|
-
import { promisify } from "node:util";
|
|
3
|
-
|
|
4
|
-
const execFileAsync = promisify(execFile);
|
|
5
|
-
|
|
6
|
-
export async function runCommand(command, args, options = {}) {
|
|
7
|
-
const { cwd } = options;
|
|
8
|
-
return execFileAsync(command, args, { cwd, env: process.env, maxBuffer: 10 * 1024 * 1024 });
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function runJsonCommand(command, args, options = {}) {
|
|
12
|
-
const { stdout } = await runCommand(command, args, options);
|
|
13
|
-
return JSON.parse(stdout);
|
|
14
|
-
}
|
package/src/lib/fs.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { mkdir, readdir, readFile, stat, writeFile, copyFile } from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
const COPY_EXCLUDES = new Set([
|
|
5
|
-
".git",
|
|
6
|
-
"node_modules",
|
|
7
|
-
".pnpm-store",
|
|
8
|
-
".venv",
|
|
9
|
-
"__pycache__",
|
|
10
|
-
".pytest_cache",
|
|
11
|
-
"dist",
|
|
12
|
-
"build",
|
|
13
|
-
"coverage",
|
|
14
|
-
]);
|
|
15
|
-
|
|
16
|
-
export async function ensureDirectory(targetPath) {
|
|
17
|
-
await mkdir(targetPath, { recursive: true });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function writeJsonFile(targetPath, payload) {
|
|
21
|
-
await ensureDirectory(path.dirname(targetPath));
|
|
22
|
-
await writeFile(targetPath, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function readJsonFile(targetPath) {
|
|
26
|
-
return JSON.parse(await readFile(targetPath, "utf8"));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function assertEmptyRepoRoot(cwd) {
|
|
30
|
-
const entries = await readdir(cwd, { withFileTypes: true });
|
|
31
|
-
const materialEntries = entries.filter((entry) => entry.name !== ".git");
|
|
32
|
-
|
|
33
|
-
if (materialEntries.length > 0) {
|
|
34
|
-
const names = materialEntries.map((entry) => entry.name).join(", ");
|
|
35
|
-
throw new Error(
|
|
36
|
-
`init must run inside an empty git repo root. Remove existing entries first: ${names}`,
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export async function copyDirectory(sourceDir, targetDir) {
|
|
42
|
-
const entries = await readdir(sourceDir, { withFileTypes: true });
|
|
43
|
-
|
|
44
|
-
for (const entry of entries) {
|
|
45
|
-
if (COPY_EXCLUDES.has(entry.name)) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const sourcePath = path.join(sourceDir, entry.name);
|
|
50
|
-
const targetPath = path.join(targetDir, entry.name);
|
|
51
|
-
|
|
52
|
-
if (entry.isDirectory()) {
|
|
53
|
-
await ensureDirectory(targetPath);
|
|
54
|
-
await copyDirectory(sourcePath, targetPath);
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (entry.isFile()) {
|
|
59
|
-
await ensureDirectory(path.dirname(targetPath));
|
|
60
|
-
await copyFile(sourcePath, targetPath);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export async function walkFiles(rootDir, visitor) {
|
|
66
|
-
const entries = await readdir(rootDir, { withFileTypes: true });
|
|
67
|
-
for (const entry of entries) {
|
|
68
|
-
if (entry.name === ".git") {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const fullPath = path.join(rootDir, entry.name);
|
|
73
|
-
if (entry.isDirectory()) {
|
|
74
|
-
await walkFiles(fullPath, visitor);
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (entry.isFile()) {
|
|
79
|
-
await visitor(fullPath);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export async function isProbablyTextFile(filePath) {
|
|
85
|
-
const fileStat = await stat(filePath);
|
|
86
|
-
if (fileStat.size === 0) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const sample = await readFile(filePath);
|
|
91
|
-
return !sample.includes(0);
|
|
92
|
-
}
|
package/src/lib/git.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { stat } from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
import { runCommand } from "./command.js";
|
|
5
|
-
|
|
6
|
-
function parseRemoteUrl(remoteUrl) {
|
|
7
|
-
const sshMatch = remoteUrl.match(/^git@github\.com:(?<owner>[^/]+)\/(?<repo>[^/.]+?)(?:\.git)?$/);
|
|
8
|
-
if (sshMatch?.groups) {
|
|
9
|
-
return { owner: sshMatch.groups.owner, repo: sshMatch.groups.repo };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const httpsMatch = remoteUrl.match(
|
|
13
|
-
/^https:\/\/github\.com\/(?<owner>[^/]+)\/(?<repo>[^/.]+?)(?:\.git)?$/,
|
|
14
|
-
);
|
|
15
|
-
if (httpsMatch?.groups) {
|
|
16
|
-
return { owner: httpsMatch.groups.owner, repo: httpsMatch.groups.repo };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function validateGitRepoRoot(cwd) {
|
|
23
|
-
try {
|
|
24
|
-
await stat(path.join(cwd, ".git"));
|
|
25
|
-
} catch {
|
|
26
|
-
throw new Error("current directory must already contain a .git entry");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function readOriginRemote(cwd) {
|
|
31
|
-
try {
|
|
32
|
-
const { stdout } = await runCommand("git", ["config", "--get", "remote.origin.url"], { cwd });
|
|
33
|
-
const remoteUrl = stdout.trim();
|
|
34
|
-
if (!remoteUrl) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return parseRemoteUrl(remoteUrl);
|
|
39
|
-
} catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function checkoutRepository(nameWithOwner, ref, targetDir) {
|
|
45
|
-
const url = `https://github.com/${nameWithOwner}.git`;
|
|
46
|
-
await runCommand("git", ["init", targetDir]);
|
|
47
|
-
await runCommand("git", ["-C", targetDir, "remote", "add", "origin", url]);
|
|
48
|
-
await runCommand("git", ["-C", targetDir, "fetch", "--depth", "1", "origin", ref]);
|
|
49
|
-
await runCommand("git", ["-C", targetDir, "checkout", "FETCH_HEAD"]);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export async function readGitCommit(cwd) {
|
|
53
|
-
const { stdout } = await runCommand("git", ["-C", cwd, "rev-parse", "HEAD"]);
|
|
54
|
-
return stdout.trim();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { parseRemoteUrl };
|
package/src/lib/github.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { runCommand, runJsonCommand } from "./command.js";
|
|
2
|
-
|
|
3
|
-
function normalizeRepository(repository) {
|
|
4
|
-
return {
|
|
5
|
-
name: repository.name,
|
|
6
|
-
nameWithOwner: repository.nameWithOwner,
|
|
7
|
-
url: repository.url,
|
|
8
|
-
defaultBranch: repository.defaultBranchRef?.name ?? "main",
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export async function assertGhCliAuthenticated() {
|
|
13
|
-
try {
|
|
14
|
-
await runCommand("gh", ["auth", "status"]);
|
|
15
|
-
} catch {
|
|
16
|
-
throw new Error(
|
|
17
|
-
"GitHub CLI authentication is required. Configure gh auth or GH_TOKEN with repo/project scope first.",
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function listTemplateRepositories(owner) {
|
|
23
|
-
const repositories = await runJsonCommand("gh", [
|
|
24
|
-
"repo",
|
|
25
|
-
"list",
|
|
26
|
-
owner,
|
|
27
|
-
"--limit",
|
|
28
|
-
"200",
|
|
29
|
-
"--json",
|
|
30
|
-
"name,nameWithOwner,url,defaultBranchRef,isArchived",
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
|
-
return repositories
|
|
34
|
-
.filter((repository) => !repository.isArchived && repository.name.startsWith("template-"))
|
|
35
|
-
.map(normalizeRepository)
|
|
36
|
-
.sort((left, right) => left.name.localeCompare(right.name));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function getRepositoryMetadata(nameWithOwner) {
|
|
40
|
-
const repository = await runJsonCommand("gh", [
|
|
41
|
-
"repo",
|
|
42
|
-
"view",
|
|
43
|
-
nameWithOwner,
|
|
44
|
-
"--json",
|
|
45
|
-
"name,nameWithOwner,url,defaultBranchRef",
|
|
46
|
-
]);
|
|
47
|
-
return normalizeRepository(repository);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export async function ensureGitHubRepositoryExists(nameWithOwner) {
|
|
51
|
-
await getRepositoryMetadata(nameWithOwner);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export async function createProject(owner, title) {
|
|
55
|
-
return runJsonCommand("gh", [
|
|
56
|
-
"project",
|
|
57
|
-
"create",
|
|
58
|
-
"--owner",
|
|
59
|
-
owner,
|
|
60
|
-
"--title",
|
|
61
|
-
title,
|
|
62
|
-
"--format",
|
|
63
|
-
"json",
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export async function getProject(owner, number) {
|
|
68
|
-
return runJsonCommand("gh", [
|
|
69
|
-
"project",
|
|
70
|
-
"view",
|
|
71
|
-
String(number),
|
|
72
|
-
"--owner",
|
|
73
|
-
owner,
|
|
74
|
-
"--format",
|
|
75
|
-
"json",
|
|
76
|
-
]);
|
|
77
|
-
}
|
package/src/lib/prompt.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import readline from "node:readline/promises";
|
|
2
|
-
import { stdin as input, stdout as output } from "node:process";
|
|
3
|
-
|
|
4
|
-
function createInterface() {
|
|
5
|
-
return readline.createInterface({ input, output });
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function promptText(label, defaultValue) {
|
|
9
|
-
const rl = createInterface();
|
|
10
|
-
const suffix = defaultValue ? ` [${defaultValue}]` : "";
|
|
11
|
-
const answer = await rl.question(`${label}${suffix}: `);
|
|
12
|
-
rl.close();
|
|
13
|
-
return answer.trim() || defaultValue;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export async function confirm(label, defaultValue = true) {
|
|
17
|
-
const rl = createInterface();
|
|
18
|
-
const defaultLabel = defaultValue ? "Y/n" : "y/N";
|
|
19
|
-
const answer = await rl.question(`${label} [${defaultLabel}]: `);
|
|
20
|
-
rl.close();
|
|
21
|
-
|
|
22
|
-
const normalized = answer.trim().toLowerCase();
|
|
23
|
-
if (!normalized) {
|
|
24
|
-
return defaultValue;
|
|
25
|
-
}
|
|
26
|
-
return normalized === "y" || normalized === "yes";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function selectFromList(label, options) {
|
|
30
|
-
if (options.length === 0) {
|
|
31
|
-
throw new Error("selection requires at least one option");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
console.log(label);
|
|
35
|
-
options.forEach((option, index) => {
|
|
36
|
-
console.log(` ${index + 1}. ${option}`);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const rl = createInterface();
|
|
40
|
-
const answer = await rl.question("Select a number [1]: ");
|
|
41
|
-
rl.close();
|
|
42
|
-
|
|
43
|
-
if (!answer.trim()) {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const index = Number.parseInt(answer.trim(), 10) - 1;
|
|
48
|
-
if (!Number.isInteger(index) || index < 0 || index >= options.length) {
|
|
49
|
-
throw new Error(`invalid selection: ${answer}`);
|
|
50
|
-
}
|
|
51
|
-
return index;
|
|
52
|
-
}
|
package/src/lib/system.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { runCommand } from "./command.js";
|
|
2
|
-
|
|
3
|
-
export async function assertCommandAvailable(command) {
|
|
4
|
-
try {
|
|
5
|
-
await runCommand("which", [command]);
|
|
6
|
-
} catch {
|
|
7
|
-
throw new Error(`required command not found in PATH: ${command}`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function assertRequiredCommands(commands) {
|
|
12
|
-
for (const command of commands) {
|
|
13
|
-
await assertCommandAvailable(command);
|
|
14
|
-
}
|
|
15
|
-
}
|