create-ailk 0.19.1 → 0.20.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.
Files changed (132) hide show
  1. package/README.md +64 -7
  2. package/dist/cli.js +35 -0
  3. package/dist/copy.d.ts +41 -0
  4. package/dist/copy.js +87 -21
  5. package/dist/lib/fetch-template-snapshot.d.ts +21 -0
  6. package/dist/lib/fetch-template-snapshot.js +205 -0
  7. package/dist/lib/merge-three-way.d.ts +31 -0
  8. package/dist/lib/merge-three-way.js +65 -0
  9. package/dist/module-architecture.js +55 -2
  10. package/dist/programmatic.d.ts +7 -1
  11. package/dist/programmatic.js +32 -2
  12. package/dist/spoke-checkout.d.ts +7 -0
  13. package/dist/spoke-checkout.js +8 -1
  14. package/dist/surfaces.js +67 -2
  15. package/dist/template-record.d.ts +59 -0
  16. package/dist/template-record.js +183 -0
  17. package/dist/update.d.ts +48 -0
  18. package/dist/update.js +504 -0
  19. package/package.json +3 -3
  20. package/templates/.claude/cloudparity-repo-hooks.json +9 -0
  21. package/templates/.claude/hooks/architecture-check.sh +8 -0
  22. package/templates/.claude/rules/loop-contract.md +129 -0
  23. package/templates/.claude/settings.json +3 -2
  24. package/templates/.env.example +13 -0
  25. package/templates/CLAUDE.md +1 -1
  26. package/templates/CONVENTIONS.md +3 -2
  27. package/templates/_gitignore +162 -0
  28. package/templates/apps/api/CLAUDE.md +14 -10
  29. package/templates/apps/api/package.json +2 -1
  30. package/templates/apps/api/src/__tests__/factories/in-memory-prisma.ts +22 -2
  31. package/templates/apps/api/src/__tests__/setup.ts +7 -0
  32. package/templates/apps/api/src/bin/__tests__/rate-limit-probe.test.ts +184 -0
  33. package/templates/apps/api/src/bin/rate-limit-probe.ts +53 -0
  34. package/templates/apps/api/src/lib/proposal-paid-store.ts +49 -0
  35. package/templates/apps/api/src/lib/rate-limit-probe.ts +165 -0
  36. package/templates/apps/api/src/lib/rate-limit-store.ts +142 -0
  37. package/templates/apps/api/src/middleware/__tests__/auth.hub-session-path.test.ts +5 -2
  38. package/templates/apps/api/src/middleware/__tests__/default-tenant.test.ts +2 -0
  39. package/templates/apps/api/src/middleware/__tests__/rate-limit-cross-isolate.db.test.ts +220 -0
  40. package/templates/apps/api/src/middleware/__tests__/rate-limit-store.test.ts +430 -0
  41. package/templates/apps/api/src/middleware/__tests__/rate-limit.test.ts +21 -14
  42. package/templates/apps/api/src/middleware/auth.ts +8 -4
  43. package/templates/apps/api/src/middleware/default-tenant.ts +9 -0
  44. package/templates/apps/api/src/middleware/rate-limit.ts +290 -82
  45. package/templates/apps/api/src/routes/webhooks/README.md +33 -5
  46. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-proposal-paid.test.ts +369 -0
  47. package/templates/apps/api/src/routes/webhooks/__tests__/stripe-site-filter.test.ts +442 -0
  48. package/templates/apps/api/src/routes/webhooks/stripe.ts +184 -6
  49. package/templates/apps/api/src/server.ts +14 -2
  50. package/templates/apps/api/src/services/__tests__/audit-log.test.ts +91 -0
  51. package/templates/apps/api/src/services/audit-log.ts +72 -10
  52. package/templates/apps/api/src/services/default-tenant.ts +12 -3
  53. package/templates/apps/api/src/services/hub-sign-in.ts +2 -1
  54. package/templates/apps/api/src/services/public-site-resolver.ts +21 -2
  55. package/templates/apps/api/vercel.json +1 -1
  56. package/templates/apps/mcp/CLAUDE.md +19 -7
  57. package/templates/apps/mcp/__tests__/catalog-drift.test.ts +95 -8
  58. package/templates/apps/mcp/src/tools/person_notes.ts +25 -0
  59. package/templates/apps/mcp/src/tools/proposals.ts +27 -0
  60. package/templates/apps/mcp/src/workspace-server.ts +16 -0
  61. package/templates/apps/web/_gitignore +6 -0
  62. package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +165 -0
  63. package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +19 -0
  64. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +106 -23
  65. package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up.actions.ts +125 -0
  66. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +281 -0
  67. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +28 -83
  68. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +27 -13
  69. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +57 -2
  70. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +2 -0
  71. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +102 -18
  72. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +323 -0
  73. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +365 -0
  74. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +3 -2
  75. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +8 -0
  76. package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +170 -0
  77. package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +181 -0
  78. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +88 -3
  79. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +65 -0
  80. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +27 -0
  81. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +176 -3
  82. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +193 -0
  83. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +188 -0
  84. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +65 -4
  85. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +17 -0
  86. package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +11 -2
  87. package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +5 -24
  88. package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +64 -18
  89. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +120 -0
  90. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +322 -0
  91. package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +126 -0
  92. package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +43 -1
  93. package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +65 -0
  94. package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +226 -0
  95. package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +5 -3
  96. package/templates/apps/web/app/[locale]/consent-banner.tsx +32 -0
  97. package/templates/apps/web/app/[locale]/consent.actions.ts +71 -0
  98. package/templates/apps/web/app/[locale]/contact/contact.actions.ts +13 -1
  99. package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +25 -3
  100. package/templates/apps/web/app/[locale]/layout.tsx +23 -2
  101. package/templates/apps/web/app/[locale]/newsletter/newsletter.actions.ts +12 -1
  102. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe-rsc-boundary.test.tsx +209 -0
  103. package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe.test.tsx +158 -0
  104. package/templates/apps/web/app/[locale]/unsubscribe/page.tsx +54 -0
  105. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe-button.tsx +73 -0
  106. package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe.actions.ts +55 -0
  107. package/templates/apps/web/app/robots.txt/route.ts +13 -10
  108. package/templates/apps/web/jest.config.cjs +3 -0
  109. package/templates/apps/web/lib/__tests__/consent-visitor.test.ts +163 -0
  110. package/templates/apps/web/lib/__tests__/relay.test.ts +49 -0
  111. package/templates/apps/web/lib/__tests__/structured-data.test.tsx +96 -7
  112. package/templates/apps/web/lib/account-config.ts +31 -16
  113. package/templates/apps/web/lib/consent-visitor.ts +103 -0
  114. package/templates/apps/web/lib/relay.ts +20 -0
  115. package/templates/apps/web/messages/en.json +67 -4
  116. package/templates/apps/web/next.config.mjs +8 -2
  117. package/templates/database/CHANGELOG.md +39 -0
  118. package/templates/database/__tests__/outbound-message-action.db.test.ts +80 -0
  119. package/templates/database/__tests__/person-notes.db.test.ts +249 -0
  120. package/templates/database/__tests__/piece-kind-migration.test.ts +67 -0
  121. package/templates/database/__tests__/piece-kind.db.test.ts +208 -0
  122. package/templates/database/_gitignore +8 -0
  123. package/templates/database/inbox/schema.prisma +38 -12
  124. package/templates/database/migrations/20261015120000_person_notes/migration.sql +77 -0
  125. package/templates/database/migrations/20261015120000_rate_limit_counters/migration.sql +43 -0
  126. package/templates/database/migrations/20261016120000_piece_kind/migration.sql +95 -0
  127. package/templates/database/migrations/20261017120000_outbound_message_action/migration.sql +30 -0
  128. package/templates/database/ops/schema.prisma +16 -0
  129. package/templates/database/package.json +1 -1
  130. package/templates/project.yaml +6 -3
  131. package/versions.json +35 -35
  132. package/templates/.claude/rules/preserve-existing-style.md +0 -51
