@dewtech/dare-cli 3.2.0 → 3.4.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/LICENSE +21 -0
- package/README.md +764 -762
- package/dist/__tests__/confidence.test.js +13 -13
- package/dist/__tests__/dag-converter.test.js +56 -56
- package/dist/__tests__/dag-runner/ralph-loop.test.js +107 -45
- package/dist/__tests__/dag-runner/ralph-loop.test.js.map +1 -1
- package/dist/__tests__/dag-runner/state-store.test.d.ts +2 -0
- package/dist/__tests__/dag-runner/state-store.test.d.ts.map +1 -0
- package/dist/__tests__/dag-runner/state-store.test.js +74 -0
- package/dist/__tests__/dag-runner/state-store.test.js.map +1 -0
- package/dist/__tests__/ide-command-parity.test.js +1 -0
- package/dist/__tests__/ide-command-parity.test.js.map +1 -1
- package/dist/__tests__/mcp-server/server.test.js +3 -16
- package/dist/__tests__/mcp-server/server.test.js.map +1 -1
- package/dist/__tests__/project-generator.test.d.ts +2 -0
- package/dist/__tests__/project-generator.test.d.ts.map +1 -0
- package/dist/__tests__/project-generator.test.js +56 -0
- package/dist/__tests__/project-generator.test.js.map +1 -0
- package/dist/__tests__/refine.test.js +49 -49
- package/dist/__tests__/reverse-collection.test.js +6 -6
- package/dist/__tests__/review.test.js +38 -38
- package/dist/__tests__/security-hardening.test.d.ts +2 -0
- package/dist/__tests__/security-hardening.test.d.ts.map +1 -0
- package/dist/__tests__/security-hardening.test.js +101 -0
- package/dist/__tests__/security-hardening.test.js.map +1 -0
- package/dist/__tests__/validate.test.js +65 -65
- package/dist/bin/dare.js +2 -0
- package/dist/bin/dare.js.map +1 -1
- package/dist/commands/__tests__/bench.spec.d.ts +2 -0
- package/dist/commands/__tests__/bench.spec.d.ts.map +1 -0
- package/dist/commands/__tests__/bench.spec.js +106 -0
- package/dist/commands/__tests__/bench.spec.js.map +1 -0
- package/dist/commands/__tests__/execute.best-of.spec.d.ts +2 -0
- package/dist/commands/__tests__/execute.best-of.spec.d.ts.map +1 -0
- package/dist/commands/__tests__/execute.best-of.spec.js +24 -0
- package/dist/commands/__tests__/execute.best-of.spec.js.map +1 -0
- package/dist/commands/__tests__/execute.telemetry.spec.d.ts +2 -0
- package/dist/commands/__tests__/execute.telemetry.spec.d.ts.map +1 -0
- package/dist/commands/__tests__/execute.telemetry.spec.js +93 -0
- package/dist/commands/__tests__/execute.telemetry.spec.js.map +1 -0
- package/dist/commands/__tests__/execute.verify.spec.d.ts +2 -0
- package/dist/commands/__tests__/execute.verify.spec.d.ts.map +1 -0
- package/dist/commands/__tests__/execute.verify.spec.js +150 -0
- package/dist/commands/__tests__/execute.verify.spec.js.map +1 -0
- package/dist/commands/__tests__/init-validation.test.d.ts +2 -0
- package/dist/commands/__tests__/init-validation.test.d.ts.map +1 -0
- package/dist/commands/__tests__/init-validation.test.js +81 -0
- package/dist/commands/__tests__/init-validation.test.js.map +1 -0
- package/dist/commands/__tests__/init.integration.spec.js +6 -4
- package/dist/commands/__tests__/init.integration.spec.js.map +1 -1
- package/dist/commands/__tests__/init.spec.d.ts +2 -0
- package/dist/commands/__tests__/init.spec.d.ts.map +1 -0
- package/dist/commands/__tests__/init.spec.js +88 -0
- package/dist/commands/__tests__/init.spec.js.map +1 -0
- package/dist/commands/bench.d.ts +10 -0
- package/dist/commands/bench.d.ts.map +1 -0
- package/dist/commands/bench.js +64 -0
- package/dist/commands/bench.js.map +1 -0
- package/dist/commands/blueprint.js +122 -122
- package/dist/commands/design.js +20 -20
- package/dist/commands/execute-verification.d.ts +51 -0
- package/dist/commands/execute-verification.d.ts.map +1 -0
- package/dist/commands/execute-verification.js +201 -0
- package/dist/commands/execute-verification.js.map +1 -0
- package/dist/commands/execute.d.ts.map +1 -1
- package/dist/commands/execute.js +139 -2
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/init-validation.d.ts +22 -0
- package/dist/commands/init-validation.d.ts.map +1 -0
- package/dist/commands/init-validation.js +54 -0
- package/dist/commands/init-validation.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +26 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/dag-runner/ralph-loop.d.ts +9 -9
- package/dist/dag-runner/ralph-loop.d.ts.map +1 -1
- package/dist/dag-runner/ralph-loop.js +89 -113
- package/dist/dag-runner/ralph-loop.js.map +1 -1
- package/dist/dag-runner/state-store.d.ts +14 -1
- package/dist/dag-runner/state-store.d.ts.map +1 -1
- package/dist/dag-runner/state-store.js +39 -8
- package/dist/dag-runner/state-store.js.map +1 -1
- package/dist/exec/npm-invoke.d.ts +8 -0
- package/dist/exec/npm-invoke.d.ts.map +1 -0
- package/dist/exec/npm-invoke.js +45 -0
- package/dist/exec/npm-invoke.js.map +1 -0
- package/dist/exec/safe-spawn.d.ts +21 -0
- package/dist/exec/safe-spawn.d.ts.map +1 -0
- package/dist/exec/safe-spawn.js +108 -0
- package/dist/exec/safe-spawn.js.map +1 -0
- package/dist/graphrag/graph-rag.js +24 -24
- package/dist/graphrag/types.d.ts +2 -2
- package/dist/graphrag/types.d.ts.map +1 -1
- package/dist/mcp-server/__tests__/auth.test.d.ts +2 -0
- package/dist/mcp-server/__tests__/auth.test.d.ts.map +1 -0
- package/dist/mcp-server/__tests__/auth.test.js +72 -0
- package/dist/mcp-server/__tests__/auth.test.js.map +1 -0
- package/dist/mcp-server/__tests__/boot-config.test.d.ts +2 -0
- package/dist/mcp-server/__tests__/boot-config.test.d.ts.map +1 -0
- package/dist/mcp-server/__tests__/boot-config.test.js +29 -0
- package/dist/mcp-server/__tests__/boot-config.test.js.map +1 -0
- package/dist/mcp-server/__tests__/error-sanitize.test.d.ts +2 -0
- package/dist/mcp-server/__tests__/error-sanitize.test.d.ts.map +1 -0
- package/dist/mcp-server/__tests__/error-sanitize.test.js +66 -0
- package/dist/mcp-server/__tests__/error-sanitize.test.js.map +1 -0
- package/dist/mcp-server/__tests__/path-confinement.test.d.ts +2 -0
- package/dist/mcp-server/__tests__/path-confinement.test.d.ts.map +1 -0
- package/dist/mcp-server/__tests__/path-confinement.test.js +135 -0
- package/dist/mcp-server/__tests__/path-confinement.test.js.map +1 -0
- package/dist/mcp-server/bin/server.js +18 -6
- package/dist/mcp-server/bin/server.js.map +1 -1
- package/dist/mcp-server/boot-config.d.ts +6 -0
- package/dist/mcp-server/boot-config.d.ts.map +1 -0
- package/dist/mcp-server/boot-config.js +17 -0
- package/dist/mcp-server/boot-config.js.map +1 -0
- package/dist/mcp-server/middleware/auth.d.ts +10 -0
- package/dist/mcp-server/middleware/auth.d.ts.map +1 -0
- package/dist/mcp-server/middleware/auth.js +44 -0
- package/dist/mcp-server/middleware/auth.js.map +1 -0
- package/dist/mcp-server/middleware/cors.d.ts +6 -0
- package/dist/mcp-server/middleware/cors.d.ts.map +1 -0
- package/dist/mcp-server/middleware/cors.js +30 -0
- package/dist/mcp-server/middleware/cors.js.map +1 -0
- package/dist/mcp-server/middleware/error-handler.d.ts +11 -0
- package/dist/mcp-server/middleware/error-handler.d.ts.map +1 -0
- package/dist/mcp-server/middleware/error-handler.js +14 -0
- package/dist/mcp-server/middleware/error-handler.js.map +1 -0
- package/dist/mcp-server/server.d.ts +7 -2
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +185 -105
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/skills/registry-mock.json +109 -109
- package/dist/skills/tests/manifest.spec.js +20 -20
- package/dist/stacks/__tests__/dna-emitter.spec.js +6 -6
- package/dist/stacks/dna-emitter.d.ts.map +1 -1
- package/dist/stacks/dna-emitter.js +70 -79
- package/dist/stacks/dna-emitter.js.map +1 -1
- package/dist/stacks/ruby-rails-8/scaffold.js +15 -15
- package/dist/utils/UpdateApplier.d.ts.map +1 -1
- package/dist/utils/UpdateApplier.js +8 -0
- package/dist/utils/UpdateApplier.js.map +1 -1
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +23 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/path-safety.d.ts +22 -0
- package/dist/utils/path-safety.d.ts.map +1 -0
- package/dist/utils/path-safety.js +83 -0
- package/dist/utils/path-safety.js.map +1 -0
- package/dist/utils/project-generator.d.ts.map +1 -1
- package/dist/utils/project-generator.js +256 -252
- package/dist/utils/project-generator.js.map +1 -1
- package/dist/utils/stack-bootstrap.js +373 -373
- package/dist/utils/stack-bootstrap.js.map +1 -1
- package/dist/utils/templates.js +394 -394
- package/dist/verification/__tests__/anti-tamper.test.d.ts +2 -0
- package/dist/verification/__tests__/anti-tamper.test.d.ts.map +1 -0
- package/dist/verification/__tests__/anti-tamper.test.js +73 -0
- package/dist/verification/__tests__/anti-tamper.test.js.map +1 -0
- package/dist/verification/__tests__/bench-fixtures.test.d.ts +2 -0
- package/dist/verification/__tests__/bench-fixtures.test.d.ts.map +1 -0
- package/dist/verification/__tests__/bench-fixtures.test.js +35 -0
- package/dist/verification/__tests__/bench-fixtures.test.js.map +1 -0
- package/dist/verification/__tests__/bench-harness.test.d.ts +2 -0
- package/dist/verification/__tests__/bench-harness.test.d.ts.map +1 -0
- package/dist/verification/__tests__/bench-harness.test.js +75 -0
- package/dist/verification/__tests__/bench-harness.test.js.map +1 -0
- package/dist/verification/__tests__/bench-report.test.d.ts +2 -0
- package/dist/verification/__tests__/bench-report.test.d.ts.map +1 -0
- package/dist/verification/__tests__/bench-report.test.js +73 -0
- package/dist/verification/__tests__/bench-report.test.js.map +1 -0
- package/dist/verification/__tests__/best-of-n-runner.test.d.ts +2 -0
- package/dist/verification/__tests__/best-of-n-runner.test.d.ts.map +1 -0
- package/dist/verification/__tests__/best-of-n-runner.test.js +94 -0
- package/dist/verification/__tests__/best-of-n-runner.test.js.map +1 -0
- package/dist/verification/__tests__/config.test.d.ts +2 -0
- package/dist/verification/__tests__/config.test.d.ts.map +1 -0
- package/dist/verification/__tests__/config.test.js +50 -0
- package/dist/verification/__tests__/config.test.js.map +1 -0
- package/dist/verification/__tests__/decay-policy.test.d.ts +2 -0
- package/dist/verification/__tests__/decay-policy.test.d.ts.map +1 -0
- package/dist/verification/__tests__/decay-policy.test.js +130 -0
- package/dist/verification/__tests__/decay-policy.test.js.map +1 -0
- package/dist/verification/__tests__/fail-to-pass.test.d.ts +2 -0
- package/dist/verification/__tests__/fail-to-pass.test.d.ts.map +1 -0
- package/dist/verification/__tests__/fail-to-pass.test.js +107 -0
- package/dist/verification/__tests__/fail-to-pass.test.js.map +1 -0
- package/dist/verification/__tests__/failure-signature.test.d.ts +2 -0
- package/dist/verification/__tests__/failure-signature.test.d.ts.map +1 -0
- package/dist/verification/__tests__/failure-signature.test.js +40 -0
- package/dist/verification/__tests__/failure-signature.test.js.map +1 -0
- package/dist/verification/__tests__/logger.test.d.ts +2 -0
- package/dist/verification/__tests__/logger.test.d.ts.map +1 -0
- package/dist/verification/__tests__/logger.test.js +23 -0
- package/dist/verification/__tests__/logger.test.js.map +1 -0
- package/dist/verification/__tests__/mutation-cargo-mutants.test.d.ts +2 -0
- package/dist/verification/__tests__/mutation-cargo-mutants.test.d.ts.map +1 -0
- package/dist/verification/__tests__/mutation-cargo-mutants.test.js +96 -0
- package/dist/verification/__tests__/mutation-cargo-mutants.test.js.map +1 -0
- package/dist/verification/__tests__/mutation-infection.test.d.ts +2 -0
- package/dist/verification/__tests__/mutation-infection.test.d.ts.map +1 -0
- package/dist/verification/__tests__/mutation-infection.test.js +101 -0
- package/dist/verification/__tests__/mutation-infection.test.js.map +1 -0
- package/dist/verification/__tests__/mutation-mutmut.test.d.ts +2 -0
- package/dist/verification/__tests__/mutation-mutmut.test.d.ts.map +1 -0
- package/dist/verification/__tests__/mutation-mutmut.test.js +102 -0
- package/dist/verification/__tests__/mutation-mutmut.test.js.map +1 -0
- package/dist/verification/__tests__/mutation-registry.test.d.ts +2 -0
- package/dist/verification/__tests__/mutation-registry.test.d.ts.map +1 -0
- package/dist/verification/__tests__/mutation-registry.test.js +28 -0
- package/dist/verification/__tests__/mutation-registry.test.js.map +1 -0
- package/dist/verification/__tests__/mutation-stryker.test.d.ts +2 -0
- package/dist/verification/__tests__/mutation-stryker.test.d.ts.map +1 -0
- package/dist/verification/__tests__/mutation-stryker.test.js +88 -0
- package/dist/verification/__tests__/mutation-stryker.test.js.map +1 -0
- package/dist/verification/__tests__/no-shell-true.test.d.ts +2 -0
- package/dist/verification/__tests__/no-shell-true.test.d.ts.map +1 -0
- package/dist/verification/__tests__/no-shell-true.test.js +43 -0
- package/dist/verification/__tests__/no-shell-true.test.js.map +1 -0
- package/dist/verification/__tests__/path-safety.test.d.ts +2 -0
- package/dist/verification/__tests__/path-safety.test.d.ts.map +1 -0
- package/dist/verification/__tests__/path-safety.test.js +59 -0
- package/dist/verification/__tests__/path-safety.test.js.map +1 -0
- package/dist/verification/__tests__/prerank.test.d.ts +2 -0
- package/dist/verification/__tests__/prerank.test.d.ts.map +1 -0
- package/dist/verification/__tests__/prerank.test.js +44 -0
- package/dist/verification/__tests__/prerank.test.js.map +1 -0
- package/dist/verification/__tests__/runner.test.d.ts +2 -0
- package/dist/verification/__tests__/runner.test.d.ts.map +1 -0
- package/dist/verification/__tests__/runner.test.js +200 -0
- package/dist/verification/__tests__/runner.test.js.map +1 -0
- package/dist/verification/__tests__/safe-spawn.test.d.ts +2 -0
- package/dist/verification/__tests__/safe-spawn.test.d.ts.map +1 -0
- package/dist/verification/__tests__/safe-spawn.test.js +36 -0
- package/dist/verification/__tests__/safe-spawn.test.js.map +1 -0
- package/dist/verification/__tests__/security.test.d.ts +2 -0
- package/dist/verification/__tests__/security.test.d.ts.map +1 -0
- package/dist/verification/__tests__/security.test.js +79 -0
- package/dist/verification/__tests__/security.test.js.map +1 -0
- package/dist/verification/__tests__/selector-pareto.test.d.ts +2 -0
- package/dist/verification/__tests__/selector-pareto.test.d.ts.map +1 -0
- package/dist/verification/__tests__/selector-pareto.test.js +77 -0
- package/dist/verification/__tests__/selector-pareto.test.js.map +1 -0
- package/dist/verification/__tests__/telemetry.test.d.ts +2 -0
- package/dist/verification/__tests__/telemetry.test.d.ts.map +1 -0
- package/dist/verification/__tests__/telemetry.test.js +116 -0
- package/dist/verification/__tests__/telemetry.test.js.map +1 -0
- package/dist/verification/__tests__/type-check.test.d.ts +2 -0
- package/dist/verification/__tests__/type-check.test.d.ts.map +1 -0
- package/dist/verification/__tests__/type-check.test.js +52 -0
- package/dist/verification/__tests__/type-check.test.js.map +1 -0
- package/dist/verification/__tests__/worktree.test.d.ts +2 -0
- package/dist/verification/__tests__/worktree.test.d.ts.map +1 -0
- package/dist/verification/__tests__/worktree.test.js +41 -0
- package/dist/verification/__tests__/worktree.test.js.map +1 -0
- package/dist/verification/bench/fixtures.d.ts +11 -0
- package/dist/verification/bench/fixtures.d.ts.map +1 -0
- package/dist/verification/bench/fixtures.js +66 -0
- package/dist/verification/bench/fixtures.js.map +1 -0
- package/dist/verification/bench/harness.d.ts +19 -0
- package/dist/verification/bench/harness.d.ts.map +1 -0
- package/dist/verification/bench/harness.js +138 -0
- package/dist/verification/bench/harness.js.map +1 -0
- package/dist/verification/bench/report.d.ts +53 -0
- package/dist/verification/bench/report.d.ts.map +1 -0
- package/dist/verification/bench/report.js +47 -0
- package/dist/verification/bench/report.js.map +1 -0
- package/dist/verification/best-of-n/runner.d.ts +29 -0
- package/dist/verification/best-of-n/runner.d.ts.map +1 -0
- package/dist/verification/best-of-n/runner.js +76 -0
- package/dist/verification/best-of-n/runner.js.map +1 -0
- package/dist/verification/best-of-n/selector/pareto.d.ts +10 -0
- package/dist/verification/best-of-n/selector/pareto.d.ts.map +1 -0
- package/dist/verification/best-of-n/selector/pareto.js +65 -0
- package/dist/verification/best-of-n/selector/pareto.js.map +1 -0
- package/dist/verification/best-of-n/selector/prerank.d.ts +23 -0
- package/dist/verification/best-of-n/selector/prerank.d.ts.map +1 -0
- package/dist/verification/best-of-n/selector/prerank.js +32 -0
- package/dist/verification/best-of-n/selector/prerank.js.map +1 -0
- package/dist/verification/best-of-n/worktree.d.ts +9 -0
- package/dist/verification/best-of-n/worktree.d.ts.map +1 -0
- package/dist/verification/best-of-n/worktree.js +100 -0
- package/dist/verification/best-of-n/worktree.js.map +1 -0
- package/dist/verification/config.d.ts +24 -0
- package/dist/verification/config.d.ts.map +1 -0
- package/dist/verification/config.js +168 -0
- package/dist/verification/config.js.map +1 -0
- package/dist/verification/decay/policy.d.ts +16 -0
- package/dist/verification/decay/policy.d.ts.map +1 -0
- package/dist/verification/decay/policy.js +64 -0
- package/dist/verification/decay/policy.js.map +1 -0
- package/dist/verification/decay/signature.d.ts +6 -0
- package/dist/verification/decay/signature.d.ts.map +1 -0
- package/dist/verification/decay/signature.js +18 -0
- package/dist/verification/decay/signature.js.map +1 -0
- package/dist/verification/gates/anti-tamper.d.ts +16 -0
- package/dist/verification/gates/anti-tamper.d.ts.map +1 -0
- package/dist/verification/gates/anti-tamper.js +142 -0
- package/dist/verification/gates/anti-tamper.js.map +1 -0
- package/dist/verification/gates/fail-to-pass.d.ts +39 -0
- package/dist/verification/gates/fail-to-pass.d.ts.map +1 -0
- package/dist/verification/gates/fail-to-pass.js +173 -0
- package/dist/verification/gates/fail-to-pass.js.map +1 -0
- package/dist/verification/gates/mutation/adapter.d.ts +34 -0
- package/dist/verification/gates/mutation/adapter.d.ts.map +1 -0
- package/dist/verification/gates/mutation/adapter.js +22 -0
- package/dist/verification/gates/mutation/adapter.js.map +1 -0
- package/dist/verification/gates/mutation/cargo-mutants.d.ts +28 -0
- package/dist/verification/gates/mutation/cargo-mutants.d.ts.map +1 -0
- package/dist/verification/gates/mutation/cargo-mutants.js +170 -0
- package/dist/verification/gates/mutation/cargo-mutants.js.map +1 -0
- package/dist/verification/gates/mutation/infection.d.ts +28 -0
- package/dist/verification/gates/mutation/infection.d.ts.map +1 -0
- package/dist/verification/gates/mutation/infection.js +149 -0
- package/dist/verification/gates/mutation/infection.js.map +1 -0
- package/dist/verification/gates/mutation/mutmut.d.ts +23 -0
- package/dist/verification/gates/mutation/mutmut.d.ts.map +1 -0
- package/dist/verification/gates/mutation/mutmut.js +148 -0
- package/dist/verification/gates/mutation/mutmut.js.map +1 -0
- package/dist/verification/gates/mutation/stryker.d.ts +19 -0
- package/dist/verification/gates/mutation/stryker.d.ts.map +1 -0
- package/dist/verification/gates/mutation/stryker.js +103 -0
- package/dist/verification/gates/mutation/stryker.js.map +1 -0
- package/dist/verification/gates/type-check.d.ts +11 -0
- package/dist/verification/gates/type-check.d.ts.map +1 -0
- package/dist/verification/gates/type-check.js +84 -0
- package/dist/verification/gates/type-check.js.map +1 -0
- package/dist/verification/registry.d.ts +6 -0
- package/dist/verification/registry.d.ts.map +1 -0
- package/dist/verification/registry.js +49 -0
- package/dist/verification/registry.js.map +1 -0
- package/dist/verification/runner.d.ts +27 -0
- package/dist/verification/runner.d.ts.map +1 -0
- package/dist/verification/runner.js +173 -0
- package/dist/verification/runner.js.map +1 -0
- package/dist/verification/telemetry.d.ts +18 -0
- package/dist/verification/telemetry.d.ts.map +1 -0
- package/dist/verification/telemetry.js +71 -0
- package/dist/verification/telemetry.js.map +1 -0
- package/dist/verification/types.d.ts +89 -0
- package/dist/verification/types.d.ts.map +1 -0
- package/dist/verification/types.js +3 -0
- package/dist/verification/types.js.map +1 -0
- package/package.json +96 -91
- package/templates/DARE-dag-example.yaml +280 -280
- package/templates/UPDATE-MANIFEST.json +68 -48
- package/templates/backend/node-nestjs/.env.example +9 -9
- package/templates/backend/node-nestjs/nest-cli.json +8 -8
- package/templates/backend/node-nestjs/package.json +50 -50
- package/templates/backend/node-nestjs/src/app.controller.ts +12 -12
- package/templates/backend/node-nestjs/src/app.module.ts +15 -15
- package/templates/backend/node-nestjs/src/app.service.ts +8 -8
- package/templates/backend/node-nestjs/src/main.ts +24 -24
- package/templates/backend/node-nestjs/tsconfig.json +21 -21
- package/templates/backend/php-laravel/.env.example +22 -22
- package/templates/backend/php-laravel/app/Http/Controllers/HealthController.php +15 -15
- package/templates/backend/php-laravel/composer.json +40 -40
- package/templates/backend/python-fastapi/.env.example +4 -4
- package/templates/backend/python-fastapi/app/api/router.py +8 -8
- package/templates/backend/python-fastapi/app/core/config.py +20 -20
- package/templates/backend/python-fastapi/main.py +35 -35
- package/templates/backend/python-fastapi/requirements.txt +13 -13
- package/templates/backend/rust-axum/.env.example +3 -3
- package/templates/backend/rust-axum/Cargo.toml +23 -23
- package/templates/backend/rust-axum/src/errors.rs +30 -30
- package/templates/backend/rust-axum/src/main.rs +32 -32
- package/templates/backend/rust-axum/src/routes.rs +6 -6
- package/templates/frontend/leptos-csr/.cargo/config.toml +2 -2
- package/templates/frontend/leptos-csr/Cargo.toml +16 -16
- package/templates/frontend/leptos-csr/Trunk.toml +10 -10
- package/templates/frontend/leptos-csr/index.html +11 -11
- package/templates/frontend/leptos-csr/src/lib.rs +20 -20
- package/templates/frontend/leptos-csr/style/main.scss +19 -19
- package/templates/frontend/leptos-fullstack/.cargo/config.toml +4 -4
- package/templates/frontend/leptos-fullstack/Cargo.toml +56 -56
- package/templates/frontend/leptos-fullstack/src/app.rs +49 -49
- package/templates/frontend/leptos-fullstack/src/lib.rs +9 -9
- package/templates/frontend/leptos-fullstack/src/main.rs +29 -29
- package/templates/frontend/leptos-fullstack/style/main.scss +19 -19
- package/templates/frontend/react/index.html +12 -12
- package/templates/frontend/react/package.json +35 -35
- package/templates/frontend/react/src/App.tsx +25 -25
- package/templates/frontend/react/src/main.tsx +9 -9
- package/templates/frontend/vue/package.json +32 -32
- package/templates/frontend/vue/src/App.vue +7 -7
- package/templates/frontend/vue/src/main.ts +10 -10
- package/templates/frontend/vue/src/router/index.ts +14 -14
- package/templates/frontend/vue/src/views/HomeView.vue +6 -6
- package/templates/hooks/pre-commit-dare-validate +24 -24
- package/templates/ide/antigravity/.agents/skills/dare-ax/SKILL.md +152 -152
- package/templates/ide/antigravity/.agents/skills/dare-bench/SKILL.md +21 -0
- package/templates/ide/antigravity/.agents/skills/dare-blueprint/SKILL.md +368 -368
- package/templates/ide/antigravity/.agents/skills/dare-bootstrap/SKILL.md +32 -32
- package/templates/ide/antigravity/.agents/skills/dare-bugfix-design/SKILL.md +76 -76
- package/templates/ide/antigravity/.agents/skills/dare-dag/SKILL.md +32 -32
- package/templates/ide/antigravity/.agents/skills/dare-dag-build/SKILL.md +154 -154
- package/templates/ide/antigravity/.agents/skills/dare-dag-run/SKILL.md +130 -130
- package/templates/ide/antigravity/.agents/skills/dare-dag-runner/SKILL.md +203 -203
- package/templates/ide/antigravity/.agents/skills/dare-design/SKILL.md +180 -180
- package/templates/ide/antigravity/.agents/skills/dare-discover/SKILL.md +33 -33
- package/templates/ide/antigravity/.agents/skills/dare-dna/SKILL.md +63 -63
- package/templates/ide/antigravity/.agents/skills/dare-docker/SKILL.md +315 -315
- package/templates/ide/antigravity/.agents/skills/dare-execute/SKILL.md +264 -264
- package/templates/ide/antigravity/.agents/skills/dare-feature-design/SKILL.md +74 -74
- package/templates/ide/antigravity/.agents/skills/dare-frontend-design/SKILL.md +192 -192
- package/templates/ide/antigravity/.agents/skills/dare-graph/SKILL.md +35 -35
- package/templates/ide/antigravity/.agents/skills/dare-info/SKILL.md +31 -31
- package/templates/ide/antigravity/.agents/skills/dare-init/SKILL.md +35 -35
- package/templates/ide/antigravity/.agents/skills/dare-laravel-api/SKILL.md +337 -337
- package/templates/ide/antigravity/.agents/skills/dare-layered-design/SKILL.md +166 -166
- package/templates/ide/antigravity/.agents/skills/dare-llm-integration/SKILL.md +217 -217
- package/templates/ide/antigravity/.agents/skills/dare-migrate/SKILL.md +61 -61
- package/templates/ide/antigravity/.agents/skills/dare-quality-telemetry/SKILL.md +187 -187
- package/templates/ide/antigravity/.agents/skills/dare-realtime/SKILL.md +217 -217
- package/templates/ide/antigravity/.agents/skills/dare-refine/SKILL.md +114 -114
- package/templates/ide/antigravity/.agents/skills/dare-reverse/SKILL.md +108 -108
- package/templates/ide/antigravity/.agents/skills/dare-review/SKILL.md +111 -111
- package/templates/ide/antigravity/.agents/skills/dare-rust-leptos/SKILL.md +263 -263
- package/templates/ide/antigravity/.agents/skills/dare-rust-workspace/SKILL.md +275 -275
- package/templates/ide/antigravity/.agents/skills/dare-security/SKILL.md +274 -274
- package/templates/ide/antigravity/.agents/skills/dare-skill/SKILL.md +35 -35
- package/templates/ide/antigravity/.agents/skills/dare-tasks/SKILL.md +265 -265
- package/templates/ide/antigravity/.agents/skills/dare-telemetry/SKILL.md +188 -188
- package/templates/ide/antigravity/.agents/skills/dare-update/SKILL.md +33 -33
- package/templates/ide/antigravity/.agents/skills/dare-validate/SKILL.md +33 -33
- package/templates/ide/antigravity/.agents/skills/dare-welcome/SKILL.md +30 -30
- package/templates/ide/antigravity/.agents/skills/skill-fastapi-api/SKILL.md +343 -343
- package/templates/ide/antigravity/.agents/skills/skill-go-gin-api/SKILL.md +377 -377
- package/templates/ide/antigravity/.agents/skills/skill-mcp-server/SKILL.md +382 -382
- package/templates/ide/antigravity/.agents/skills/skill-nestjs-api/SKILL.md +326 -326
- package/templates/ide/antigravity/.agents/skills/skill-rails-api/SKILL.md +393 -393
- package/templates/ide/antigravity/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/antigravity/templates/DESIGN-template.md +129 -129
- package/templates/ide/antigravity/templates/TASK-SPEC-template.md +141 -141
- package/templates/ide/antigravity/templates/TASKS-template.md +26 -26
- package/templates/ide/antigravity/templates/TELEMETRY-template.md +125 -125
- package/templates/ide/claude/.claude/commands/dare-ax.md +131 -131
- package/templates/ide/claude/.claude/commands/dare-bench.md +18 -0
- package/templates/ide/claude/.claude/commands/dare-blueprint.md +134 -134
- package/templates/ide/claude/.claude/commands/dare-bootstrap.md +27 -27
- package/templates/ide/claude/.claude/commands/dare-bugfix-design.md +119 -119
- package/templates/ide/claude/.claude/commands/dare-dag-build.md +151 -151
- package/templates/ide/claude/.claude/commands/dare-dag-run.md +109 -109
- package/templates/ide/claude/.claude/commands/dare-dag-runner.md +117 -117
- package/templates/ide/claude/.claude/commands/dare-dag-viz.md +197 -197
- package/templates/ide/claude/.claude/commands/dare-dag.md +27 -27
- package/templates/ide/claude/.claude/commands/dare-design.md +69 -69
- package/templates/ide/claude/.claude/commands/dare-discover.md +28 -28
- package/templates/ide/claude/.claude/commands/dare-dna.md +75 -75
- package/templates/ide/claude/.claude/commands/dare-docker.md +207 -207
- package/templates/ide/claude/.claude/commands/dare-execute.md +152 -152
- package/templates/ide/claude/.claude/commands/dare-feature-design.md +147 -147
- package/templates/ide/claude/.claude/commands/dare-frontend-design.md +149 -149
- package/templates/ide/claude/.claude/commands/dare-graph.md +30 -30
- package/templates/ide/claude/.claude/commands/dare-info.md +26 -26
- package/templates/ide/claude/.claude/commands/dare-init.md +30 -30
- package/templates/ide/claude/.claude/commands/dare-laravel-api.md +211 -211
- package/templates/ide/claude/.claude/commands/dare-layered-design.md +124 -124
- package/templates/ide/claude/.claude/commands/dare-llm-integration.md +148 -148
- package/templates/ide/claude/.claude/commands/dare-migrate.md +72 -72
- package/templates/ide/claude/.claude/commands/dare-quality-telemetry.md +166 -166
- package/templates/ide/claude/.claude/commands/dare-realtime.md +159 -159
- package/templates/ide/claude/.claude/commands/dare-refine.md +145 -145
- package/templates/ide/claude/.claude/commands/dare-reverse.md +139 -139
- package/templates/ide/claude/.claude/commands/dare-review.md +113 -113
- package/templates/ide/claude/.claude/commands/dare-rust-leptos.md +269 -269
- package/templates/ide/claude/.claude/commands/dare-rust-workspace.md +209 -209
- package/templates/ide/claude/.claude/commands/dare-security.md +232 -232
- package/templates/ide/claude/.claude/commands/dare-skill.md +30 -30
- package/templates/ide/claude/.claude/commands/dare-tasks.md +70 -70
- package/templates/ide/claude/.claude/commands/dare-telemetry.md +132 -132
- package/templates/ide/claude/.claude/commands/dare-update.md +28 -28
- package/templates/ide/claude/.claude/commands/dare-validate.md +28 -28
- package/templates/ide/claude/.claude/commands/dare-welcome.md +25 -25
- package/templates/ide/claude/.claude/commands/skill-fastapi-api.md +205 -205
- package/templates/ide/claude/.claude/commands/skill-go-gin-api.md +232 -232
- package/templates/ide/claude/.claude/commands/skill-mcp-server.md +228 -228
- package/templates/ide/claude/.claude/commands/skill-nestjs-api.md +210 -210
- package/templates/ide/claude/.claude/commands/skill-rails-api.md +236 -236
- package/templates/ide/claude/.claude/settings.example.json +35 -35
- package/templates/ide/claude/CLAUDE.md +146 -146
- package/templates/ide/claude/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/claude/templates/DESIGN-template.md +129 -129
- package/templates/ide/claude/templates/TASK-SPEC-template.md +141 -141
- package/templates/ide/claude/templates/TASKS-template.md +26 -26
- package/templates/ide/claude/templates/TELEMETRY-template.md +125 -125
- package/templates/ide/cursor/.cursor/commands/dare-bench.md +18 -0
- package/templates/ide/cursor/.cursor/commands/dare-blueprint.md +86 -86
- package/templates/ide/cursor/.cursor/commands/dare-bootstrap.md +27 -27
- package/templates/ide/cursor/.cursor/commands/dare-bugfix-design.md +64 -64
- package/templates/ide/cursor/.cursor/commands/dare-dag-run.md +110 -110
- package/templates/ide/cursor/.cursor/commands/dare-dag-viz.md +139 -139
- package/templates/ide/cursor/.cursor/commands/dare-dag.md +27 -27
- package/templates/ide/cursor/.cursor/commands/dare-design.md +35 -35
- package/templates/ide/cursor/.cursor/commands/dare-discover.md +28 -28
- package/templates/ide/cursor/.cursor/commands/dare-dna.md +75 -75
- package/templates/ide/cursor/.cursor/commands/dare-docker-compose.md +18 -18
- package/templates/ide/cursor/.cursor/commands/dare-dockerfile.md +17 -17
- package/templates/ide/cursor/.cursor/commands/dare-execute.md +19 -19
- package/templates/ide/cursor/.cursor/commands/dare-feature-design.md +64 -64
- package/templates/ide/cursor/.cursor/commands/dare-graph.md +30 -30
- package/templates/ide/cursor/.cursor/commands/dare-info.md +26 -26
- package/templates/ide/cursor/.cursor/commands/dare-init.md +30 -30
- package/templates/ide/cursor/.cursor/commands/dare-migrate.md +72 -72
- package/templates/ide/cursor/.cursor/commands/dare-refine.md +107 -107
- package/templates/ide/cursor/.cursor/commands/dare-reverse.md +139 -139
- package/templates/ide/cursor/.cursor/commands/dare-review.md +91 -91
- package/templates/ide/cursor/.cursor/commands/dare-skill.md +30 -30
- package/templates/ide/cursor/.cursor/commands/dare-tasks.md +184 -184
- package/templates/ide/cursor/.cursor/commands/dare-telemetry.md +42 -42
- package/templates/ide/cursor/.cursor/commands/dare-update.md +28 -28
- package/templates/ide/cursor/.cursor/commands/dare-validate.md +28 -28
- package/templates/ide/cursor/.cursor/commands/dare-welcome.md +25 -25
- package/templates/ide/cursor/.cursor/rules/skill-ax.mdc +263 -263
- package/templates/ide/cursor/.cursor/rules/skill-bugfix-design.mdc +51 -51
- package/templates/ide/cursor/.cursor/rules/skill-dag-build.mdc +173 -173
- package/templates/ide/cursor/.cursor/rules/skill-dag-run.mdc +134 -134
- package/templates/ide/cursor/.cursor/rules/skill-dag-runner.mdc +221 -221
- package/templates/ide/cursor/.cursor/rules/skill-dna.mdc +63 -63
- package/templates/ide/cursor/.cursor/rules/skill-docker.mdc +33 -33
- package/templates/ide/cursor/.cursor/rules/skill-fastapi-api.mdc +352 -352
- package/templates/ide/cursor/.cursor/rules/skill-feature-design.mdc +43 -43
- package/templates/ide/cursor/.cursor/rules/skill-frontend-design.mdc +244 -244
- package/templates/ide/cursor/.cursor/rules/skill-go-gin-api.mdc +371 -371
- package/templates/ide/cursor/.cursor/rules/skill-laravel-api.mdc +44 -44
- package/templates/ide/cursor/.cursor/rules/skill-layered-design.mdc +266 -266
- package/templates/ide/cursor/.cursor/rules/skill-llm-integration.mdc +295 -295
- package/templates/ide/cursor/.cursor/rules/skill-mcp-server.mdc +367 -367
- package/templates/ide/cursor/.cursor/rules/skill-migrate.mdc +58 -58
- package/templates/ide/cursor/.cursor/rules/skill-nestjs-api.mdc +346 -346
- package/templates/ide/cursor/.cursor/rules/skill-quality-telemetry.mdc +248 -248
- package/templates/ide/cursor/.cursor/rules/skill-rails-api.mdc +400 -400
- package/templates/ide/cursor/.cursor/rules/skill-realtime.mdc +262 -262
- package/templates/ide/cursor/.cursor/rules/skill-reverse.mdc +107 -107
- package/templates/ide/cursor/.cursor/rules/skill-rust-leptos.mdc +281 -281
- package/templates/ide/cursor/.cursor/rules/skill-rust-workspace.mdc +312 -312
- package/templates/ide/cursor/.cursor/rules/skill-security.mdc +245 -245
- package/templates/ide/cursor/.cursor/rules/skill-telemetry.mdc +156 -156
- package/templates/ide/cursor/templates/BLUEPRINT-template.md +193 -193
- package/templates/ide/cursor/templates/DESIGN-template.md +129 -129
- package/templates/ide/cursor/templates/TASK-SPEC-template.md +141 -141
- package/templates/ide/cursor/templates/TASKS-template.md +26 -26
- package/templates/ide/cursor/templates/TELEMETRY-template.md +125 -125
- package/templates/shared/docker-compose.yml +41 -41
- package/templates/stacks/go-gin/.dare/skills.yml +11 -11
- package/templates/stacks/go-gin/.env.example +24 -24
- package/templates/stacks/go-gin/.github/workflows/dare-ci.yml +42 -42
- package/templates/stacks/go-gin/README.md.tpl +38 -38
- package/templates/stacks/go-gin/cmd/server/main.go.tpl +78 -78
- package/templates/stacks/go-gin/db/migrations/0001_create_users.down.sql +2 -2
- package/templates/stacks/go-gin/db/migrations/0001_create_users.up.sql +12 -12
- package/templates/stacks/go-gin/db/queries/users.sql +23 -23
- package/templates/stacks/go-gin/gitignore +7 -7
- package/templates/stacks/go-gin/go.mod.tpl +17 -17
- package/templates/stacks/go-gin/internal/config/config.go +41 -41
- package/templates/stacks/go-gin/internal/db/postgres.go.tpl +25 -25
- package/templates/stacks/go-gin/internal/handler/auth_handler.go.tpl +72 -72
- package/templates/stacks/go-gin/internal/handler/users_handler.go.tpl +72 -72
- package/templates/stacks/go-gin/internal/handler/ws_handler.go +37 -37
- package/templates/stacks/go-gin/internal/llm/dummy.go +14 -14
- package/templates/stacks/go-gin/internal/llm/provider.go +8 -8
- package/templates/stacks/go-gin/internal/middleware/jwt.go.tpl +58 -58
- package/templates/stacks/go-gin/internal/middleware/rate_limit.go +55 -55
- package/templates/stacks/go-gin/internal/model/user.go +17 -17
- package/templates/stacks/go-gin/internal/repository/users_repository.go.tpl +79 -79
- package/templates/stacks/go-gin/internal/service/auth_service.go.tpl +55 -55
- package/templates/stacks/go-gin/internal/service/users_service.go.tpl +53 -53
- package/templates/stacks/go-gin/llms.txt.tpl +54 -54
- package/templates/stacks/go-gin/openapi.json.tpl +46 -46
- package/templates/stacks/go-gin/sqlc.yaml +14 -14
- package/templates/stacks/go-gin/tests/smoke_test.go.tpl +22 -22
- package/templates/stacks/go-stdlib/.dare/skills.yml +11 -11
- package/templates/stacks/go-stdlib/.env.example +24 -24
- package/templates/stacks/go-stdlib/.github/workflows/dare-ci.yml +42 -42
- package/templates/stacks/go-stdlib/README.md.tpl +41 -41
- package/templates/stacks/go-stdlib/cmd/server/main.go.tpl +82 -82
- package/templates/stacks/go-stdlib/db/migrations/0001_create_users.down.sql +2 -2
- package/templates/stacks/go-stdlib/db/migrations/0001_create_users.up.sql +12 -12
- package/templates/stacks/go-stdlib/db/queries/users.sql +23 -23
- package/templates/stacks/go-stdlib/gitignore +6 -6
- package/templates/stacks/go-stdlib/go.mod.tpl +15 -15
- package/templates/stacks/go-stdlib/internal/config/config.go +41 -41
- package/templates/stacks/go-stdlib/internal/db/postgres.go.tpl +24 -24
- package/templates/stacks/go-stdlib/internal/handler/auth_handler.go.tpl +71 -71
- package/templates/stacks/go-stdlib/internal/handler/users_handler.go.tpl +84 -84
- package/templates/stacks/go-stdlib/internal/handler/ws_handler.go +36 -36
- package/templates/stacks/go-stdlib/internal/httpx/json.go +32 -32
- package/templates/stacks/go-stdlib/internal/llm/dummy.go +14 -14
- package/templates/stacks/go-stdlib/internal/llm/provider.go +8 -8
- package/templates/stacks/go-stdlib/internal/middleware/chain.go +21 -21
- package/templates/stacks/go-stdlib/internal/middleware/cors.go +27 -27
- package/templates/stacks/go-stdlib/internal/middleware/jwt.go.tpl +51 -51
- package/templates/stacks/go-stdlib/internal/middleware/rate_limit.go +81 -81
- package/templates/stacks/go-stdlib/internal/model/user.go +17 -17
- package/templates/stacks/go-stdlib/internal/repository/users_repository.go.tpl +75 -75
- package/templates/stacks/go-stdlib/internal/service/auth_service.go.tpl +55 -55
- package/templates/stacks/go-stdlib/internal/service/users_service.go.tpl +53 -53
- package/templates/stacks/go-stdlib/llms.txt.tpl +60 -60
- package/templates/stacks/go-stdlib/openapi.json.tpl +46 -46
- package/templates/stacks/go-stdlib/sqlc.yaml +14 -14
- package/templates/stacks/go-stdlib/tests/smoke_test.go.tpl +45 -45
- package/templates/stacks/mcp-go/.dare/skills.yml +8 -8
- package/templates/stacks/mcp-go/.env.example +14 -14
- package/templates/stacks/mcp-go/.github/workflows/dare-ci.yml +42 -42
- package/templates/stacks/mcp-go/README.md.tpl +50 -50
- package/templates/stacks/mcp-go/cmd/server/main.go.tpl +62 -62
- package/templates/stacks/mcp-go/gitignore +6 -6
- package/templates/stacks/mcp-go/go.mod.tpl +9 -9
- package/templates/stacks/mcp-go/internal/prompts/summarize.go +9 -9
- package/templates/stacks/mcp-go/internal/server/server.go.tpl +80 -80
- package/templates/stacks/mcp-go/internal/tools/echo.go +15 -15
- package/templates/stacks/mcp-go/internal/transports/http.go.tpl +21 -21
- package/templates/stacks/mcp-go/internal/transports/sse.go.tpl +17 -17
- package/templates/stacks/mcp-go/internal/transports/stdio.go.tpl +14 -14
- package/templates/stacks/mcp-go/llms.txt.tpl +60 -60
- package/templates/stacks/mcp-go/openapi.json.tpl +31 -31
- package/templates/stacks/mcp-go/tests/echo_test.go.tpl +37 -37
- package/templates/stacks/mcp-node-ts/.dare/skills.yml +8 -8
- package/templates/stacks/mcp-node-ts/.env.example +16 -16
- package/templates/stacks/mcp-node-ts/.github/workflows/dare-ci.yml +54 -54
- package/templates/stacks/mcp-node-ts/README.md.hbs +49 -49
- package/templates/stacks/mcp-node-ts/gitignore +7 -7
- package/templates/stacks/mcp-node-ts/llms.txt.hbs +61 -61
- package/templates/stacks/mcp-node-ts/openapi.json.hbs +39 -39
- package/templates/stacks/mcp-node-ts/package.json.hbs +35 -35
- package/templates/stacks/mcp-node-ts/src/cli.ts.hbs +71 -71
- package/templates/stacks/mcp-node-ts/src/prompts/index.ts +36 -36
- package/templates/stacks/mcp-node-ts/src/server.ts.hbs +45 -45
- package/templates/stacks/mcp-node-ts/src/tools/echo.ts +23 -23
- package/templates/stacks/mcp-node-ts/src/tools/index.ts +18 -18
- package/templates/stacks/mcp-node-ts/src/transports/http.ts +68 -68
- package/templates/stacks/mcp-node-ts/src/transports/sse.ts +58 -58
- package/templates/stacks/mcp-node-ts/src/transports/stdio.ts +5 -5
- package/templates/stacks/mcp-node-ts/tests/echo.test.ts +50 -50
- package/templates/stacks/mcp-node-ts/tsconfig.json +17 -17
- package/templates/stacks/mcp-python/.dare/skills.yml +8 -8
- package/templates/stacks/mcp-python/.env.example +14 -14
- package/templates/stacks/mcp-python/.github/workflows/dare-ci.yml +42 -42
- package/templates/stacks/mcp-python/README.md.j2 +49 -49
- package/templates/stacks/mcp-python/gitignore +12 -12
- package/templates/stacks/mcp-python/llms.txt.j2 +56 -56
- package/templates/stacks/mcp-python/openapi.json.j2 +33 -33
- package/templates/stacks/mcp-python/pyproject.toml.j2 +37 -37
- package/templates/stacks/mcp-python/src/cli.py.j2 +68 -68
- package/templates/stacks/mcp-python/src/prompts/summarize.py +10 -10
- package/templates/stacks/mcp-python/src/server.py.j2 +28 -28
- package/templates/stacks/mcp-python/src/tools/echo.py +12 -12
- package/templates/stacks/mcp-python/src/transports/http.py +12 -12
- package/templates/stacks/mcp-python/src/transports/sse.py +13 -13
- package/templates/stacks/mcp-python/src/transports/stdio.py +6 -6
- package/templates/stacks/mcp-python/tests/test_echo.py +28 -28
- package/templates/stacks/mcp-rust/.dare/skills.yml +8 -8
- package/templates/stacks/mcp-rust/.env.example +14 -14
- package/templates/stacks/mcp-rust/.github/workflows/dare-ci.yml +38 -38
- package/templates/stacks/mcp-rust/Cargo.toml.tera +35 -35
- package/templates/stacks/mcp-rust/README.md.tera +50 -50
- package/templates/stacks/mcp-rust/gitignore +5 -5
- package/templates/stacks/mcp-rust/llms.txt.tera +60 -60
- package/templates/stacks/mcp-rust/openapi.json.tera +31 -31
- package/templates/stacks/mcp-rust/src/cli.rs.tera +33 -33
- package/templates/stacks/mcp-rust/src/lib.rs +6 -6
- package/templates/stacks/mcp-rust/src/main.rs.tera +30 -30
- package/templates/stacks/mcp-rust/src/prompts/mod.rs +1 -1
- package/templates/stacks/mcp-rust/src/prompts/summarize.rs +5 -5
- package/templates/stacks/mcp-rust/src/server.rs.tera +38 -38
- package/templates/stacks/mcp-rust/src/tools/echo.rs +18 -18
- package/templates/stacks/mcp-rust/src/tools/mod.rs +22 -22
- package/templates/stacks/mcp-rust/src/transports/http.rs +27 -27
- package/templates/stacks/mcp-rust/src/transports/mod.rs +3 -3
- package/templates/stacks/mcp-rust/src/transports/sse.rs +33 -33
- package/templates/stacks/mcp-rust/src/transports/stdio.rs +14 -14
- package/templates/stacks/mcp-rust/tests/echo_test.rs.tera +27 -27
- package/templates/stacks/node-nestjs/.dare/skills.yml +11 -11
- package/templates/stacks/node-nestjs/.env.example +21 -21
- package/templates/stacks/node-nestjs/.github/workflows/dare-ci.yml +54 -54
- package/templates/stacks/node-nestjs/README.md.hbs +35 -35
- package/templates/stacks/node-nestjs/gitignore +7 -7
- package/templates/stacks/node-nestjs/llms.txt.hbs +47 -47
- package/templates/stacks/node-nestjs/nest-cli.json +16 -16
- package/templates/stacks/node-nestjs/openapi.json.hbs +75 -75
- package/templates/stacks/node-nestjs/package.json.hbs +57 -57
- package/templates/stacks/node-nestjs/prisma/schema.prisma +25 -25
- package/templates/stacks/node-nestjs/prisma/seed.ts.hbs +25 -25
- package/templates/stacks/node-nestjs/src/app.module.ts +39 -39
- package/templates/stacks/node-nestjs/src/auth/auth.controller.ts +29 -29
- package/templates/stacks/node-nestjs/src/auth/auth.module.ts +25 -25
- package/templates/stacks/node-nestjs/src/auth/auth.service.ts +36 -36
- package/templates/stacks/node-nestjs/src/auth/dto/login-response.dto.ts +9 -9
- package/templates/stacks/node-nestjs/src/auth/dto/login.dto.ts +17 -17
- package/templates/stacks/node-nestjs/src/auth/jwt.strategy.ts +25 -25
- package/templates/stacks/node-nestjs/src/common/filters/problem-details.filter.ts +38 -38
- package/templates/stacks/node-nestjs/src/common/interceptors/json-response.interceptor.ts +13 -13
- package/templates/stacks/node-nestjs/src/main.ts.hbs +44 -44
- package/templates/stacks/node-nestjs/src/prisma/prisma.module.ts +9 -9
- package/templates/stacks/node-nestjs/src/prisma/prisma.service.ts +9 -9
- package/templates/stacks/node-nestjs/src/users/dto/create-user.dto.ts +22 -22
- package/templates/stacks/node-nestjs/src/users/dto/user.dto.ts +15 -15
- package/templates/stacks/node-nestjs/src/users/users.controller.ts +41 -41
- package/templates/stacks/node-nestjs/src/users/users.module.ts +11 -11
- package/templates/stacks/node-nestjs/src/users/users.repository.ts +38 -38
- package/templates/stacks/node-nestjs/src/users/users.service.ts +38 -38
- package/templates/stacks/node-nestjs/tsconfig.build.json +4 -4
- package/templates/stacks/node-nestjs/tsconfig.json +28 -28
- package/templates/stacks/php-laravel/.dare/skills.yml +11 -11
- package/templates/stacks/php-laravel/.env.example +41 -41
- package/templates/stacks/php-laravel/.github/workflows/dare-ci.yml +43 -43
- package/templates/stacks/php-laravel/README.md.hbs +36 -36
- package/templates/stacks/php-laravel/app/Http/Controllers/Api/AuthController.php +36 -36
- package/templates/stacks/php-laravel/app/Http/Controllers/Api/UsersController.php +33 -33
- package/templates/stacks/php-laravel/app/Http/Requests/CreateUserRequest.php +26 -26
- package/templates/stacks/php-laravel/app/Http/Requests/LoginRequest.php +34 -34
- package/templates/stacks/php-laravel/app/Llm/Contracts/LlmProvider.php +12 -12
- package/templates/stacks/php-laravel/app/Llm/Providers/DummyProvider.php +13 -13
- package/templates/stacks/php-laravel/app/Llm/Providers/OpenAiProvider.php +33 -33
- package/templates/stacks/php-laravel/app/Models/User.php +44 -44
- package/templates/stacks/php-laravel/app/Repositories/UsersRepository.php +32 -32
- package/templates/stacks/php-laravel/app/Services/AuthService.php +37 -37
- package/templates/stacks/php-laravel/app/Services/UsersService.php +57 -57
- package/templates/stacks/php-laravel/artisan +12 -12
- package/templates/stacks/php-laravel/bootstrap/app.php +29 -29
- package/templates/stacks/php-laravel/bootstrap/providers.php +5 -5
- package/templates/stacks/php-laravel/composer.json.hbs +58 -58
- package/templates/stacks/php-laravel/config/l5-swagger.php +41 -41
- package/templates/stacks/php-laravel/config/reverb.php +34 -34
- package/templates/stacks/php-laravel/config/sanctum.php +15 -15
- package/templates/stacks/php-laravel/database/migrations/2026_06_01_000001_create_users_table.php +27 -27
- package/templates/stacks/php-laravel/database/seeders/DatabaseSeeder.php +21 -21
- package/templates/stacks/php-laravel/gitignore +23 -23
- package/templates/stacks/php-laravel/llms.txt.hbs +53 -53
- package/templates/stacks/php-laravel/openapi.json.hbs +43 -43
- package/templates/stacks/php-laravel/phpstan.neon +9 -9
- package/templates/stacks/php-laravel/routes/api.php +13 -13
- package/templates/stacks/php-laravel/routes/channels.php +7 -7
- package/templates/stacks/php-laravel/tests/Feature/AuthTest.php +35 -35
- package/templates/stacks/php-laravel/tests/Feature/UsersTest.php +30 -30
- package/templates/stacks/php-laravel/tests/Pest.php +5 -5
- package/templates/stacks/python-fastapi/.dare/skills.yml +11 -11
- package/templates/stacks/python-fastapi/.env.example +21 -21
- package/templates/stacks/python-fastapi/.github/workflows/dare-ci.yml +43 -43
- package/templates/stacks/python-fastapi/README.md.j2 +35 -35
- package/templates/stacks/python-fastapi/alembic/env.py +46 -46
- package/templates/stacks/python-fastapi/alembic/script.py.mako +26 -26
- package/templates/stacks/python-fastapi/alembic/versions/0001_create_users.py.j2 +37 -37
- package/templates/stacks/python-fastapi/alembic.ini.j2 +39 -39
- package/templates/stacks/python-fastapi/app/core/config.py +24 -24
- package/templates/stacks/python-fastapi/app/core/security.py +34 -34
- package/templates/stacks/python-fastapi/app/db/session.py +22 -22
- package/templates/stacks/python-fastapi/app/main.py.j2 +36 -36
- package/templates/stacks/python-fastapi/app/models/__init__.py +3 -3
- package/templates/stacks/python-fastapi/app/models/user.py +30 -30
- package/templates/stacks/python-fastapi/app/repositories/user_repository.py +34 -34
- package/templates/stacks/python-fastapi/app/routers/auth.py +37 -37
- package/templates/stacks/python-fastapi/app/routers/users.py +46 -46
- package/templates/stacks/python-fastapi/app/schemas/user.py +56 -56
- package/templates/stacks/python-fastapi/app/services/auth_service.py +22 -22
- package/templates/stacks/python-fastapi/app/services/user_service.py +31 -31
- package/templates/stacks/python-fastapi/gitignore +12 -12
- package/templates/stacks/python-fastapi/llms.txt.j2 +53 -53
- package/templates/stacks/python-fastapi/openapi.json.j2 +43 -43
- package/templates/stacks/python-fastapi/pyproject.toml.j2 +45 -45
- package/templates/stacks/python-fastapi/tests/test_auth.py +22 -22
- package/templates/stacks/ruby-rails-8/.dare/skills.yml +50 -50
- package/templates/stacks/ruby-rails-8/.env.example +20 -20
- package/templates/stacks/ruby-rails-8/.github/workflows/dare-ci.yml +112 -112
- package/templates/stacks/ruby-rails-8/Gemfile.erb +61 -61
- package/templates/stacks/ruby-rails-8/app/channels/application_cable/channel.rb +11 -11
- package/templates/stacks/ruby-rails-8/app/channels/application_cable/connection.rb +34 -34
- package/templates/stacks/ruby-rails-8/app/channels/dare_updates_channel.rb +18 -18
- package/templates/stacks/ruby-rails-8/app/channels/user_updates_channel.rb +23 -23
- package/templates/stacks/ruby-rails-8/app/controllers/application_controller.rb +44 -44
- package/templates/stacks/ruby-rails-8/app/controllers/concerns/problem_details.rb +93 -93
- package/templates/stacks/ruby-rails-8/app/handlers/summarize_handler.rb +33 -33
- package/templates/stacks/ruby-rails-8/app/handlers/users_handler.rb +68 -68
- package/templates/stacks/ruby-rails-8/app/llm/cache/llm_cache.rb +44 -44
- package/templates/stacks/ruby-rails-8/app/llm/prompts/prompt_loader.rb +54 -54
- package/templates/stacks/ruby-rails-8/app/llm/prompts/summarize_v1.jinja2 +12 -12
- package/templates/stacks/ruby-rails-8/app/llm/providers/dummy_provider.rb +35 -35
- package/templates/stacks/ruby-rails-8/app/llm/providers/llm_provider.rb +67 -67
- package/templates/stacks/ruby-rails-8/app/llm/providers/openai_provider.rb +62 -62
- package/templates/stacks/ruby-rails-8/app/llm/rate_limit/token_bucket.rb +82 -82
- package/templates/stacks/ruby-rails-8/app/llm/validators/summarize_output_schema.json +21 -21
- package/templates/stacks/ruby-rails-8/app/llm/validators/validator.rb +52 -52
- package/templates/stacks/ruby-rails-8/app/models/user.rb +36 -36
- package/templates/stacks/ruby-rails-8/app/presenters/user_presenter.rb +48 -48
- package/templates/stacks/ruby-rails-8/app/repositories/document_repository.rb +57 -57
- package/templates/stacks/ruby-rails-8/app/repositories/user_repository.rb +73 -73
- package/templates/stacks/ruby-rails-8/app/services/create_user_service.rb +67 -67
- package/templates/stacks/ruby-rails-8/app/services/realtime_service.rb +53 -53
- package/templates/stacks/ruby-rails-8/app/services/summarize_document_service.rb +57 -57
- package/templates/stacks/ruby-rails-8/config/dare.yml +42 -42
- package/templates/stacks/ruby-rails-8/config/initializers/dare.rb +31 -31
- package/templates/stacks/ruby-rails-8/config/initializers/rack_attack.rb +64 -64
- package/templates/stacks/ruby-rails-8/config/initializers/rswag_api.rb +12 -12
- package/templates/stacks/ruby-rails-8/lib/tasks/dare.rake +159 -159
- package/templates/stacks/ruby-rails-8/llms.txt.erb +69 -69
- package/templates/stacks/ruby-rails-8/spec/api/summarize_spec.rb +56 -56
- package/templates/stacks/ruby-rails-8/spec/api/users_spec.rb +72 -72
- package/templates/stacks/ruby-rails-8/spec/channels/dare_updates_channel_spec.rb +61 -61
- package/templates/stacks/ruby-rails-8/spec/channels/user_updates_channel_spec.rb +56 -56
- package/templates/stacks/ruby-rails-8/spec/factories/users.rb +27 -27
- package/templates/stacks/ruby-rails-8/spec/handlers/users_handler_spec.rb +88 -88
- package/templates/stacks/ruby-rails-8/spec/rails_helper.rb +31 -31
- package/templates/stacks/ruby-rails-8/spec/services/create_user_service_spec.rb +88 -88
- package/templates/stacks/ruby-rails-8/spec/services/summarize_document_service_spec.rb +142 -142
- package/templates/stacks/ruby-rails-8/spec/swagger_helper.rb +73 -73
- package/templates/stacks/rust-axum/.dare/skills.yml +11 -11
- package/templates/stacks/rust-axum/.env.example +26 -26
- package/templates/stacks/rust-axum/.github/workflows/dare-ci.yml +40 -40
- package/templates/stacks/rust-axum/Cargo.toml.tera +53 -53
- package/templates/stacks/rust-axum/README.md.tera +37 -37
- package/templates/stacks/rust-axum/gitignore +5 -5
- package/templates/stacks/rust-axum/llms.txt.tera +54 -54
- package/templates/stacks/rust-axum/migrations/0001_create_users.sql +13 -13
- package/templates/stacks/rust-axum/openapi.json.tera +46 -46
- package/templates/stacks/rust-axum/src/config.rs +45 -45
- package/templates/stacks/rust-axum/src/errors.rs +48 -48
- package/templates/stacks/rust-axum/src/handlers/auth.rs +48 -48
- package/templates/stacks/rust-axum/src/handlers/mod.rs +3 -3
- package/templates/stacks/rust-axum/src/handlers/users.rs +81 -81
- package/templates/stacks/rust-axum/src/handlers/ws.rs +24 -24
- package/templates/stacks/rust-axum/src/lib.rs +19 -19
- package/templates/stacks/rust-axum/src/llm/mod.rs +1 -1
- package/templates/stacks/rust-axum/src/llm/provider.rs +48 -48
- package/templates/stacks/rust-axum/src/main.rs.tera +64 -64
- package/templates/stacks/rust-axum/src/middleware/auth.rs +20 -20
- package/templates/stacks/rust-axum/src/middleware/mod.rs +2 -2
- package/templates/stacks/rust-axum/src/middleware/rate_limit.rs +27 -27
- package/templates/stacks/rust-axum/src/models/mod.rs +1 -1
- package/templates/stacks/rust-axum/src/models/user.rs +13 -13
- package/templates/stacks/rust-axum/src/repositories/mod.rs +1 -1
- package/templates/stacks/rust-axum/src/repositories/user_repository.rs +62 -62
- package/templates/stacks/rust-axum/src/services/auth_service.rs +50 -50
- package/templates/stacks/rust-axum/src/services/mod.rs +2 -2
- package/templates/stacks/rust-axum/src/services/user_service.rs +53 -53
- package/templates/stacks/rust-axum/tests/integration_test.rs.tera +13 -13
- package/dist/commands/new.d.ts +0 -16
- package/dist/commands/new.d.ts.map +0 -1
- package/dist/commands/new.js +0 -104
- package/dist/commands/new.js.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — User domain model
|
|
4
|
-
# Convention (ADR-05): models are lean data objects — no callbacks, no fat model
|
|
5
|
-
# Business logic lives in app/services/; data access in app/repositories/
|
|
6
|
-
|
|
7
|
-
class User < ApplicationRecord
|
|
8
|
-
# ── Validations ─────────────────────────────────────────────────────────
|
|
9
|
-
validates :email, presence: true,
|
|
10
|
-
uniqueness: { case_sensitive: false },
|
|
11
|
-
format: { with: URI::MailTo::EMAIL_REGEXP }
|
|
12
|
-
validates :name, presence: true, length: { minimum: 2, maximum: 100 }
|
|
13
|
-
|
|
14
|
-
# ── Scopes ───────────────────────────────────────────────────────────────
|
|
15
|
-
scope :active, -> { where(active: true) }
|
|
16
|
-
|
|
17
|
-
# ── DARE: NO callbacks, NO fat model logic ───────────────────────────────
|
|
18
|
-
# Use Services for: password hashing, welcome emails, event publishing, etc.
|
|
19
|
-
# Use Repositories for: queries, bulk updates, custom SQL
|
|
20
|
-
#
|
|
21
|
-
# WRONG (fat model):
|
|
22
|
-
# before_create :send_welcome_email
|
|
23
|
-
# after_save :publish_event
|
|
24
|
-
#
|
|
25
|
-
# RIGHT (service):
|
|
26
|
-
# Services::CreateUserService.new(...).execute(params)
|
|
27
|
-
|
|
28
|
-
# ── Simple domain helpers (pure data concerns only) ──────────────────────
|
|
29
|
-
def display_name
|
|
30
|
-
name.presence || email.split("@").first
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def can_view?(user_id)
|
|
34
|
-
id == user_id.to_i || admin?
|
|
35
|
-
end
|
|
36
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — User domain model
|
|
4
|
+
# Convention (ADR-05): models are lean data objects — no callbacks, no fat model
|
|
5
|
+
# Business logic lives in app/services/; data access in app/repositories/
|
|
6
|
+
|
|
7
|
+
class User < ApplicationRecord
|
|
8
|
+
# ── Validations ─────────────────────────────────────────────────────────
|
|
9
|
+
validates :email, presence: true,
|
|
10
|
+
uniqueness: { case_sensitive: false },
|
|
11
|
+
format: { with: URI::MailTo::EMAIL_REGEXP }
|
|
12
|
+
validates :name, presence: true, length: { minimum: 2, maximum: 100 }
|
|
13
|
+
|
|
14
|
+
# ── Scopes ───────────────────────────────────────────────────────────────
|
|
15
|
+
scope :active, -> { where(active: true) }
|
|
16
|
+
|
|
17
|
+
# ── DARE: NO callbacks, NO fat model logic ───────────────────────────────
|
|
18
|
+
# Use Services for: password hashing, welcome emails, event publishing, etc.
|
|
19
|
+
# Use Repositories for: queries, bulk updates, custom SQL
|
|
20
|
+
#
|
|
21
|
+
# WRONG (fat model):
|
|
22
|
+
# before_create :send_welcome_email
|
|
23
|
+
# after_save :publish_event
|
|
24
|
+
#
|
|
25
|
+
# RIGHT (service):
|
|
26
|
+
# Services::CreateUserService.new(...).execute(params)
|
|
27
|
+
|
|
28
|
+
# ── Simple domain helpers (pure data concerns only) ──────────────────────
|
|
29
|
+
def display_name
|
|
30
|
+
name.presence || email.split("@").first
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def can_view?(user_id)
|
|
34
|
+
id == user_id.to_i || admin?
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — UserPresenter
|
|
4
|
-
# Convention (ADR-05): serialization concern isolated from model and controller
|
|
5
|
-
# Returns plain Hash; handler renders JSON from it
|
|
6
|
-
|
|
7
|
-
class UserPresenter
|
|
8
|
-
def initialize(user)
|
|
9
|
-
@user = user
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
# Full representation — used in show/create responses
|
|
13
|
-
def as_json(*)
|
|
14
|
-
{
|
|
15
|
-
id: @user.id,
|
|
16
|
-
email: @user.email,
|
|
17
|
-
name: @user.name,
|
|
18
|
-
active: @user.active?,
|
|
19
|
-
created_at: @user.created_at&.iso8601,
|
|
20
|
-
updated_at: @user.updated_at&.iso8601,
|
|
21
|
-
}
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def to_json(*)
|
|
25
|
-
as_json.to_json
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Collection representation — used in index responses
|
|
29
|
-
# Wraps an array of presenters into a standard envelope
|
|
30
|
-
def self.collection(users, meta: {})
|
|
31
|
-
{
|
|
32
|
-
data: users.map { |u| new(u).as_json },
|
|
33
|
-
meta: {
|
|
34
|
-
count: users.size,
|
|
35
|
-
**meta
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Minimal summary representation (e.g. for nested resources)
|
|
41
|
-
def summary
|
|
42
|
-
{
|
|
43
|
-
id: @user.id,
|
|
44
|
-
email: @user.email,
|
|
45
|
-
name: @user.name
|
|
46
|
-
}
|
|
47
|
-
end
|
|
48
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — UserPresenter
|
|
4
|
+
# Convention (ADR-05): serialization concern isolated from model and controller
|
|
5
|
+
# Returns plain Hash; handler renders JSON from it
|
|
6
|
+
|
|
7
|
+
class UserPresenter
|
|
8
|
+
def initialize(user)
|
|
9
|
+
@user = user
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Full representation — used in show/create responses
|
|
13
|
+
def as_json(*)
|
|
14
|
+
{
|
|
15
|
+
id: @user.id,
|
|
16
|
+
email: @user.email,
|
|
17
|
+
name: @user.name,
|
|
18
|
+
active: @user.active?,
|
|
19
|
+
created_at: @user.created_at&.iso8601,
|
|
20
|
+
updated_at: @user.updated_at&.iso8601,
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_json(*)
|
|
25
|
+
as_json.to_json
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Collection representation — used in index responses
|
|
29
|
+
# Wraps an array of presenters into a standard envelope
|
|
30
|
+
def self.collection(users, meta: {})
|
|
31
|
+
{
|
|
32
|
+
data: users.map { |u| new(u).as_json },
|
|
33
|
+
meta: {
|
|
34
|
+
count: users.size,
|
|
35
|
+
**meta
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Minimal summary representation (e.g. for nested resources)
|
|
41
|
+
def summary
|
|
42
|
+
{
|
|
43
|
+
id: @user.id,
|
|
44
|
+
email: @user.email,
|
|
45
|
+
name: @user.name
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — DocumentRepository (interface + ActiveRecord implementation)
|
|
4
|
-
# Convention (ADR-05): data access is isolated here — services never call AR directly
|
|
5
|
-
# This enables easy mocking in unit tests and future DB swaps
|
|
6
|
-
|
|
7
|
-
module Repositories
|
|
8
|
-
class DocumentRepository
|
|
9
|
-
# ── Query ──────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
def find(id)
|
|
12
|
-
Document.find_by(id: id)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def find!(id)
|
|
16
|
-
Document.find(id)
|
|
17
|
-
rescue ActiveRecord::RecordNotFound
|
|
18
|
-
raise ActiveRecord::RecordNotFound, "Document with id=#{id} was not found."
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def all
|
|
22
|
-
Document.order(created_at: :desc)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def by_user(user_id)
|
|
26
|
-
Document.where(user_id: user_id).order(created_at: :desc)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# ── Persistence ────────────────────────────────────────────────────────
|
|
30
|
-
|
|
31
|
-
# Builds a new Document (not persisted).
|
|
32
|
-
def build(attrs = {})
|
|
33
|
-
Document.new(attrs)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Persist (create or update). Raises ActiveRecord::RecordInvalid on failure.
|
|
37
|
-
def save!(document)
|
|
38
|
-
document.save!
|
|
39
|
-
document
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# Update summary and timestamp after LLM processing.
|
|
43
|
-
def update_summary!(document, summary)
|
|
44
|
-
document.update!(summary: summary, summarized_at: Time.current)
|
|
45
|
-
document
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def update!(document, attributes)
|
|
49
|
-
document.update!(attributes)
|
|
50
|
-
document
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def destroy!(document)
|
|
54
|
-
document.destroy!
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — DocumentRepository (interface + ActiveRecord implementation)
|
|
4
|
+
# Convention (ADR-05): data access is isolated here — services never call AR directly
|
|
5
|
+
# This enables easy mocking in unit tests and future DB swaps
|
|
6
|
+
|
|
7
|
+
module Repositories
|
|
8
|
+
class DocumentRepository
|
|
9
|
+
# ── Query ──────────────────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
def find(id)
|
|
12
|
+
Document.find_by(id: id)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def find!(id)
|
|
16
|
+
Document.find(id)
|
|
17
|
+
rescue ActiveRecord::RecordNotFound
|
|
18
|
+
raise ActiveRecord::RecordNotFound, "Document with id=#{id} was not found."
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def all
|
|
22
|
+
Document.order(created_at: :desc)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def by_user(user_id)
|
|
26
|
+
Document.where(user_id: user_id).order(created_at: :desc)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# ── Persistence ────────────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
# Builds a new Document (not persisted).
|
|
32
|
+
def build(attrs = {})
|
|
33
|
+
Document.new(attrs)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Persist (create or update). Raises ActiveRecord::RecordInvalid on failure.
|
|
37
|
+
def save!(document)
|
|
38
|
+
document.save!
|
|
39
|
+
document
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Update summary and timestamp after LLM processing.
|
|
43
|
+
def update_summary!(document, summary)
|
|
44
|
+
document.update!(summary: summary, summarized_at: Time.current)
|
|
45
|
+
document
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update!(document, attributes)
|
|
49
|
+
document.update!(attributes)
|
|
50
|
+
document
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def destroy!(document)
|
|
54
|
+
document.destroy!
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — UserRepository
|
|
4
|
-
# Convention (ADR-05): data access is isolated here — services never call AR directly
|
|
5
|
-
# This enables easy mocking in unit tests and future DB swaps
|
|
6
|
-
|
|
7
|
-
module Repositories
|
|
8
|
-
class UserRepository
|
|
9
|
-
# ── Query ──────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
def find(id)
|
|
12
|
-
User.find_by(id: id)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def find!(id)
|
|
16
|
-
User.find(id)
|
|
17
|
-
rescue ActiveRecord::RecordNotFound
|
|
18
|
-
raise ActiveRecord::RecordNotFound, "User with id=#{id} was not found."
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def find_by_email(email)
|
|
22
|
-
User.find_by(email: email.downcase.strip)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def all_active
|
|
26
|
-
User.active.order(created_at: :desc)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def paginated(page: 1, per: 25)
|
|
30
|
-
User.active
|
|
31
|
-
.order(created_at: :desc)
|
|
32
|
-
.offset((page.to_i - 1) * per.to_i)
|
|
33
|
-
.limit(per.to_i)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def count
|
|
37
|
-
User.count
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# ── Persistence ────────────────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
# Builds a new User (not persisted). Let the service validate input first.
|
|
43
|
-
def build(attributes = {})
|
|
44
|
-
User.new(attributes)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
# Persist (create or update). Raises ActiveRecord::RecordInvalid on failure.
|
|
48
|
-
def save!(user)
|
|
49
|
-
user.save!
|
|
50
|
-
user
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# Persist without raising. Returns false on failure.
|
|
54
|
-
def save(user)
|
|
55
|
-
user.save
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def update!(user, attributes)
|
|
59
|
-
user.update!(attributes)
|
|
60
|
-
user
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def destroy!(user)
|
|
64
|
-
user.destroy!
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# ── Bulk ───────────────────────────────────────────────────────────────
|
|
68
|
-
|
|
69
|
-
def deactivate_all_inactive(since:)
|
|
70
|
-
User.where("last_active_at < ?", since).update_all(active: false)
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — UserRepository
|
|
4
|
+
# Convention (ADR-05): data access is isolated here — services never call AR directly
|
|
5
|
+
# This enables easy mocking in unit tests and future DB swaps
|
|
6
|
+
|
|
7
|
+
module Repositories
|
|
8
|
+
class UserRepository
|
|
9
|
+
# ── Query ──────────────────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
def find(id)
|
|
12
|
+
User.find_by(id: id)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def find!(id)
|
|
16
|
+
User.find(id)
|
|
17
|
+
rescue ActiveRecord::RecordNotFound
|
|
18
|
+
raise ActiveRecord::RecordNotFound, "User with id=#{id} was not found."
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def find_by_email(email)
|
|
22
|
+
User.find_by(email: email.downcase.strip)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def all_active
|
|
26
|
+
User.active.order(created_at: :desc)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def paginated(page: 1, per: 25)
|
|
30
|
+
User.active
|
|
31
|
+
.order(created_at: :desc)
|
|
32
|
+
.offset((page.to_i - 1) * per.to_i)
|
|
33
|
+
.limit(per.to_i)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def count
|
|
37
|
+
User.count
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# ── Persistence ────────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
# Builds a new User (not persisted). Let the service validate input first.
|
|
43
|
+
def build(attributes = {})
|
|
44
|
+
User.new(attributes)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Persist (create or update). Raises ActiveRecord::RecordInvalid on failure.
|
|
48
|
+
def save!(user)
|
|
49
|
+
user.save!
|
|
50
|
+
user
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Persist without raising. Returns false on failure.
|
|
54
|
+
def save(user)
|
|
55
|
+
user.save
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def update!(user, attributes)
|
|
59
|
+
user.update!(attributes)
|
|
60
|
+
user
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def destroy!(user)
|
|
64
|
+
user.destroy!
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# ── Bulk ───────────────────────────────────────────────────────────────
|
|
68
|
+
|
|
69
|
+
def deactivate_all_inactive(since:)
|
|
70
|
+
User.where("last_active_at < ?", since).update_all(active: false)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — CreateUserService
|
|
4
|
-
# Convention (ADR-01): one service per operation; injected dependencies for testability
|
|
5
|
-
#
|
|
6
|
-
# Usage:
|
|
7
|
-
# result = Services::CreateUserService.new(
|
|
8
|
-
# user_repository: Repositories::UserRepository.new,
|
|
9
|
-
# event_publisher: RealtimeService.instance
|
|
10
|
-
# ).execute(email: "user@example.com", name: "Alice")
|
|
11
|
-
#
|
|
12
|
-
# Returns: User (persisted)
|
|
13
|
-
# Raises: Services::CreateUserService::EmailTakenError
|
|
14
|
-
# ActiveRecord::RecordInvalid (validation failure)
|
|
15
|
-
|
|
16
|
-
module Services
|
|
17
|
-
class CreateUserService
|
|
18
|
-
# ── Domain errors ──────────────────────────────────────────────────────
|
|
19
|
-
class EmailTakenError < StandardError
|
|
20
|
-
def initialize(email)
|
|
21
|
-
super("Email '#{email}' is already registered.")
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# ── Constructor ────────────────────────────────────────────────────────
|
|
26
|
-
def initialize(user_repository:, event_publisher:)
|
|
27
|
-
@user_repository = user_repository
|
|
28
|
-
@event_publisher = event_publisher
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# ── Main operation ─────────────────────────────────────────────────────
|
|
32
|
-
def execute(email:, name:, password: nil, **extra_attrs)
|
|
33
|
-
email = email.to_s.downcase.strip
|
|
34
|
-
|
|
35
|
-
# Guard: check for duplicate email
|
|
36
|
-
if @user_repository.find_by_email(email)
|
|
37
|
-
raise EmailTakenError, email
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Build and persist
|
|
41
|
-
user = @user_repository.build(
|
|
42
|
-
email: email,
|
|
43
|
-
name: name.to_s.strip,
|
|
44
|
-
active: true,
|
|
45
|
-
**extra_attrs
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
# Hash password if provided (example using has_secure_password)
|
|
49
|
-
user.password = password if password.present?
|
|
50
|
-
|
|
51
|
-
@user_repository.save!(user)
|
|
52
|
-
|
|
53
|
-
# Publish real-time event
|
|
54
|
-
@event_publisher.publish(
|
|
55
|
-
type: "user.created",
|
|
56
|
-
data: {
|
|
57
|
-
user_id: user.id,
|
|
58
|
-
email: user.email,
|
|
59
|
-
name: user.name,
|
|
60
|
-
timestamp: Time.now.to_i
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
user
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — CreateUserService
|
|
4
|
+
# Convention (ADR-01): one service per operation; injected dependencies for testability
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# result = Services::CreateUserService.new(
|
|
8
|
+
# user_repository: Repositories::UserRepository.new,
|
|
9
|
+
# event_publisher: RealtimeService.instance
|
|
10
|
+
# ).execute(email: "user@example.com", name: "Alice")
|
|
11
|
+
#
|
|
12
|
+
# Returns: User (persisted)
|
|
13
|
+
# Raises: Services::CreateUserService::EmailTakenError
|
|
14
|
+
# ActiveRecord::RecordInvalid (validation failure)
|
|
15
|
+
|
|
16
|
+
module Services
|
|
17
|
+
class CreateUserService
|
|
18
|
+
# ── Domain errors ──────────────────────────────────────────────────────
|
|
19
|
+
class EmailTakenError < StandardError
|
|
20
|
+
def initialize(email)
|
|
21
|
+
super("Email '#{email}' is already registered.")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# ── Constructor ────────────────────────────────────────────────────────
|
|
26
|
+
def initialize(user_repository:, event_publisher:)
|
|
27
|
+
@user_repository = user_repository
|
|
28
|
+
@event_publisher = event_publisher
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# ── Main operation ─────────────────────────────────────────────────────
|
|
32
|
+
def execute(email:, name:, password: nil, **extra_attrs)
|
|
33
|
+
email = email.to_s.downcase.strip
|
|
34
|
+
|
|
35
|
+
# Guard: check for duplicate email
|
|
36
|
+
if @user_repository.find_by_email(email)
|
|
37
|
+
raise EmailTakenError, email
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Build and persist
|
|
41
|
+
user = @user_repository.build(
|
|
42
|
+
email: email,
|
|
43
|
+
name: name.to_s.strip,
|
|
44
|
+
active: true,
|
|
45
|
+
**extra_attrs
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Hash password if provided (example using has_secure_password)
|
|
49
|
+
user.password = password if password.present?
|
|
50
|
+
|
|
51
|
+
@user_repository.save!(user)
|
|
52
|
+
|
|
53
|
+
# Publish real-time event
|
|
54
|
+
@event_publisher.publish(
|
|
55
|
+
type: "user.created",
|
|
56
|
+
data: {
|
|
57
|
+
user_id: user.id,
|
|
58
|
+
email: user.email,
|
|
59
|
+
name: user.name,
|
|
60
|
+
timestamp: Time.now.to_i
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
user
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# DARE v3.0 — RealtimeService
|
|
4
|
-
# Convention (ADR-03): centralized broadcaster — services call this, not channels directly
|
|
5
|
-
# Singleton via .instance; injectable in tests via double
|
|
6
|
-
#
|
|
7
|
-
# Usage in a Service:
|
|
8
|
-
# RealtimeService.instance.publish(
|
|
9
|
-
# type: "user.created",
|
|
10
|
-
# data: { user_id: 42, email: "user@example.com" }
|
|
11
|
-
# )
|
|
12
|
-
#
|
|
13
|
-
# Frontend receives:
|
|
14
|
-
# { type: "user.created", data: { ... }, timestamp: 1234567890 }
|
|
15
|
-
|
|
16
|
-
class RealtimeService
|
|
17
|
-
include Singleton
|
|
18
|
-
|
|
19
|
-
# ── Public API ────────────────────────────────────────────────────────────
|
|
20
|
-
|
|
21
|
-
# Broadcast to all subscribers of a channel stream.
|
|
22
|
-
# channel_class: e.g. UserUpdatesChannel
|
|
23
|
-
# target: e.g. user.id (matched against stream_for in the channel)
|
|
24
|
-
# payload: Hash with :type and :data
|
|
25
|
-
def broadcast_to(channel_class, target, type:, data: {})
|
|
26
|
-
event = build_event(type: type, data: data)
|
|
27
|
-
channel_class.broadcast_to(target, event)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Generic publish: broadcasts to `dare_updates:<user_id>` for all active users.
|
|
31
|
-
# Use for system-wide events.
|
|
32
|
-
def publish(type:, data: {}, user_id: nil)
|
|
33
|
-
event = build_event(type: type, data: data)
|
|
34
|
-
stream = user_id ? "dare_updates:#{user_id}" : "dare_updates:global"
|
|
35
|
-
ActionCable.server.broadcast(stream, event)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# Publish to a named stream directly (lower-level).
|
|
39
|
-
def broadcast_to_stream(stream_name, type:, data: {})
|
|
40
|
-
event = build_event(type: type, data: data)
|
|
41
|
-
ActionCable.server.broadcast(stream_name, event)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
private
|
|
45
|
-
|
|
46
|
-
def build_event(type:, data: {})
|
|
47
|
-
{
|
|
48
|
-
type: type,
|
|
49
|
-
data: data,
|
|
50
|
-
timestamp: Time.now.to_i
|
|
51
|
-
}
|
|
52
|
-
end
|
|
53
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# DARE v3.0 — RealtimeService
|
|
4
|
+
# Convention (ADR-03): centralized broadcaster — services call this, not channels directly
|
|
5
|
+
# Singleton via .instance; injectable in tests via double
|
|
6
|
+
#
|
|
7
|
+
# Usage in a Service:
|
|
8
|
+
# RealtimeService.instance.publish(
|
|
9
|
+
# type: "user.created",
|
|
10
|
+
# data: { user_id: 42, email: "user@example.com" }
|
|
11
|
+
# )
|
|
12
|
+
#
|
|
13
|
+
# Frontend receives:
|
|
14
|
+
# { type: "user.created", data: { ... }, timestamp: 1234567890 }
|
|
15
|
+
|
|
16
|
+
class RealtimeService
|
|
17
|
+
include Singleton
|
|
18
|
+
|
|
19
|
+
# ── Public API ────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
# Broadcast to all subscribers of a channel stream.
|
|
22
|
+
# channel_class: e.g. UserUpdatesChannel
|
|
23
|
+
# target: e.g. user.id (matched against stream_for in the channel)
|
|
24
|
+
# payload: Hash with :type and :data
|
|
25
|
+
def broadcast_to(channel_class, target, type:, data: {})
|
|
26
|
+
event = build_event(type: type, data: data)
|
|
27
|
+
channel_class.broadcast_to(target, event)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Generic publish: broadcasts to `dare_updates:<user_id>` for all active users.
|
|
31
|
+
# Use for system-wide events.
|
|
32
|
+
def publish(type:, data: {}, user_id: nil)
|
|
33
|
+
event = build_event(type: type, data: data)
|
|
34
|
+
stream = user_id ? "dare_updates:#{user_id}" : "dare_updates:global"
|
|
35
|
+
ActionCable.server.broadcast(stream, event)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Publish to a named stream directly (lower-level).
|
|
39
|
+
def broadcast_to_stream(stream_name, type:, data: {})
|
|
40
|
+
event = build_event(type: type, data: data)
|
|
41
|
+
ActionCable.server.broadcast(stream_name, event)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def build_event(type:, data: {})
|
|
47
|
+
{
|
|
48
|
+
type: type,
|
|
49
|
+
data: data,
|
|
50
|
+
timestamp: Time.now.to_i
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
end
|