@terreno/mcp 0.31.0 → 56.0.0-beta.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/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +15 -16
- package/dist/bootstrap.js.map +1 -1
- package/dist/docs/templates/bootstrap/backend/types/models/userTypes.template.md +4 -5
- package/dist/docs/templates/bootstrap/frontend/app/_layout.template.tsx +1 -1
- package/dist/docs/templates/tools/model.template.md +2 -4
- package/dist/docs/versioned/next/README.md +1 -0
- package/dist/docs/versioned/next/explanation/README.md +1 -7
- package/dist/docs/versioned/next/how-to/README.md +2 -8
- package/dist/docs/versioned/next/how-to/deploy-to-gcp.md +228 -20
- package/dist/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +445 -0
- package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +4 -57
- package/dist/docs/versioned/next/implementationPlans/README.md +30 -56
- package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +1 -2
- package/dist/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deploy-to-gcp.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deploy-to-vercel.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deployment-foundation.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/docs-reference-coverage.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/examples-demo-coverage.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/oss-governance-baseline.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +52 -47
- package/dist/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +303 -0
- package/dist/docs/versioned/next/implementationPlans/syncdb-codegen.md +252 -0
- package/dist/docs/versioned/next/implementationPlans/syncdb-local-first.md +468 -420
- package/dist/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +425 -0
- package/dist/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +800 -0
- package/dist/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +0 -1
- package/dist/docs/versioned/next/reference/README.md +1 -4
- package/dist/docs/versioned/next/reference/environment-variables.md +382 -220
- package/dist/docs/versioned/next/reference/syncdb.md +456 -0
- package/dist/docs/versioned/next/superpowers/plans/2026-07-28-admin-mobile-navigation.md +97 -0
- package/dist/docs/versioned/next/superpowers/specs/2026-07-28-admin-mobile-navigation-design.md +36 -0
- package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- package/dist/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
- package/dist/docs/versioned/next/tasks/deployment-foundation.md +12 -12
- package/dist/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
- package/dist/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
- package/dist/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
- package/dist/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
- package/dist/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +10 -10
- package/dist/docs/versioned/next/tasks/syncdb-codegen.md +65 -0
- package/dist/docs/versioned/next/tasks/syncdb-local-first.md +434 -117
- package/package.json +4 -5
- package/src/docs/templates/bootstrap/backend/types/models/userTypes.template.md +4 -5
- package/src/docs/templates/bootstrap/frontend/app/_layout.template.tsx +1 -1
- package/src/docs/templates/tools/model.template.md +2 -4
- package/src/docs/versioned/next/README.md +1 -0
- package/src/docs/versioned/next/explanation/README.md +1 -7
- package/src/docs/versioned/next/how-to/README.md +2 -8
- package/src/docs/versioned/next/how-to/deploy-to-gcp.md +228 -20
- package/src/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +445 -0
- package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +4 -57
- package/src/docs/versioned/next/implementationPlans/README.md +30 -56
- package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +1 -2
- package/src/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +0 -1
- package/src/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deploy-to-gcp.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deploy-to-vercel.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deployment-foundation.md +0 -1
- package/src/docs/versioned/next/implementationPlans/docs-reference-coverage.md +0 -1
- package/src/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +0 -1
- package/src/docs/versioned/next/implementationPlans/examples-demo-coverage.md +0 -1
- package/src/docs/versioned/next/implementationPlans/oss-governance-baseline.md +0 -1
- package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +0 -1
- package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +0 -1
- package/src/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +52 -47
- package/src/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +303 -0
- package/src/docs/versioned/next/implementationPlans/syncdb-codegen.md +252 -0
- package/src/docs/versioned/next/implementationPlans/syncdb-local-first.md +468 -420
- package/src/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +425 -0
- package/src/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +800 -0
- package/src/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +0 -1
- package/src/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +0 -1
- package/src/docs/versioned/next/reference/README.md +1 -4
- package/src/docs/versioned/next/reference/environment-variables.md +382 -220
- package/src/docs/versioned/next/reference/syncdb.md +456 -0
- package/src/docs/versioned/next/superpowers/plans/2026-07-28-admin-mobile-navigation.md +97 -0
- package/src/docs/versioned/next/superpowers/specs/2026-07-28-admin-mobile-navigation-design.md +36 -0
- package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- package/src/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
- package/src/docs/versioned/next/tasks/deployment-foundation.md +12 -12
- package/src/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
- package/src/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
- package/src/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
- package/src/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
- package/src/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +10 -10
- package/src/docs/versioned/next/tasks/syncdb-codegen.md +65 -0
- package/src/docs/versioned/next/tasks/syncdb-local-first.md +434 -117
- package/LICENSE +0 -21
- package/dist/__tests__/bootstrap.test.d.ts +0 -2
- package/dist/__tests__/bootstrap.test.d.ts.map +0 -1
- package/dist/__tests__/bootstrap.test.js +0 -299
- package/dist/__tests__/bootstrap.test.js.map +0 -1
- package/dist/__tests__/databaseQuery.test.d.ts +0 -2
- package/dist/__tests__/databaseQuery.test.d.ts.map +0 -1
- package/dist/__tests__/databaseQuery.test.js +0 -83
- package/dist/__tests__/databaseQuery.test.js.map +0 -1
- package/dist/__tests__/docsRoot.test.d.ts +0 -2
- package/dist/__tests__/docsRoot.test.d.ts.map +0 -1
- package/dist/__tests__/docsRoot.test.js +0 -59
- package/dist/__tests__/docsRoot.test.js.map +0 -1
- package/dist/__tests__/inferPackages.test.d.ts +0 -2
- package/dist/__tests__/inferPackages.test.d.ts.map +0 -1
- package/dist/__tests__/inferPackages.test.js +0 -35
- package/dist/__tests__/inferPackages.test.js.map +0 -1
- package/dist/__tests__/preload.d.ts +0 -2
- package/dist/__tests__/preload.d.ts.map +0 -1
- package/dist/__tests__/preload.js +0 -12
- package/dist/__tests__/preload.js.map +0 -1
- package/dist/__tests__/prompts.test.d.ts +0 -2
- package/dist/__tests__/prompts.test.d.ts.map +0 -1
- package/dist/__tests__/prompts.test.js +0 -295
- package/dist/__tests__/prompts.test.js.map +0 -1
- package/dist/__tests__/resources.test.d.ts +0 -2
- package/dist/__tests__/resources.test.d.ts.map +0 -1
- package/dist/__tests__/resources.test.js +0 -352
- package/dist/__tests__/resources.test.js.map +0 -1
- package/dist/__tests__/search.test.d.ts +0 -2
- package/dist/__tests__/search.test.d.ts.map +0 -1
- package/dist/__tests__/search.test.js +0 -163
- package/dist/__tests__/search.test.js.map +0 -1
- package/dist/__tests__/tools.test.d.ts +0 -2
- package/dist/__tests__/tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools.test.js +0 -540
- package/dist/__tests__/tools.test.js.map +0 -1
- package/dist/__tests__/upgradeGuide.test.d.ts +0 -2
- package/dist/__tests__/upgradeGuide.test.d.ts.map +0 -1
- package/dist/__tests__/upgradeGuide.test.js +0 -22
- package/dist/__tests__/upgradeGuide.test.js.map +0 -1
- package/dist/docs/upgrades/0.31.0.md +0 -60
- package/dist/docs/versioned/next/explanation/deployment-architecture-gcp.md +0 -65
- package/dist/docs/versioned/next/explanation/deployment-baseline.md +0 -78
- package/dist/docs/versioned/next/explanation/positioning.md +0 -164
- package/dist/docs/versioned/next/explanation/repository-settings.md +0 -44
- package/dist/docs/versioned/next/explanation/roadmap-process.md +0 -330
- package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +0 -866
- package/dist/docs/versioned/next/how-to/build-for-web.md +0 -69
- package/dist/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +0 -115
- package/dist/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +0 -183
- package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +0 -114
- package/dist/docs/versioned/next/implementationPlans/billing-stripe.md +0 -158
- package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +0 -240
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +0 -107
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +0 -107
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +0 -102
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +0 -93
- package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +0 -188
- package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +0 -269
- package/dist/docs/versioned/next/implementationPlans/native-module-baseline.md +0 -105
- package/dist/docs/versioned/next/implementationPlans/orgs-and-teams.md +0 -158
- package/dist/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +0 -147
- package/dist/docs/versioned/next/reference/admin-spa.md +0 -130
- package/dist/docs/versioned/next/reference/ai.md +0 -519
- package/dist/docs/versioned/next/reference/test.md +0 -108
- package/dist/docs/versioned/next/roadmap.md +0 -9
- package/dist/docs/versioned/next/tasks/README.md +0 -42
- package/dist/docs/versioned/next/tasks/billing-stripe.md +0 -75
- package/dist/docs/versioned/next/tasks/comms-abstraction.md +0 -77
- package/dist/docs/versioned/next/tasks/comms-adapter-expo-push.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +0 -19
- package/dist/docs/versioned/next/tasks/infra-mcp.md +0 -43
- package/dist/docs/versioned/next/tasks/native-module-baseline.md +0 -42
- package/dist/docs/versioned/next/tasks/orgs-and-teams.md +0 -70
- package/dist/docs/versioned/next/tasks/password-reset-and-email-verification.md +0 -60
- package/src/docs/upgrades/0.31.0.md +0 -60
- package/src/docs/versioned/next/explanation/deployment-architecture-gcp.md +0 -65
- package/src/docs/versioned/next/explanation/deployment-baseline.md +0 -78
- package/src/docs/versioned/next/explanation/positioning.md +0 -164
- package/src/docs/versioned/next/explanation/repository-settings.md +0 -44
- package/src/docs/versioned/next/explanation/roadmap-process.md +0 -330
- package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +0 -866
- package/src/docs/versioned/next/how-to/build-for-web.md +0 -69
- package/src/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +0 -115
- package/src/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +0 -183
- package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +0 -114
- package/src/docs/versioned/next/implementationPlans/billing-stripe.md +0 -158
- package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +0 -240
- package/src/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +0 -107
- package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +0 -107
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +0 -102
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +0 -93
- package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +0 -188
- package/src/docs/versioned/next/implementationPlans/infra-mcp.md +0 -269
- package/src/docs/versioned/next/implementationPlans/native-module-baseline.md +0 -105
- package/src/docs/versioned/next/implementationPlans/orgs-and-teams.md +0 -158
- package/src/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +0 -147
- package/src/docs/versioned/next/reference/admin-spa.md +0 -130
- package/src/docs/versioned/next/reference/ai.md +0 -519
- package/src/docs/versioned/next/reference/test.md +0 -108
- package/src/docs/versioned/next/roadmap.md +0 -9
- package/src/docs/versioned/next/tasks/README.md +0 -42
- package/src/docs/versioned/next/tasks/billing-stripe.md +0 -75
- package/src/docs/versioned/next/tasks/comms-abstraction.md +0 -77
- package/src/docs/versioned/next/tasks/comms-adapter-expo-push.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +0 -19
- package/src/docs/versioned/next/tasks/infra-mcp.md +0 -43
- package/src/docs/versioned/next/tasks/native-module-baseline.md +0 -42
- package/src/docs/versioned/next/tasks/orgs-and-teams.md +0 -70
- package/src/docs/versioned/next/tasks/password-reset-and-email-verification.md +0 -60
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Tasks: Stripe billing and subscriptions
|
|
2
|
-
|
|
3
|
-
IP: [billing-stripe](../implementationPlans/billing-stripe.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Package + models
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: Scaffold `@terreno/billing` package
|
|
8
|
-
- Description: workspace package mirroring `feature-flags/`; root scripts
|
|
9
|
-
- Files: `billing/package.json`, `billing/tsconfig.json`, root `package.json`
|
|
10
|
-
- Depends on: none
|
|
11
|
-
- Acceptance: compile + lint pass
|
|
12
|
-
- [ ] **Task 1.2**: Models (BillingCustomer, BillingSubscription, BillingEvent)
|
|
13
|
-
- Description: per IP with unique indexes and descriptions
|
|
14
|
-
- Files: `billing/src/models/*`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: unit tests incl. unique-index violations
|
|
17
|
-
- [ ] **Task 1.3**: Plan config validation
|
|
18
|
-
- Description: `plans` option schema (Zod), duplicate/missing price detection at startup
|
|
19
|
-
- Files: `billing/src/billingApp.ts`
|
|
20
|
-
- Depends on: 1.1
|
|
21
|
-
- Acceptance: bad config fails fast with clear error
|
|
22
|
-
|
|
23
|
-
## Phase 2 — Checkout + portal + entitlements
|
|
24
|
-
|
|
25
|
-
- [ ] **Task 2.1**: Customer creation + checkout/portal session routes
|
|
26
|
-
- Description: `POST /billing/checkoutSession` (IsOrgAdmin), `POST /billing/portalSession`, `GET /billing/plans`
|
|
27
|
-
- Files: `billing/src/billingApp.ts`
|
|
28
|
-
- Depends on: 1.2, orgs-and-teams Phase 3
|
|
29
|
-
- Acceptance: mocked-Stripe supertest incl. permission denials
|
|
30
|
-
- [ ] **Task 2.2**: `getEntitlements` + `planSegment` + `RequiresPlan`
|
|
31
|
-
- Description: cache-backed entitlement service; feature-flag segment factory; permission
|
|
32
|
-
- Files: `billing/src/billingService.ts`
|
|
33
|
-
- Depends on: 1.2
|
|
34
|
-
- Acceptance: zero inline Stripe calls asserted; flag targeting test with FeatureFlagsApp
|
|
35
|
-
- [ ] **Task 2.3**: `GET /billing/subscription`
|
|
36
|
-
- Description: org subscription + entitlements for members
|
|
37
|
-
- Files: `billing/src/billingApp.ts`
|
|
38
|
-
- Depends on: 2.2
|
|
39
|
-
- Acceptance: supertest member/non-member
|
|
40
|
-
|
|
41
|
-
## Phase 3 — Webhook sync (gated on inbound-webhooks)
|
|
42
|
-
|
|
43
|
-
- [ ] **Task 3.1**: Stripe webhook route with signature verification
|
|
44
|
-
- Description: raw-body route via inbound-webhooks; reject unsigned
|
|
45
|
-
- Files: `billing/src/stripeSync.ts`
|
|
46
|
-
- Depends on: inbound-webhooks IP
|
|
47
|
-
- Acceptance: signed/unsigned fixture tests
|
|
48
|
-
- [ ] **Task 3.2**: Idempotent event handlers
|
|
49
|
-
- Description: checkout.session.completed, subscription created/updated/deleted, invoice paid/payment_failed → model sync via `BillingEvent`
|
|
50
|
-
- Files: `billing/src/stripeSync.ts`
|
|
51
|
-
- Depends on: 3.1
|
|
52
|
-
- Acceptance: replay of same event id is a no-op; cancellation downgrades after webhook
|
|
53
|
-
- [ ] **Task 3.3**: Dunning email
|
|
54
|
-
- Description: `paymentFailed` template through comms when configured
|
|
55
|
-
- Files: `billing/src/stripeSync.ts`, `comms/src/templates.ts`
|
|
56
|
-
- Depends on: 3.2, comms-abstraction
|
|
57
|
-
- Acceptance: template send asserted on payment_failed fixture
|
|
58
|
-
|
|
59
|
-
## Phase 4 — UI + example + docs
|
|
60
|
-
|
|
61
|
-
- [ ] **Task 4.1**: Plan picker + billing settings screens
|
|
62
|
-
- Description: example-frontend screens per IP; SDK regen
|
|
63
|
-
- Files: `example-frontend/app/**`, `store/openApiSdk.ts`
|
|
64
|
-
- Depends on: Phase 2
|
|
65
|
-
- Acceptance: UI verification evidence per verify-ui-changes (Stripe test mode)
|
|
66
|
-
- [ ] **Task 4.2**: example-backend registration + seeds + docs
|
|
67
|
-
- Description: env-gated BillingApp; test-mode setup guide; how-to + reference docs
|
|
68
|
-
- Files: `example-backend/src/server.ts`, `docs/how-to/add-billing.md`, `docs/reference/billing.md`
|
|
69
|
-
- Depends on: Phase 2
|
|
70
|
-
- Acceptance: docs build + `bun run rules:check` pass
|
|
71
|
-
- [ ] **Task 4.3**: CI + publish wiring
|
|
72
|
-
- Description: billing-ci workflow; publish-on-tag entry
|
|
73
|
-
- Files: `.github/workflows/*`
|
|
74
|
-
- Depends on: 1.1
|
|
75
|
-
- Acceptance: CI green
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Tasks: Pluggable communications layer (@terreno/comms)
|
|
2
|
-
|
|
3
|
-
IP: [comms-abstraction](../implementationPlans/comms-abstraction.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Package + contracts
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: Scaffold `@terreno/comms` workspace package
|
|
8
|
-
- Description: `comms/` package with tsconfig/biome/bun test setup mirroring `feature-flags/`; root workspace entry + `comms:*` scripts
|
|
9
|
-
- Files: `comms/package.json`, `comms/tsconfig.json`, `comms/biome.jsonc`, root `package.json`
|
|
10
|
-
- Depends on: none
|
|
11
|
-
- Acceptance: `bun run comms:compile` and `bun run comms:lint` pass
|
|
12
|
-
- [ ] **Task 1.2**: Provider interfaces and message types
|
|
13
|
-
- Description: `MailProvider`, `SmsProvider`, `PushProvider`, `VerificationProvider`, `SendResult`, `DeliveryEvent` per IP
|
|
14
|
-
- Files: `comms/src/types.ts`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: types compile and are exported
|
|
17
|
-
- [ ] **Task 1.3**: Console adapters
|
|
18
|
-
- Description: dev adapters for all four channels logging via `logger.info`
|
|
19
|
-
- Files: `comms/src/adapters/console.ts` + tests
|
|
20
|
-
- Depends on: 1.2
|
|
21
|
-
- Acceptance: each adapter returns `accepted: true` and logs
|
|
22
|
-
- [ ] **Task 1.4**: `CommsMessage` model + `logSend`
|
|
23
|
-
- Description: delivery log model with five-type pattern, `description` on every field, plugins, static `logSend` that never throws
|
|
24
|
-
- Files: `comms/src/models/commsMessage.ts` + tests
|
|
25
|
-
- Depends on: 1.1
|
|
26
|
-
- Acceptance: send logging survives a forced model error (logged, not thrown)
|
|
27
|
-
- [ ] **Task 1.5**: `commsService` send facade
|
|
28
|
-
- Description: `sendMail`/`sendSms`/`sendPushToUser`/`startVerification`/`checkVerification`; template render helper; unconfigured-channel behavior (501 in prod, console fallback in dev)
|
|
29
|
-
- Files: `comms/src/commsService.ts`, `comms/src/templates.ts` + tests
|
|
30
|
-
- Depends on: 1.2, 1.3, 1.4
|
|
31
|
-
- Acceptance: unit tests cover happy path + unconfigured channel in both env modes
|
|
32
|
-
|
|
33
|
-
## Phase 2 — CommsApp + routes
|
|
34
|
-
|
|
35
|
-
- [ ] **Task 2.1**: `PushToken` model
|
|
36
|
-
- Description: model per IP with unique token upsert semantics
|
|
37
|
-
- Files: `comms/src/models/pushToken.ts` + tests
|
|
38
|
-
- Depends on: 1.1
|
|
39
|
-
- Acceptance: duplicate token registration updates the existing row
|
|
40
|
-
- [ ] **Task 2.2**: `CommsApp` TerrenoPlugin
|
|
41
|
-
- Description: options wiring, `getCommsService()` accessor, route mounting on `register()`
|
|
42
|
-
- Files: `comms/src/commsApp.ts` + tests
|
|
43
|
-
- Depends on: 1.5, 2.1
|
|
44
|
-
- Acceptance: plugin registers on `TerrenoApp` and service accessor returns configured providers
|
|
45
|
-
- [ ] **Task 2.3**: Push token routes
|
|
46
|
-
- Description: modelRouter with `preCreate` owner injection, `OwnerQueryFilter`, deactivate on delete
|
|
47
|
-
- Files: `comms/src/routes/pushTokens.ts` + supertest
|
|
48
|
-
- Depends on: 2.2
|
|
49
|
-
- Acceptance: acceptance criteria bullets 2 pass under supertest
|
|
50
|
-
- [ ] **Task 2.4**: Admin delivery explorer
|
|
51
|
-
- Description: `GET /comms/messages` admin-only, paginated, filtered; OpenAPI builder
|
|
52
|
-
- Files: `comms/src/routes/commsExplorer.ts` + supertest
|
|
53
|
-
- Depends on: 2.2
|
|
54
|
-
- Acceptance: non-admin gets 403; filters work
|
|
55
|
-
- [ ] **Task 2.5**: `sendPushToUser` token resolution + pruning
|
|
56
|
-
- Description: resolve active tokens per user; deactivate tokens whose `SendResult` reports permanent failure
|
|
57
|
-
- Files: `comms/src/commsService.ts` + tests
|
|
58
|
-
- Depends on: 2.1, 1.5
|
|
59
|
-
- Acceptance: dead token is `active: false` after a failed send
|
|
60
|
-
|
|
61
|
-
## Phase 3 — Integration + docs
|
|
62
|
-
|
|
63
|
-
- [ ] **Task 3.1**: example-backend registration
|
|
64
|
-
- Description: register `CommsApp` with console adapters; env-gated
|
|
65
|
-
- Files: `example-backend/src/server.ts`
|
|
66
|
-
- Depends on: 2.2
|
|
67
|
-
- Acceptance: backend boots; `/comms/pushTokens` in `/openapi.json`
|
|
68
|
-
- [ ] **Task 3.2**: Reference docs + rules
|
|
69
|
-
- Description: `docs/reference/comms.md`, rulesync source rule, `bun run rules`
|
|
70
|
-
- Files: `docs/reference/comms.md`, `.rulesync/**`
|
|
71
|
-
- Depends on: 2.x
|
|
72
|
-
- Acceptance: `bun run rules:check` passes
|
|
73
|
-
- [ ] **Task 3.3**: CI + publish wiring
|
|
74
|
-
- Description: `comms-ci` workflow; add `@terreno/comms` to `publish-on-tag.yml`
|
|
75
|
-
- Files: `.github/workflows/comms-ci.yml`, `.github/workflows/publish-on-tag.yml`
|
|
76
|
-
- Depends on: 1.x
|
|
77
|
-
- Acceptance: CI green on the PR
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Tasks: Comms adapter — Expo push notifications
|
|
2
|
-
|
|
3
|
-
IP: [comms-adapter-expo-push](../implementationPlans/comms-adapter-expo-push.md)
|
|
4
|
-
|
|
5
|
-
- [ ] **Task 1**: `ExpoPushProvider` implementation
|
|
6
|
-
- Description: token validation, chunked send, ticket collection per IP
|
|
7
|
-
- Files: `comms/src/adapters/expoPush.ts`
|
|
8
|
-
- Depends on: comms-abstraction Phase 1
|
|
9
|
-
- Acceptance: mocked-client tests pass, one `SendResult` per token
|
|
10
|
-
- [ ] **Task 2**: Receipt polling → `DeliveryEvent` + dead-token marking
|
|
11
|
-
- Description: poll receipts after configurable delay; map `DeviceNotRegistered` to permanent failure
|
|
12
|
-
- Files: `comms/src/adapters/expoPush.ts`
|
|
13
|
-
- Depends on: Task 1
|
|
14
|
-
- Acceptance: dead token deactivated in test
|
|
15
|
-
- [ ] **Task 3**: Dependency moves
|
|
16
|
-
- Description: optional peer `expo-server-sdk` on comms; remove from `@terreno/api`
|
|
17
|
-
- Files: `comms/package.json`, `api/package.json`, root catalog if needed
|
|
18
|
-
- Depends on: Task 1
|
|
19
|
-
- Acceptance: `bun install` + full compile pass; api tests unaffected
|
|
20
|
-
- [ ] **Task 4**: example-frontend token registration + dev test-send
|
|
21
|
-
- Description: register token on login via `POST /comms/pushTokens`; profile dev row triggers `sendPushToUser`
|
|
22
|
-
- Files: `example-frontend/app/_layout.tsx` or profile screen, `example-backend` dev route
|
|
23
|
-
- Depends on: Task 1, comms-abstraction Phase 2
|
|
24
|
-
- Acceptance: UI verification per verify-ui-changes with screenshots
|
|
25
|
-
- [ ] **Task 5**: Docs
|
|
26
|
-
- Description: adapter section in `docs/reference/comms.md` with env/config table
|
|
27
|
-
- Files: `docs/reference/comms.md`
|
|
28
|
-
- Depends on: Task 1
|
|
29
|
-
- Acceptance: docs build passes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Tasks: Comms adapter — transactional email (SendGrid)
|
|
2
|
-
|
|
3
|
-
IP: [comms-adapter-sendgrid](../implementationPlans/comms-adapter-sendgrid.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Send path
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: `SendGridMailProvider` with config + sandbox mode
|
|
8
|
-
- Description: constructor/env config, from-address fallback chain, sandbox default under test
|
|
9
|
-
- Files: `comms/src/adapters/sendgrid.ts`
|
|
10
|
-
- Depends on: comms-abstraction Phase 1
|
|
11
|
-
- Acceptance: mocked-client tests for text/html/template sends
|
|
12
|
-
- [ ] **Task 1.2**: Error mapping
|
|
13
|
-
- Description: 4xx → `accepted: false` + message; full response body into `CommsMessage.metadata`; never throws
|
|
14
|
-
- Files: `comms/src/adapters/sendgrid.ts`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: unverified-sender and bad-address fixtures covered
|
|
17
|
-
- [ ] **Task 1.3**: Peer dep + registration + docs
|
|
18
|
-
- Description: optional peer `@sendgrid/mail`; env-gated example-backend registration with fail-fast; reference + env docs incl. sender-verification checklist
|
|
19
|
-
- Files: `comms/package.json`, `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
|
|
20
|
-
- Depends on: 1.1
|
|
21
|
-
- Acceptance: boot without key skips registration; compile passes without the SDK installed
|
|
22
|
-
|
|
23
|
-
## Phase 2 — Delivery events (gated on inbound-webhooks)
|
|
24
|
-
|
|
25
|
-
- [ ] **Task 2.1**: Event Webhook route
|
|
26
|
-
- Description: ECDSA signature verification via inbound-webhooks; delivered/bounce/dropped/open → `DeliveryEvent`
|
|
27
|
-
- Files: `comms/src/adapters/sendgrid.ts`, webhook registration
|
|
28
|
-
- Depends on: inbound-webhooks IP
|
|
29
|
-
- Acceptance: signed fixture updates `CommsMessage.status`; unsigned rejected 401
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Tasks: Comms adapter — Twilio SMS
|
|
2
|
-
|
|
3
|
-
IP: [comms-adapter-twilio-sms](../implementationPlans/comms-adapter-twilio-sms.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Send path
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: `TwilioSmsProvider` with config resolution
|
|
8
|
-
- Description: constructor/env config, messaging-service-first sender selection
|
|
9
|
-
- Files: `comms/src/adapters/twilioSms.ts`
|
|
10
|
-
- Depends on: comms-abstraction Phase 1
|
|
11
|
-
- Acceptance: mocked-client tests cover both sender configs
|
|
12
|
-
- [ ] **Task 1.2**: E.164 validation + error mapping
|
|
13
|
-
- Description: `libphonenumber-js` normalization; Twilio error codes into `SendResult.error` + metadata
|
|
14
|
-
- Files: `comms/src/adapters/twilioSms.ts`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: invalid number → 400 before API call; API failure → `accepted: false`
|
|
17
|
-
- [ ] **Task 1.3**: Peer dep + example-backend registration + docs
|
|
18
|
-
- Description: optional peer `twilio`; env-gated registration; reference + env-var docs
|
|
19
|
-
- Files: `comms/package.json`, `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
|
|
20
|
-
- Depends on: 1.1
|
|
21
|
-
- Acceptance: compile + boot without twilio installed when unconfigured
|
|
22
|
-
|
|
23
|
-
## Phase 2 — Delivery callbacks (gated on inbound-webhooks)
|
|
24
|
-
|
|
25
|
-
- [ ] **Task 2.1**: Status callback route
|
|
26
|
-
- Description: webhook endpoint with Twilio signature verification via inbound-webhooks framework
|
|
27
|
-
- Files: `comms/src/adapters/twilioSms.ts`, webhook registration
|
|
28
|
-
- Depends on: inbound-webhooks IP
|
|
29
|
-
- Acceptance: signed payload updates `CommsMessage.status`; unsigned rejected 401
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Tasks: Comms adapter — Twilio Verify (OTP)
|
|
2
|
-
|
|
3
|
-
IP: [comms-adapter-twilio-verify](../implementationPlans/comms-adapter-twilio-verify.md)
|
|
4
|
-
|
|
5
|
-
- [ ] **Task 1**: `TwilioVerifyProvider` start/check
|
|
6
|
-
- Description: provider per IP with config resolution and status mapping
|
|
7
|
-
- Files: `comms/src/adapters/twilioVerify.ts`
|
|
8
|
-
- Depends on: comms-abstraction Phase 1
|
|
9
|
-
- Acceptance: mocked-client tests for approved/pending/expired/max-attempts
|
|
10
|
-
- [ ] **Task 2**: Redacted logging
|
|
11
|
-
- Description: `CommsMessage` rows with channel `verification`, last-4 destination, no codes
|
|
12
|
-
- Files: `comms/src/adapters/twilioVerify.ts`
|
|
13
|
-
- Depends on: Task 1
|
|
14
|
-
- Acceptance: log assertion tests prove no code/full destination in any row
|
|
15
|
-
- [ ] **Task 3**: Registration + docs
|
|
16
|
-
- Description: env-gated example-backend registration; fail-fast on missing service SID; reference + env docs
|
|
17
|
-
- Files: `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
|
|
18
|
-
- Depends on: Task 1
|
|
19
|
-
- Acceptance: boot without config skips registration; with partial config throws at startup
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Tasks: Infrastructure MCP server (`@terreno/infra-mcp`)
|
|
2
|
-
|
|
3
|
-
Plan: [docs/implementationPlans/infra-mcp.md](../implementationPlans/infra-mcp.md)
|
|
4
|
-
Status: Blocked — Phase 1 RBAC wiring depends on the RBAC module PR ([rbac-permissions.md](../implementationPlans/rbac-permissions.md)). Scaffold/adapter tasks marked (unblocked) can start now.
|
|
5
|
-
|
|
6
|
-
## Phase 1 — Read-only core
|
|
7
|
-
|
|
8
|
-
- [ ] (unblocked) Scaffold `infra-mcp/` workspace package: package.json (catalog deps), tsconfig, biome, bun test setup, root workspace + catalog entries (zod 4, `@modelcontextprotocol/server`, `@better-auth/oauth-provider`, `@better-auth/mcp`)
|
|
9
|
-
- [ ] (unblocked) `src/config.ts`: `defineInfraMcp` config schema (zod), secret resolution (env/Secret Manager), boot validation
|
|
10
|
-
- [ ] (unblocked) `src/server.ts`: Express/TerrenoApp server with SDK v2 `/mcp` endpoint (`createMcpHandler`, `legacy: "stateless"`, `toNodeHandler`) + `/health`
|
|
11
|
-
- [ ] (unblocked) `src/auth.ts`: Better Auth OAuth 2.1 setup — authorization server, RFC 9728 protected-resource metadata, bearer verification middleware; login page flow verified with Cursor and Claude Code
|
|
12
|
-
- [ ] `src/access.ts`: `infraStatements`, default roles (`infra-readonly`, `infra-operator`), `createAccess` wiring, `Mcp-Name`-keyed authz middleware, per-user filtered `tools/list` (**blocked on RBAC PR**)
|
|
13
|
-
- [ ] `src/models/infraAuditLog.ts` + audit middleware around `tools/call` (statuses: allowed/denied/confirmed/rejected/error; per-tool arg redaction)
|
|
14
|
-
- [ ] (unblocked) Integration adapter types + registry (`src/integrations/types.ts`, `registry.ts`)
|
|
15
|
-
- [ ] (unblocked) GCP native adapter (ADC): `gcp_query_logs`, `gcp_list_log_names`, `gcp_query_metrics`, `gcp_list_error_groups`, `gcp_list_cloud_run_services`, `gcp_get_cloud_run_service`
|
|
16
|
-
- [ ] (unblocked) Sentry native adapter (REST + static token): `sentry_search_issues`, `sentry_get_issue`, `sentry_list_issue_events`, `sentry_get_event`
|
|
17
|
-
- [ ] (unblocked) Mongo native adapter (read URI): `mongo_list_collections`, `mongo_collection_schema`, `mongo_find`, `mongo_aggregate` (reject `$out`/`$merge`). Extract the shared read-query/schema logic from `mcp-server/src/local/tools/databaseQuery.ts` + `databaseSchema.ts` into a reusable module both packages import — do not fork copies into infra-mcp (per architectural review)
|
|
18
|
-
- [ ] Admin panel registration (`@terreno/admin-backend`): Users, InfraAuditLog (read-only)
|
|
19
|
-
- [ ] Terraform: `infra_mcp_service` Cloud Run module instance, Artifact Registry, runtime SA with viewer/logging IAM only
|
|
20
|
-
- [ ] Tests: authz matrix (role × tool × tools/list filtering), adapter handlers, audit records, legacy-client fallback
|
|
21
|
-
- [ ] Deploy + end-to-end verification from a real MCP client; docs: `.cursor/rules/infra-mcp/00-infra-mcp.mdc`, AGENTS.md/CLAUDE.md package lists
|
|
22
|
-
- [ ] Roadmap: open the tracking issue from [roadmap-seed-issues.md](../explanation/roadmap-seed-issues.md#infra-mcp) once the IP is Approved, add it to the Terreno Roadmap board, and register `@terreno/infra-mcp` → `area:mcp` in `scripts/issueAreaLabels.ts` + the bug-report package dropdown when the package lands
|
|
23
|
-
|
|
24
|
-
## Phase 2 — Write tier + machine callers
|
|
25
|
-
|
|
26
|
-
- [ ] `confirmWrite` elicitation wrapper; fail-closed behavior for clients without elicitation support
|
|
27
|
-
- [ ] Config override (`confirmWrites: false`) gated by `infra:writeUnconfirmed`; tests for both paths
|
|
28
|
-
- [ ] Write tools: `sentry_resolve_issue`, `sentry_assign_issue`, `gcp_rollback_cloud_run_revision`, `gcp_update_cloud_run_traffic`, `mongo_update_one`, `mongo_delete_one`; widen runtime SA IAM minimally
|
|
29
|
-
- [ ] Service tokens: spike Better Auth `apiKey` plugin; fallback `ServiceToken` model; machine users (`isServiceAccount`) with role assignment; admin surface (token shown once)
|
|
30
|
-
- [ ] Cloud agent migration: `INFRA_MCP_URL` + service token in agent environments; verify log-digging flows; remove `GCP_SA_*` injection; update AGENTS.md Cursor Cloud instructions
|
|
31
|
-
|
|
32
|
-
## Phase 3 — Proxied adapters + remaining vendors
|
|
33
|
-
|
|
34
|
-
- [ ] `ProxiedAdapter`: `@modelcontextprotocol/client` (stdio + HTTP), deny-by-default `allowedTools` with mandatory tier annotations, tool name prefixing, upstream lifecycle management
|
|
35
|
-
- [ ] Reference proxied integration (`@sentry/mcp-server` stdio or `@google-cloud/observability-mcp`) with parity tests against native tools
|
|
36
|
-
- [ ] Expo/EAS native adapter (`EXPO_TOKEN`): build status, update status, submission status (read); trigger tools deferred to write expansion
|
|
37
|
-
- [ ] Vercel native adapter (API token): deployments, logs, project info (read)
|
|
38
|
-
|
|
39
|
-
## Phase 4 — OSS packaging
|
|
40
|
-
|
|
41
|
-
- [ ] `defineInfraMcp` config reference + quickstart docs (website); one-man-shop deploy path (container anywhere)
|
|
42
|
-
- [ ] Publish `@terreno/infra-mcp`; changelog + upgrade notes
|
|
43
|
-
- [ ] Dogfood writeup: our deployment as the reference architecture
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Tasks: Native module baseline for the next major release
|
|
2
|
-
|
|
3
|
-
IP: [native-module-baseline](../implementationPlans/native-module-baseline.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Dependencies + config
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: Catalog + app package manifests
|
|
8
|
-
- Description: add the seven packages to root catalog (sorted) and to example-frontend + demo deps via `catalog:`
|
|
9
|
-
- Files: root `package.json`, `example-frontend/package.json`, `demo/package.json`
|
|
10
|
-
- Depends on: none
|
|
11
|
-
- Acceptance: `bun install` + full compile green
|
|
12
|
-
- [ ] **Task 1.2**: Config plugins + build properties
|
|
13
|
-
- Description: stripe + purchases plugins; `expo-build-properties` Kotlin 2.x / compileSdk 36 pins
|
|
14
|
-
- Files: `example-frontend/app.json`, `demo/app.json`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: `expo config` resolves without errors; web export unaffected
|
|
17
|
-
|
|
18
|
-
## Phase 2 — Builds + verification
|
|
19
|
-
|
|
20
|
-
- [ ] **Task 2.1**: EAS dev builds
|
|
21
|
-
- Description: iOS + Android dev-client builds via existing eas-dev-build workflow
|
|
22
|
-
- Files: `eas.json` profiles if needed
|
|
23
|
-
- Depends on: Phase 1
|
|
24
|
-
- Acceptance: both builds compile
|
|
25
|
-
- [ ] **Task 2.2**: Diagnostics story
|
|
26
|
-
- Description: hidden demo story listing resolved native module versions
|
|
27
|
-
- Files: `demo/stories/NativeModules.stories.tsx`, `demo/demoConfig.tsx`
|
|
28
|
-
- Depends on: 2.1
|
|
29
|
-
- Acceptance: story shows all seven modules on a dev build; screenshot evidence
|
|
30
|
-
- [ ] **Task 2.3**: Expo Go degradation doc
|
|
31
|
-
- Description: document which flows need a dev build (stripe, local-auth) vs preview modes (purchases)
|
|
32
|
-
- Files: `docs/` upgrade note draft
|
|
33
|
-
- Depends on: 2.1
|
|
34
|
-
- Acceptance: reviewed checklist in the note
|
|
35
|
-
|
|
36
|
-
## Phase 3 — Release
|
|
37
|
-
|
|
38
|
-
- [ ] **Task 3.1**: Upgrade note + major release coordination
|
|
39
|
-
- Description: consumer checklist (rebuild dev clients, add plugins, merchant id); breaking-release CI gate
|
|
40
|
-
- Files: upgrade notes location per release process
|
|
41
|
-
- Depends on: Phase 2
|
|
42
|
-
- Acceptance: breaking-release CI gate passes on the release PR
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Tasks: Organizations, teams, and multi-tenant scoping
|
|
2
|
-
|
|
3
|
-
IP: [orgs-and-teams](../implementationPlans/orgs-and-teams.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Models + plugin
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: Organization + Membership models
|
|
8
|
-
- Description: schemas per IP (five-type pattern, descriptions, plugins, compound unique index), statics `findActiveForUser`/`isMember`/`isOrgAdmin`
|
|
9
|
-
- Files: `api/src/orgs/organizationModel.ts`, type files
|
|
10
|
-
- Depends on: none
|
|
11
|
-
- Acceptance: unit tests incl. duplicate-membership rejection
|
|
12
|
-
- [ ] **Task 1.2**: `orgScopedPlugin`
|
|
13
|
-
- Description: adds required indexed `organizationId` to a schema
|
|
14
|
-
- Files: `api/src/orgs/orgPlugin.ts`
|
|
15
|
-
- Depends on: 1.1
|
|
16
|
-
- Acceptance: plugin test on a sample schema; save without org fails
|
|
17
|
-
|
|
18
|
-
## Phase 2 — Context + permissions
|
|
19
|
-
|
|
20
|
-
- [ ] **Task 2.1**: Org context middleware
|
|
21
|
-
- Description: `X-Organization-Id` → `req.organization`/`req.membership`; 403 on non-membership; no header → no context
|
|
22
|
-
- Files: `api/src/orgs/orgContext.ts`
|
|
23
|
-
- Depends on: 1.1
|
|
24
|
-
- Acceptance: supertest for member/non-member/missing header
|
|
25
|
-
- [ ] **Task 2.2**: `IsOrgMember`, `IsOrgAdmin`, `OrgQueryFilter`
|
|
26
|
-
- Description: permission methods + query filter (header-scoped or all-memberships)
|
|
27
|
-
- Files: `api/src/orgs/orgPermissions.ts`
|
|
28
|
-
- Depends on: 2.1
|
|
29
|
-
- Acceptance: **tenant isolation suite** — org A member never reads org B rows, incl. crafted `$or`/query-param attempts
|
|
30
|
-
- [ ] **Task 2.3**: modelRouter integration + `preCreate` org injection helper
|
|
31
|
-
- Description: end-to-end org-scoped CRUD on a test model
|
|
32
|
-
- Files: `api/src/orgs/*`, `api/src/tests.ts`
|
|
33
|
-
- Depends on: 2.2
|
|
34
|
-
- Acceptance: create injects context org; list/read/update/delete respect scope
|
|
35
|
-
|
|
36
|
-
## Phase 3 — Routes + app
|
|
37
|
-
|
|
38
|
-
- [ ] **Task 3.1**: `OrgsApp` plugin + org CRUD routes
|
|
39
|
-
- Description: create (with `maxOrgsPerUser`), list-my-orgs, read, patch, soft delete with membership cascade
|
|
40
|
-
- Files: `api/src/orgs/orgsApp.ts`
|
|
41
|
-
- Depends on: Phase 2
|
|
42
|
-
- Acceptance: supertest per route; OpenAPI entries present
|
|
43
|
-
- [ ] **Task 3.2**: Member management routes + last-admin guards
|
|
44
|
-
- Description: list/patch/delete members; cannot demote/remove last admin
|
|
45
|
-
- Files: `api/src/orgs/orgsApp.ts`
|
|
46
|
-
- Depends on: 3.1
|
|
47
|
-
- Acceptance: guard tests pass
|
|
48
|
-
- [ ] **Task 3.3**: `onOrgAudit` hook + exports
|
|
49
|
-
- Description: audit hook mirroring `onAdminAudit`; public exports from `@terreno/api`
|
|
50
|
-
- Files: `api/src/orgs/orgsApp.ts`, `api/src/index.ts`
|
|
51
|
-
- Depends on: 3.1
|
|
52
|
-
- Acceptance: hook fires for create/role-change/delete in tests
|
|
53
|
-
|
|
54
|
-
## Phase 4 — Example + docs
|
|
55
|
-
|
|
56
|
-
- [ ] **Task 4.1**: example-backend org-scoped `Project` model + routes + seeds
|
|
57
|
-
- Description: demo model with `orgScopedPlugin` + `OrgQueryFilter`; seed two orgs with distinct data
|
|
58
|
-
- Files: `example-backend/src/models/project.ts`, `src/api/projects.ts`, `scripts/seed*`
|
|
59
|
-
- Depends on: Phase 3
|
|
60
|
-
- Acceptance: seeded backend proves isolation via curl/supertest
|
|
61
|
-
- [ ] **Task 4.2**: Admin registration + SDK regen
|
|
62
|
-
- Description: register Organization/Membership in AdminApp; `cd example-frontend && bun run sdk`
|
|
63
|
-
- Files: `example-backend/src/server.ts`, `example-frontend/store/openApiSdk.ts`
|
|
64
|
-
- Depends on: 4.1
|
|
65
|
-
- Acceptance: admin panel lists orgs; SDK compiles
|
|
66
|
-
- [ ] **Task 4.3**: Docs
|
|
67
|
-
- Description: `docs/how-to/add-organizations.md`, reference updates, rulesync
|
|
68
|
-
- Files: `docs/how-to/add-organizations.md`, `docs/reference/api.md`, `.rulesync/**`
|
|
69
|
-
- Depends on: Phase 3
|
|
70
|
-
- Acceptance: `bun run rules:check` passes
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Tasks: Password reset and email verification
|
|
2
|
-
|
|
3
|
-
IP: [password-reset-and-email-verification](../implementationPlans/password-reset-and-email-verification.md)
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Token infrastructure
|
|
6
|
-
|
|
7
|
-
- [ ] **Task 1.1**: `AuthToken` model + issue/consume statics
|
|
8
|
-
- Description: hashed single-use tokens with TTL expiry per IP
|
|
9
|
-
- Files: `api/src/authTokens.ts`, type files
|
|
10
|
-
- Depends on: none
|
|
11
|
-
- Acceptance: atomic single-use test (parallel consumes → one winner); expiry test
|
|
12
|
-
- [ ] **Task 1.2**: `emailVerificationPlugin`
|
|
13
|
-
- Description: `emailVerified` field plugin for user schemas
|
|
14
|
-
- Files: `api/src/plugins.ts`
|
|
15
|
-
- Depends on: none
|
|
16
|
-
- Acceptance: plugin test; example User adopts it
|
|
17
|
-
|
|
18
|
-
## Phase 2 — JWT routes + mail
|
|
19
|
-
|
|
20
|
-
- [ ] **Task 2.1**: forgot/reset routes
|
|
21
|
-
- Description: 202-always forgot; reset validates+consumes token, `setPassword`, invalidates refresh tokens; RTK client path/shape contract verified
|
|
22
|
-
- Files: `api/src/authRecovery.ts`, `api/src/auth.ts`
|
|
23
|
-
- Depends on: 1.1, comms-abstraction
|
|
24
|
-
- Acceptance: enumeration-safety + happy-path supertest; RTK-shape test
|
|
25
|
-
- [ ] **Task 2.2**: verification routes + `requireEmailVerification` option
|
|
26
|
-
- Description: sendVerification/verifyEmail; 403 `email-not-verified` gating on login when enabled
|
|
27
|
-
- Files: `api/src/authRecovery.ts`, `api/src/auth.ts`
|
|
28
|
-
- Depends on: 1.2, 2.1
|
|
29
|
-
- Acceptance: gating on/off supertest
|
|
30
|
-
- [ ] **Task 2.3**: Mail templates
|
|
31
|
-
- Description: `resetPassword` + `verifyEmail` templates with app-override hook and `publicAppUrl` links
|
|
32
|
-
- Files: `comms/src/templates.ts`
|
|
33
|
-
- Depends on: comms-abstraction Phase 1
|
|
34
|
-
- Acceptance: rendered output snapshot tests
|
|
35
|
-
|
|
36
|
-
## Phase 3 — Better Auth parity
|
|
37
|
-
|
|
38
|
-
- [ ] **Task 3.1**: Better Auth hooks
|
|
39
|
-
- Description: `sendResetPassword`/`sendVerificationEmail` wired to the same templates
|
|
40
|
-
- Files: `api/src/betterAuthSetup.ts`
|
|
41
|
-
- Depends on: 2.3
|
|
42
|
-
- Acceptance: parity test asserting identical template usage
|
|
43
|
-
|
|
44
|
-
## Phase 4 — Client + docs
|
|
45
|
-
|
|
46
|
-
- [ ] **Task 4.1**: example-frontend reset screen + verify banner
|
|
47
|
-
- Description: `/resetPassword` route + profile banner with re-send; SDK regen
|
|
48
|
-
- Files: `example-frontend/app/resetPassword.tsx`, `app/(tabs)/profile.tsx`, `store/openApiSdk.ts`
|
|
49
|
-
- Depends on: Phase 2
|
|
50
|
-
- Acceptance: end-to-end flow with console adapter; UI verification evidence per verify-ui-changes
|
|
51
|
-
- [ ] **Task 4.2**: `LoginScreen` forgot-password link prop
|
|
52
|
-
- Description: optional `onForgotPassword` on `@terreno/ui` LoginScreen
|
|
53
|
-
- Files: `ui/src/login/LoginScreen.tsx` + tests + demo story
|
|
54
|
-
- Depends on: none
|
|
55
|
-
- Acceptance: renders only when provided; story added
|
|
56
|
-
- [ ] **Task 4.3**: Docs
|
|
57
|
-
- Description: how-to + env reference + rulesync
|
|
58
|
-
- Files: `docs/how-to/password-reset.md`, `docs/reference/environment-variables.md`, `.rulesync/**`
|
|
59
|
-
- Depends on: Phase 2
|
|
60
|
-
- Acceptance: `bun run rules:check` passes
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# 0.31.0
|
|
2
|
-
|
|
3
|
-
Terreno packages move in lockstep. Nothing in this release removes or renames a public
|
|
4
|
-
export, so most apps upgrade by bumping the `@terreno/*` versions and running:
|
|
5
|
-
|
|
6
|
-
- `bun run compile` and `bun run lint` at the repo root
|
|
7
|
-
- `cd <your frontend> && bun run sdk` after any `@terreno/api` route or model surface change
|
|
8
|
-
|
|
9
|
-
## Mongoose 9 is now supported (Mongoose 8 still works)
|
|
10
|
-
|
|
11
|
-
Every published package that talks to Mongoose (`api`, `test`, `admin-backend`, `ai`,
|
|
12
|
-
`feature-flags`) widened its peer dependency to `^8.0.0 || ^9.0.0`. Terreno itself
|
|
13
|
-
develops against Mongoose 9.7.4.
|
|
14
|
-
|
|
15
|
-
You can stay on Mongoose 8 with no changes. If you upgrade your app to Mongoose 9, the
|
|
16
|
-
changes that mattered inside Terreno will most likely matter in your code too:
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
// Before (Mongoose 8)
|
|
20
|
-
await Model.findOneAndUpdate(filter, update, {new: true});
|
|
21
|
-
|
|
22
|
-
// After (Mongoose 9)
|
|
23
|
-
await Model.findOneAndUpdate(filter, update, {returnDocument: "after"});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- Aggregation-pipeline updates must pass `updatePipeline: true` to `updateMany`.
|
|
27
|
-
- Query middleware no longer takes the legacy `next()` callback — use the async form.
|
|
28
|
-
- Array schema paths expose `getEmbeddedSchemaType()`; the private `caster` property is gone.
|
|
29
|
-
- Mongoose 9 ships its own types, so `@types/mongodb` and
|
|
30
|
-
`@types/passport-local-mongoose` should be removed from your dev dependencies.
|
|
31
|
-
- Pin `bson` to `7.2.0` if your lockfile resolves an older copy alongside Mongoose 9.
|
|
32
|
-
|
|
33
|
-
Mongoose 9 requires Node >= 20.19.0. Terreno's root `package.json` now declares that
|
|
34
|
-
engine range for local development.
|
|
35
|
-
|
|
36
|
-
## `@terreno/api` type changes
|
|
37
|
-
|
|
38
|
-
Both changes widen or relax types; they are source-compatible for normal usage, but
|
|
39
|
-
explicit annotations may need updating:
|
|
40
|
-
|
|
41
|
-
- `modelRouter` now accepts `Model<T, any, any, any, any, any>` instead of `Model<T>`,
|
|
42
|
-
so models with custom query helpers, methods, or virtuals no longer need a cast.
|
|
43
|
-
- `findOneOrNoneFor(model, query)` takes `ModelQuery<T>` (a partial record keyed by the
|
|
44
|
-
document fields) instead of Mongoose's `FilterQuery<T>`. If you were building a
|
|
45
|
-
`FilterQuery<T>` value to pass in, it still works; if you were annotating the variable
|
|
46
|
-
as `FilterQuery<T>` and relying on operator typing, switch to `ModelQuery<T>`.
|
|
47
|
-
|
|
48
|
-
## `@terreno/admin-backend` array field metadata
|
|
49
|
-
|
|
50
|
-
`GET /admin/config` derives array item metadata (`itemType`, `itemRef`, `itemEnum`) from
|
|
51
|
-
Mongoose's public `getEmbeddedSchemaType()` when available, falling back to the Mongoose 8
|
|
52
|
-
`caster` shape. `itemEnum` is only emitted when the embedded enum is an array, so an enum
|
|
53
|
-
declared as an object map no longer produces a malformed `itemEnum`. Admin clients that
|
|
54
|
-
read `itemEnum` should treat it as optional.
|
|
55
|
-
|
|
56
|
-
## License changed from Apache-2.0 to MIT
|
|
57
|
-
|
|
58
|
-
All published `@terreno/*` packages are now MIT licensed and ship a `LICENSE` file in the
|
|
59
|
-
package tarball. No code change is required; update any license inventory or attribution
|
|
60
|
-
list that pinned Terreno as Apache-2.0.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# GCP deployment architecture
|
|
2
|
-
|
|
3
|
-
Reference topology for hosting a Terreno full-stack app on Google Cloud Platform.
|
|
4
|
-
|
|
5
|
-
This page is conceptual — commands live in the [how-to guides](../how-to/deploy-to-gcp.md).
|
|
6
|
-
|
|
7
|
-
## Topology
|
|
8
|
-
|
|
9
|
-
```mermaid
|
|
10
|
-
flowchart TD
|
|
11
|
-
U["User<br/>iOS / Android / Web"]
|
|
12
|
-
CDN["Cloud CDN + GCS bucket<br/>expo export -p web output"]
|
|
13
|
-
CR["Cloud Run<br/>@terreno/api backend"]
|
|
14
|
-
SM["Secret Manager<br/>auth secrets, MONGO_URI"]
|
|
15
|
-
AT["MongoDB Atlas<br/>replica set (change streams)"]
|
|
16
|
-
GCS["GCS bucket<br/>user file uploads"]
|
|
17
|
-
AR["Artifact Registry<br/>backend image"]
|
|
18
|
-
U -->|"web"| CDN
|
|
19
|
-
U -->|"native app"| CR
|
|
20
|
-
CDN -->|"API calls"| CR
|
|
21
|
-
CR --> SM
|
|
22
|
-
CR --> AT
|
|
23
|
-
CR --> GCS
|
|
24
|
-
AR --> CR
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Component responsibilities
|
|
28
|
-
|
|
29
|
-
| Component | Role |
|
|
30
|
-
|-----------|------|
|
|
31
|
-
| **Artifact Registry** | Stores versioned backend container images built from `example-backend/Dockerfile` |
|
|
32
|
-
| **Cloud Run** | Runs the long-lived `@terreno/api` process (HTTP + Socket.io) |
|
|
33
|
-
| **Secret Manager** | Holds `MONGO_URI`, JWT secrets, and other credentials — mounted as env vars |
|
|
34
|
-
| **MongoDB Atlas** | Primary database; must be a replica set for change streams (realtime, feature flags) |
|
|
35
|
-
| **GCS (web bucket)** | Serves static web export; CDN caches at the edge |
|
|
36
|
-
| **GCS (uploads bucket)** | Private object storage for user uploads via `@terreno/api` file plugins |
|
|
37
|
-
|
|
38
|
-
## Why Cloud Run (not App Engine or GKE)
|
|
39
|
-
|
|
40
|
-
| Option | Tradeoff |
|
|
41
|
-
|--------|----------|
|
|
42
|
-
| **Cloud Run** | Pay-per-use, minimal ops, supports WebSockets with session affinity — fits Terreno's socket + HTTP model |
|
|
43
|
-
| **App Engine** | Similar serverless model but less flexible for custom containers and long timeouts |
|
|
44
|
-
| **GKE** | Full control but requires cluster management — overkill for a single Terreno backend |
|
|
45
|
-
|
|
46
|
-
## Why Atlas (not self-hosted Mongo on GCP)
|
|
47
|
-
|
|
48
|
-
| Option | Tradeoff |
|
|
49
|
-
|--------|----------|
|
|
50
|
-
| **MongoDB Atlas** | Managed replica sets, backups, and change streams out of the box |
|
|
51
|
-
| **Self-hosted on Compute Engine** | You operate replica set elections, backups, and upgrades — documented as out of scope for launch |
|
|
52
|
-
|
|
53
|
-
## Static web vs server-rendered
|
|
54
|
-
|
|
55
|
-
| Approach | Tradeoff |
|
|
56
|
-
|----------|----------|
|
|
57
|
-
| **GCS + CDN (static export)** | Cheapest, simplest, works today with Expo `single`/`static` output — no SSR or API routes |
|
|
58
|
-
| **Node/Bun server (SSR)** | Better SEO and API routes — requires Expo SDK ≥ 55; not available in the current `~54` catalog |
|
|
59
|
-
|
|
60
|
-
Native iOS and Android apps call Cloud Run directly; only the web client uses the CDN origin.
|
|
61
|
-
|
|
62
|
-
## Related
|
|
63
|
-
|
|
64
|
-
- [Deployment baseline](deployment-baseline.md) — seven requirements every host must satisfy
|
|
65
|
-
- [Deploy to GCP](../how-to/deploy-to-gcp.md) — step-by-step guides
|