package/versions.json CHANGED
@@ -1,53 +1,53 @@
1
1
  {
2
- "@working-theory/admin-ui": "0.40.0",
3
- "@working-theory/aeo": "0.40.0",
4
- "@working-theory/agent-context": "0.40.0",
2
+ "@working-theory/admin-ui": "0.41.0",
3
+ "@working-theory/aeo": "0.41.0",
4
+ "@working-theory/agent-context": "0.41.0",
5
5
  "@working-theory/agent-contract": "0.1.0",
6
6
  "@working-theory/agent-memory": "0.0.0",
7
7
  "@working-theory/ai": "0.1.0",
8
- "@working-theory/analytics": "0.40.0",
9
- "@working-theory/api-client": "0.40.0",
8
+ "@working-theory/analytics": "0.41.0",
9
+ "@working-theory/api-client": "0.41.0",
10
10
  "@working-theory/cda-filesystem": "0.0.0",
11
- "@working-theory/cli": "0.40.0",
12
- "@working-theory/common": "0.40.0",
11
+ "@working-theory/cli": "0.41.0",
12
+ "@working-theory/common": "0.41.0",
13
13
  "@working-theory/consent": "0.1.0",
14
- "@working-theory/content-adapters": "0.40.0",
15
- "@working-theory/content-projection": "0.40.0",
16
- "@working-theory/email": "0.40.0",
14
+ "@working-theory/content-adapters": "0.41.0",
15
+ "@working-theory/content-projection": "0.41.0",
16
+ "@working-theory/email": "0.41.0",
17
17
  "@working-theory/env": "0.0.0",
18
- "@working-theory/eslint-config": "0.40.0",
19
- "@working-theory/fumadocs-schema": "0.40.0",
20
- "@working-theory/ids": "0.13.0",
21
- "@working-theory/jsonld": "0.40.0",
22
- "@working-theory/license": "0.40.0",
23
- "@working-theory/metadata": "0.40.0",
24
- "@working-theory/observability": "0.40.0",
25
- "@working-theory/page-renderer": "0.40.0",
18
+ "@working-theory/eslint-config": "0.41.0",
19
+ "@working-theory/fumadocs-schema": "0.41.0",
20
+ "@working-theory/ids": "0.14.0",
21
+ "@working-theory/jsonld": "0.41.0",
22
+ "@working-theory/license": "0.41.0",
23
+ "@working-theory/metadata": "0.41.0",
24
+ "@working-theory/observability": "0.41.0",
25
+ "@working-theory/page-renderer": "0.41.0",
26
26
  "@working-theory/plugin-mcp": "0.1.3",
27
- "@working-theory/schema": "0.40.0",
28
- "@working-theory/schema-pack-registry": "0.40.0",
29
- "@working-theory/schema-validator": "0.40.0",
30
- "@working-theory/sections-registry": "0.40.0",
31
- "@working-theory/site-config": "0.40.0",
32
- "@working-theory/spoke-checkout": "0.5.1",
33
- "@working-theory/stripe-client": "0.40.0",
34
- "@working-theory/templates": "0.40.0",
35
- "@working-theory/theme": "0.40.0",
36
- "@working-theory/ui": "0.40.0",
37
- "@working-theory/validation": "0.40.0",
38
- "@working-theory/web-i18n": "0.40.0",
27
+ "@working-theory/schema": "0.41.0",
28
+ "@working-theory/schema-pack-registry": "0.41.0",
29
+ "@working-theory/schema-validator": "0.41.0",
30
+ "@working-theory/sections-registry": "0.41.0",
31
+ "@working-theory/site-config": "0.41.0",
32
+ "@working-theory/spoke-checkout": "0.5.2",
33
+ "@working-theory/stripe-client": "0.41.0",
34
+ "@working-theory/templates": "0.41.0",
35
+ "@working-theory/theme": "0.41.0",
36
+ "@working-theory/ui": "0.41.0",
37
+ "@working-theory/validation": "0.41.0",
38
+ "@working-theory/web-i18n": "0.41.0",
39
39
  "@working-theory/billing-client": "0.0.0",
40
40
  "@working-theory/branding": "0.0.0",
41
41
  "@working-theory/license-client": "0.0.0",
42
42
  "@working-theory/license-manifest": "0.0.0",
43
43
  "@working-theory/partner-session": "0.0.0",
44
44
  "@working-theory/preview-protocol": "0.0.0",
45
- "@working-theory/ui-commerce": "0.23.18",
46
- "@working-theory/ui-docs-blog": "0.23.18",
47
- "@working-theory/ui-scheduling": "0.23.18",
48
- "@working-theory/ui-signal-collectors": "0.25.7",
45
+ "@working-theory/ui-commerce": "0.23.19",
46
+ "@working-theory/ui-docs-blog": "0.23.19",
47
+ "@working-theory/ui-scheduling": "0.23.19",
48
+ "@working-theory/ui-signal-collectors": "0.25.8",
49
49
  "@working-theory/web": "0.0.0",
50
50
  "@working-theory/api": "1.0.0",
51
51
  "@working-theory/mcp": "0.0.0",
52
- "@working-theory/database": "0.40.0"
52
+ "@working-theory/database": "0.41.0"
53
53
  }
