@topy-ai/maggie 0.7.53 → 0.7.54

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 (42) hide show
  1. package/README-zh-TW.md +28 -50
  2. package/README.md +85 -64
  3. package/bin/maggie.js +51 -7
  4. package/bundled-references/maggiedash-booking/QA-TEST-PLAN.md +1 -1
  5. package/bundled-references/maggiedash-booking/RUNTIME-OPERATIONS.md +2 -2
  6. package/bundled-skills/maggie-blog/SKILL.md +8 -0
  7. package/bundled-skills/maggie-booking/SKILL.md +20 -12
  8. package/bundled-skills/maggie-content-localization/SKILL.md +26 -0
  9. package/bundled-skills/maggie-dash/SKILL.md +28 -2
  10. package/bundled-skills/maggie-deployment/SKILL.md +27 -0
  11. package/bundled-skills/maggie-design/SKILL.md +81 -0
  12. package/bundled-skills/maggie-feedback/SKILL.md +10 -2
  13. package/bundled-skills/maggie-marketplace/SKILL.md +1 -1
  14. package/bundled-skills/maggie-marketplace/references/directory-search.md +1 -1
  15. package/bundled-skills/maggie-marketplace/references/directory.mjs +2 -2
  16. package/bundled-skills/maggie-mobile-app/SKILL.md +29 -0
  17. package/bundled-skills/maggie-social-share/SKILL.md +30 -0
  18. package/bundled-tools/clis/maggie_booking.py +9 -8
  19. package/bundled-tools/clis/maggie_dash.py +173 -3
  20. package/bundled-tools/clis/maggie_deployment_ops.py +64 -1
  21. package/bundled-tools/clis/maggie_design.py +7 -1
  22. package/bundled-tools/clis/maggie_design_bulk.py +290 -0
  23. package/bundled-tools/clis/maggie_design_lint.py +131 -1
  24. package/bundled-tools/clis/maggie_feedback.py +41 -13
  25. package/bundled-tools/clis/maggie_live_urls.py +138 -0
  26. package/bundled-tools/clis/maggie_localization.py +3 -0
  27. package/bundled-tools/clis/maggie_localization_keys.py +151 -0
  28. package/bundled-tools/clis/maggie_media_generate.py +174 -0
  29. package/bundled-tools/clis/maggie_mobile.py +84 -1
  30. package/bundled-tools/clis/maggie_product_release.py +49 -1
  31. package/bundled-tools/clis/maggie_social_share.py +122 -1
  32. package/bundled-tools/integrations/maggie-api-pull.md +22 -0
  33. package/package.json +1 -1
  34. package/bundled-contracts/maggiedash/execution-board.json +0 -5463
  35. package/bundled-references/maggiedash-booking/CURRENT-STATE.md +0 -210
  36. package/bundled-references/maggiedash-booking/EXECUTION-BOARD.json +0 -5463
  37. package/bundled-references/maggiedash-booking/ORAWELLNESS-INTEGRATION-AUDIT.md +0 -270
  38. package/bundled-references/maggiedash-booking/PROGRESS.md +0 -279
  39. package/bundled-references/maggiedash-booking/README.md +0 -288
  40. package/bundled-references/maggiedash-booking/SKILLS-AND-CLI.md +0 -551
  41. package/bundled-references/maggiedash-booking/TASK-RUNBOOK.md +0 -107
  42. package/bundled-references/maggiedash-booking/TASKS.md +0 -178