@@ -1,51 +0,0 @@
1
- # Preserve Existing Style
2
-
3
- When editing existing files, preserve their existing formatting. Do
4
- **not** reformat, reflow, reorganize imports, change quote style,
5
- change indentation, or rearrange whitespace on lines that aren't
6
- materially changing as part of your task.
7
-
8
- Your diff should contain only the lines you deliberately touched. A
9
- 20-line functional change should produce a ~20-line diff, not a
10
- 900-line diff with 880 lines of formatting churn.
11
-
12
- ## Why
13
-
14
- Formatting churn:
15
-
16
- - Obscures real changes during code review.
17
- - Creates noise in `git blame` / `git log`.
18
- - Triggers unnecessary merge conflicts.
19
- - Violates the spirit of "behavior must not change unless the
20
- acceptance criteria say so" — even if runtime behavior is identical,
21
- the meaning to a human reader has changed.
22
-
23
- ## How to apply
24
-
25
- - **Before committing:** run `git diff --stat`. If the delta is
26
- wildly larger than the work you did, investigate before pushing.
27
- - **If your editor runs a formatter on save:** disable it for the
28
- session, configure it to match the existing style, or revert
29
- formatting-only lines before committing.
30
- - **If quotes, semicolons, or import grouping differ from the
31
- existing file:** match the existing file, not your editor's
32
- defaults.
33
- - **The diff is the contract.** A reviewer should see only the lines
34
- you meant to change.
35
-
36
- ## Not covered by this rule
37
-
38
- - Deliberate cleanup (removing dead code, inlining single-use
39
- helpers, collapsing redundant abstraction) is fine when it's the
40
- point of the task and called out in the PR.
41
- - Net-new files set their own style, subject to the project's
42
- existing conventions.
43
- - A task whose acceptance criteria explicitly say "reformat file X"
44
- (rare).
45
-
46
- ## Escalation
47
-
48
- If you believe the existing style is genuinely wrong and want to
49
- change it: stop. Note it in the PR description and propose the
50
- reformat as a separate PR. Do not unilaterally reformat the codebase
51
- as a side effect of an unrelated task.