@@ -1,270 +0,0 @@
1
- # ORA Wellness Booking integration audit
2
-
3
- Initial audit: 2026-09-21 · Stripe status refreshed: 2026-09-28
4
- Project: `/home/balalior/Dev/clients/orawellness.uk`
5
- Source: MaggieDash Booking `0.2.10` plus ORA host adapter
6
-
7
- ## Short answer
8
-
9
- The host now has the main Fresha-style foundation: manager workspace, services,
10
- staff, resources, working hours, availability, holds, bookings, customer
11
- tokens, Stripe payment boundary, Resend notification outbox, audit records,
12
- email/password login, and separate Booking roles.
13
-
14
- It is not production-ready yet. The remaining work is deployment evidence and
15
- provider operations, not another UI shell. A 2026-09-28 read-only Chrome smoke
16
- found the live `/book` page advertising online booking; the direct customer
17
- page returned availability through 00:20, past the published closing time.
18
- No booking was submitted. The deployed version, payment readiness, and checkout
19
- outcome are unknown, so this is an active production exposure/schedule
20
- discrepancy to reconcile.
21
-
22
- The source audit found that the public availability adapter still used the
23
- generic duration-stepped query while customer hold creation used the host
24
- schedule planner. This explains why public starts could exceed venue hours or
25
- capacity constraints. The ORA working tree now routes both reads and holds
26
- through the same location/staff/resource-aware planner and requires the service
27
- to be enabled for online booking. Local adapter and rules regressions pass;
28
- a read-only staging API recheck returned assessment starts 17:45–20:15 local,
29
- ending by 20:50 before the 21:00 close. Production reconciliation remains open.
30
-
31
- BK-124 completed the follow-up audit of saved location closures. The shared
32
- planner now loads the requested tenant/location's closure intervals and applies
33
- them to both public availability and hold revalidation, including exact-edge
34
- boundary regressions. Local source/build checks pass; production remains
35
- unverified and unchanged.
36
-
37
- BK-125 also wires dated staff shifts into the same planner. Shifts constrain
38
- staff on the selected date in addition to recurring venue/staff hours, while a
39
- date without a shift retains the existing fallback behavior. Public slots and
40
- hold checks share this rule; production remains unverified and unchanged.
41
-
42
- The ORA `.env` contains a Stripe test secret under the existing
43
- `ST_SECRECT_KEY` compatibility name, a publishable test key under `ST_PUB_KEY`,
44
- and `STRIPE_WEBHOOK_SECRET`; no secret values are recorded here. The ai-cmo
45
- Booking setup checklist recognizes the legacy alias and reports the key pair
46
- as configured-pending-verification. A Stripe test-mode Checkout for £68 GBP
47
- was completed through the customer flow; Stripe readback showed a paid Checkout
48
- and succeeded PaymentIntent, and the staging Booking/customer history now agree
49
- on confirmed/paid. The configured sandbox identifies as APHRODITE FASHION
50
- LIMITED with charges disabled. Whether this is ORA's intended account and the
51
- authenticated Booking **Verify Stripe connection** check remain unconfirmed;
52
- test API availability is not account-identity or live-readiness evidence. A
53
- later approved direct test-mode probe also created/read/expired a £1 Checkout
54
- and confirmed a £1 `pm_card_visa` PaymentIntent. The account still reports
55
- `charges_enabled=false` and `payouts_enabled=false`, so online payment remains
56
- disabled.
57
-
58
- Current database gate: the explicitly targeted `orawellness-staging` database
59
- passes read-only core, Booking, and access schema checks. `DATABASE_URL` remains
60
- unclassified and is not release evidence; the approved production target has
61
- not been verified or migrated. The 2026-09-21 read-only preflight is historical:
62
- it found `maggiedash_booking_allocations` and
63
- `maggiedash_booking_user_roles` absent before the staging setup. Do not enable
64
- the production dashboard or scheduler until the owner confirms the production
65
- target, approves any migration, verifies backup/restore, creates the first
66
- owner, and captures authenticated runtime evidence.
67
-
68
- ## Verified in the codebase
69
-
70
- | Capability | Evidence | State |
71
- |---|---|---|
72
- | Manager dashboard | `/_maggie/booking`, `_maggie/booking/booking.tsx` | Installed |
73
- | Traditional authentication | `src/lib/maggie/auth.ts`, registration and login routes | Installed |
74
- | Booking roles | `maggiedash_booking_user_roles`, Staff access panel, complete server-enforced capability registry for calendar/bookings/customers/waitlist/catalogue/packages/staff/resources/schedule/locations/payments/refunds/notifications/settings/reports/audit | Installed; explicit staff/finance grants and safe legacy defaults covered by BK-101 |
75
- | Staff account lifecycle | Booking Staff panel creates accounts, sends Resend invitations, supports one-time password setup and password reset | Installed; real delivery/browser proof pending |
76
- | Staff data scope | Linked `staff_id` passed into the server context and filtered in the repository | Installed; host migration/staging proof pending |
77
- | Services/treatments | Searchable catalogue with editable service/variant details, payment policy, price, preparation/cleanup buffers, active/inactive state, manager multi-treatment appointments, public multi-treatment holds/checkout, and live service/location selectors | Installed; legacy allocation backfill and staging data verification pending |
78
- | Treatment packages | Tenant-scoped manager catalogue, manager-granted entitlements, public package checkout/payment return and fully covered public customer redemption, webhook fulfillment, balance reads, expiry checks, atomic redemption, cancellation-safe package-credit restoration, guarded refunds, and package confirmation/refund Resend outbox events | Installed locally; real Stripe/DB migration, webhook, Resend, and staging delivery proof pending |
79
- | Locations | Tenant-scoped Locations screen and `locations.json` route for first-location setup, timezone, locale, address, active state, and online-booking controls; public catalogue exposes all active online-booking locations | Installed; staging data verification pending |
80
- | Staff/resources | Editable staff profiles, service/location assignments, bookable state, resources, capacity, resource service assignments, and overlap constraints | Installed; staging data verification pending |
81
- | Calendar/availability | Day/week calendar, working hours, shifts, time off, closures, holds | Installed |
82
- | Booking defaults | Settings screen edits venue timezone/currency, pauses new booking writes, and selects automatic/manual capture policy | Installed; staging policy verification pending |
83
- | Stripe | Injected SDK gateway, account capability row, signed webhook boundary | Host-wired; staging proof pending |
84
- | Resend | Notification outbox plus `scripts/maggie-booking-worker.mjs` dispatcher, including a separate 30-day sealed customer-manage link | Host-wired; scheduled delivery proof pending; worker waits for Booking schema |
85
- | Notification operations | Tenant-scoped Notifications screen, redacted delivery-state list, and owner/manager-only dead-letter replay with reason/idempotency/audit controls | Installed; ORA validators/build passed; real delivery proof pending |
86
- | Public self-booking | `/_maggie/booking/book`, catalog/location selector, location-scoped combined-duration availability, multi-treatment hold/checkout, return, token-bound segment-safe reschedule/cancel, and 30-day customer-manage history | Installed; staging proof pending |
87
- | Waitlist | Public no-slot join, tenant-scoped manager queue, manual notify/cancel/priority actions, transactional conversion to a linked booking, priority/FIFO worker matching, and `booking.waitlist.available` Resend intent | Installed; explicit worker scope, real migration, scheduler, and delivery proof pending |
88
- | Reports | `/reports.json` plus Booking Reports screen with period/service/staff/location breakdowns | Installed; staging data verification pending |
89
- | Bookability readiness | Overview reports active location, catalogue variant, assigned bookable staff, working hours, overall bookable state, and payment capability | Installed; staging data verification pending |
90
- | Customer history | Searchable tenant-scoped manager directory plus token-bound public customer-manage history with redacted appointment summaries | Installed; staging data verification pending |
91
- | Schedule rules | Searchable/editable working hours, staff shifts, time off, and location closures through the audited schedule route | Installed; staging data verification pending |
92
- | 24-hour reminders | Worker queues one idempotent `booking.reminder` email into the Resend outbox for each eligible confirmed booking | Installed; scheduled Resend delivery evidence pending |
93
- | Payment policy and balance | Service-level full/deposit/pay-later/no-payment policy, purpose-labelled attempts, paid/balance projection, and refund projection | Installed; migration and Stripe staging evidence pending |
94
- | Payment truth | Verified webhook/provider read projects payment and booking state | Implemented; Stripe event test pending |
95
- | Legacy `/book` | Request-by-email flow | Kept as fallback |
96
-
97
- ## Fixes made during this audit
98
-
99
- 1. Public catalogue now returns all active online-booking locations plus a
100
- backwards-compatible first `locationId`. The browser displays the tenant
101
- locations, scopes availability to the selected location, and posts that
102
- selected ID instead of using the fake `location-1` fallback.
103
- 2. Public origin and rate-limit failures now return safe 403/429 responses.
104
- 3. Stripe account status and capabilities are upserted into
105
- `maggiedash_booking_payment_accounts`; no secret value is stored there.
106
- 4. Webhook records store a SHA-256 payload hash instead of using the provider
107
- event ID as a misleading hash.
108
- 5. Customer cancellation queues the Booking notification through the same
109
- Resend outbox.
110
- 6. Customer rescheduling now uses the same sealed token, transactional
111
- allocation conflict checks, idempotent replay, and `booking.rescheduled`
112
- Resend outbox path as manager rescheduling.
113
- 7. Customer checkout now creates a short-lived payment-return token and a
114
- separate 30-day `manage` token. The Resend worker reuses or creates the
115
- manage token for booking notifications without storing a raw token in the
116
- outbox.
117
- 8. Verified payment events now project `pending_payment` to `confirmed` and
118
- `paid`, or cancel failed payment bookings and release their allocations,
119
- before the worker acknowledges the event. Confirmation/cancellation
120
- notifications are then queued once.
121
- 9. Booking Staff can now create an email/password account directly, link its
122
- staff profile, assign permissions, and resend a secure invitation without
123
- using a separate People screen.
124
- 10. Added the `/_maggie/reset-password` middleware rewrite so invitation and
125
- password-reset links resolve to the Astro reset page.
126
- 11. Added a manager Overview setup checklist that reads the existing payment
127
- health response, shows Stripe status and test/live mode, and provides a
128
- copyable webhook URL without exposing provider secrets.
129
- 12. Fixed the installed UI validator to resolve ORA's `_maggie/booking`
130
- workspace instead of assuming a source-package `maggiedash/booking/src`
131
- directory.
132
- 13. Added provider-neutral automatic waitlist matching. The worker matches one
133
- eligible waiting customer per explicit service/location slot, persists the
134
- offered interval, and queues an idempotent Resend notification without
135
- auto-reserving the appointment.
136
- 14. Added the public `GET /api/maggie/booking/public/manage.json` history
137
- surface. The existing 30-day Resend manage token now resolves the current
138
- customer's tenant-scoped appointments through a redacted DTO; payment
139
- tokens and manager credentials are not accepted by this endpoint.
140
- 15. Added manager multi-treatment appointments. The form can compose up to 12
141
- service segments, while the host validates duration, availability, shared
142
- location/currency, per-segment staff/resource allocation, and persists the
143
- segments and allocations atomically with the booking.
144
- 16. Added public multi-treatment booking and segment-safe rescheduling. Customer
145
- holds persist `segments_json`, checkout sums all treatment prices, and both
146
- customer and manager rescheduling shift each segment/allocation together
147
- while checking conflicts independently and preserving the total duration.
148
- 17. Removed install-time `location-1`/`service-1` assumptions. Catalog and
149
- schedule reads now return tenant locations; manager forms derive defaults
150
- from those responses, and resource writes persist service assignments.
151
- 18. Added tenant-scoped location management so a blank project can create its
152
- first venue before configuring services, staff, resources, and schedules.
153
- The same audited location contract is mirrored in ORA's installed Booking
154
- workspace.
155
- 19. Fixed a runtime catalogue query that referenced the nonexistent
156
- `service_variants.created_at` column. Variant reads now use stable existing
157
- columns for ordering. Hardened the ORA initial catalogue seed so a partial
158
- retry reuses matching services and upserts variants instead of creating
159
- duplicate services.
160
- 20. Closed the treatment catalogue UI parity gap: the manager can now manage
161
- every variant under a service, including duration, price, currency, and
162
- active state, while preserving the existing idempotent backend write.
163
- 21. Aligned ORA public availability reads with the host schedule planner used
164
- for customer holds. Public options now respect location hours, mapped staff
165
- and resources, existing occupancy, and the online-booking service flag.
166
- Local adapter, booking/rule, route-gate, contract, and build checks pass;
167
- staging and browser re-verification are still required.
168
-
169
- ## Installer productization update
170
-
171
- The MaggieDash distribution now declares an Astro host bootstrap. New Astro
172
- projects can use:
173
-
174
- ```bash
175
- maggie booking install --project . --confirm
176
- ```
177
-
178
- The installer adds missing Booking routes, email/password registration/login,
179
- PostgreSQL/Stripe adapter wiring, public booking route, middleware scaffold,
180
- schema command, Resend worker, and `.env.maggie-booking.example`. Existing
181
- host files are preserved. ORA already has host-owned versions of these files,
182
- so a repeat install should preserve ORA's middleware, auth, and adapter rather
183
- than overwrite them. Existing Astro middleware in either the full-context or
184
- common destructured-context form now receives the idempotent rewrite block;
185
- unknown middleware shapes remain fail-closed and are reported for manual review
186
- before the Booking URL is exposed.
187
-
188
- For hosts that use the installed Resend outbox and reminder worker, the CLI can
189
- also generate a reviewed scheduler artifact:
190
-
191
- ```bash
192
- maggie booking install --project . --confirm --bootstrap --schedule systemd
193
- ```
194
-
195
- The command writes the systemd service/timer under `deploy/` but does not
196
- enable or start it. Production still requires an approved service user,
197
- migration, backup/restore, alert routing, and authenticated runtime evidence.
198
-
199
- ## Release blockers
200
-
201
- | Priority | Work | Why it matters | Owner |
202
- |---|---|---|---|
203
- | P0 | Verify the approved production database target and Booking/access schema state | The explicitly targeted staging database has core, Booking, and access tables ready. `DATABASE_URL` is unclassified, and no production schema check or migration is accepted as release evidence. Confirm the production target and backup/restore plan; perform read-only verification first, and apply schema only after explicit approval | ORA deployment |
204
- | P0 | Reconcile the live public Booking exposure and out-of-hours availability | Chrome read-only inspection found `/book` advertises online booking and the public page returns starts past the published close. This conflicts with the prior release assumption; deployed version, payment account, and checkout outcome are unverified | ORA + release owner |
205
- | P0 | Release the current MaggieDash source used by the default installer | The public `9d99de7` source is a validated `0.2.8` baseline, but the current 47-route/no-show changes remain uncommitted in the working tree | MaggieDash release owner |
206
- | P0 | Confirm the intended Stripe account and complete authenticated Booking connection verification | Direct test-mode Checkout and test-card PaymentIntent calls pass, but the configured sandbox reports charges/payouts disabled and is not confirmed as ORA's intended account. Keep `onlinePayment` disabled until the correct account is confirmed and the host verifies its capabilities | ORA + client |
207
- | P0 | Run worker every minute with alerting | Holds, payment projections, and Resend delivery otherwise remain pending; `maggie booking worker-schedule` now generates the reviewed systemd/cron artifact, but host enablement and alert routing remain pending | ORA operations |
208
- | P0 | Review Resend activity after the staging preview incident | Two pre-fix staging previews each reported one provider-accepted notification without persisting outbox state; a duplicate submission is possible. Review provider activity and assess any duplicate before a worker `--write` run | ORA operations |
209
- | P0 | Capture authenticated runtime/browser/ops evidence | Local build and reference fixtures cannot prove the real host | ORA + release owner |
210
- | P1 | Complete remaining Stripe test-mode scenarios | Checkout success and an expired unpaid Checkout are covered. Failure, delayed/duplicate webhook, refund, and the authenticated host connection still need evidence against the confirmed intended account | ORA + Stripe |
211
- | P1 | Capture Resend invitation/reset evidence | Booking notifications are wired; staff account invitation and password reset now use the same server-side Resend configuration | ORA + release owner |
212
- | P1 | Capture reminder delivery evidence | The worker now enqueues reminders; staging must prove scheduler timing, Resend acceptance, retry, and no duplicate send | ORA + release owner |
213
- | P1 | Verify customer-manage links in real Resend emails | Staging must prove the 30-day link opens the noindex customer page and reschedule/cancel remain token-bound | ORA + release owner |
214
- | P1 | Verify waitlist notification delivery and conversion workflow | Staging must prove queue scope, one-time notification behavior, Resend acceptance, conflict handling, and the linked booking/confirmation email | ORA + product owner |
215
- | P1 | Switch marketing CTAs from `/book` to `/_maggie/booking/book` | Avoid sending customers to the new flow before staging proves it | Product owner |
216
- | P2 | Add richer Fresha features | Package purchase/refund paths are implemented locally. Memberships, gift cards, advanced multi-location staff rules, and customer-side package/membership pricing remain roadmap items. Customer self-service history, bounded automatic waitlist matching, and segment-safe multi-treatment rescheduling still need real host delivery proof | Product roadmap |
217
-
218
- ## Evidence already run
219
-
220
- - ORA `npm run build`: passed with no errors, warnings, or hints;
221
- the Stripe setup checklist is included in the built Booking workspace.
222
- - ORA `npm audit --omit=dev --audit-level=high`: passed with zero
223
- vulnerabilities after refreshing the Cloudflare/Wrangler lockfile chain.
224
- - ORA `maggie booking inspect --project .`: passed all installed workspace,
225
- contract, schema, customer, worker, and ops checks.
226
- - ORA installed UI and customer UI validators: passed after resolving the
227
- `_maggie/booking` workspace path.
228
- - Central and ORA Booking UI validators now also reject fixture location/service
229
- IDs in the installed manager source; both copies passed.
230
- - Central and ORA location configuration, service-contract, route-handler, and
231
- reference-host validators now cover the 47-route manager surface; both
232
- installed UI copies passed.
233
- - ORA worker/runtime regression: passed for waitlist priority/FIFO matching,
234
- one-time offered-slot persistence, and idempotent replay.
235
- - ORA customer reference-host regression: passed public multi-treatment
236
- availability, hold/checkout, and token-bound multi-treatment rescheduling;
237
- the PostgreSQL core regression also passed segment-safe rescheduling.
238
- - MaggieDash customer-flow, customer-UI, runtime-plan, worker-repository, and
239
- syntax checks: passed.
240
- - ORA `maggie booking release-gate --project .`: static contract/workspace gate
241
- passed; runtime, browser, ops, and board evidence were not supplied.
242
- - ORA `maggie booking setup --project .`: dependencies, database URL, public
243
- URL, Booking token secret, Resend sender configuration, and a Stripe test
244
- secret alias are present; the missing webhook secret keeps Stripe in pending
245
- verification, while schema, first owner, and worker schedule remain explicit
246
- verification steps.
247
- - Full required release gate was run read-only on 2026-09-21 and correctly
248
- returned `blocked` for the missing runtime, browser, ops, and unfinished-board
249
- evidence. It did not run migrations, create bookings, send email, or deploy.
250
- - ORA `npm run booking:schema -- --check`: `needs-migration` with core present,
251
- Booking absent, and Booking access absent. This command was read-only; no
252
- database migration was applied.
253
- - Disposable local ORA Astro runtime: first-owner registration HTTP 201,
254
- password login HTTP 200, authenticated overview/settings/catalog/staff HTTP
255
- 200, and public catalog HTTP 200 against a temporary PostgreSQL database.
256
- This caught the variant ordering and partial-seed defects above; it is not
257
- production or staging evidence.
258
- - Central and ORA PostgreSQL core integrations now persist two treatment
259
- variants, assert expanded allocation ranges after rescheduling, and reject a
260
- buffer-overlapping adjacent booking. The reference hosts and customer
261
- cursors also apply the same rule. The one-time
262
- `schema/maggie-booking-buffer-backfill.sql` migration is included but still
263
- needs staging/owner approval; no live ORA database was changed.
264
-
265
- ## Decision
266
-
267
- Do not market this as a complete Fresha replacement yet. It is a valid Booking
268
- foundation and installable host integration. The next safe step is staging
269
- migration plus real Stripe/Resend/browser evidence, followed by a canary before
270
- changing the public CTA.