@topy-ai/maggie 0.7.46 → 0.7.48

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 (63) hide show
  1. package/README-zh-TW.md +12 -4
  2. package/README.md +55 -11
  3. package/bin/maggie.js +26 -4
  4. package/bundled-contracts/maggie-design/palette-roles-v1.schema.json +47 -0
  5. package/bundled-contracts/maggie-marketplace/template-content-v1.schema.json +103 -0
  6. package/bundled-contracts/maggiedash/booking-browser-evidence-v1.json +21 -0
  7. package/bundled-contracts/maggiedash/booking-browser-evidence-v2.json +191 -0
  8. package/bundled-contracts/maggiedash/booking-email-templates-v1.json +3 -1
  9. package/bundled-contracts/maggiedash/booking-voucher-lifecycle-v1.json +85 -0
  10. package/bundled-contracts/maggiedash/execution-board.json +4629 -1553
  11. package/bundled-contracts/maggiedash/stripe-booking-capabilities-v1.json +1 -0
  12. package/bundled-marketplace/README.md +17 -0
  13. package/bundled-marketplace/catalog.json +56 -7
  14. package/bundled-references/browser-inspection.md +25 -0
  15. package/bundled-references/maggiedash-booking/CURRENT-STATE.md +128 -10
  16. package/bundled-references/maggiedash-booking/EXECUTION-BOARD.json +4629 -1553
  17. package/bundled-references/maggiedash-booking/HOST-ADAPTER.md +5 -0
  18. package/bundled-references/maggiedash-booking/ORAWELLNESS-INTEGRATION-AUDIT.md +64 -21
  19. package/bundled-references/maggiedash-booking/PRD.md +9 -1
  20. package/bundled-references/maggiedash-booking/PROGRESS.md +244 -2399
  21. package/bundled-references/maggiedash-booking/QA-TEST-PLAN.md +37 -6
  22. package/bundled-references/maggiedash-booking/README.md +23 -6
  23. package/bundled-references/maggiedash-booking/RUNTIME-OPERATIONS.md +64 -8
  24. package/bundled-references/maggiedash-booking/SKILLS-AND-CLI.md +11 -2
  25. package/bundled-references/maggiedash-booking/STRIPE-INTEGRATION.md +66 -2
  26. package/bundled-references/maggiedash-booking/TASK-RUNBOOK.md +1 -1
  27. package/bundled-references/maggiedash-booking/TASKS.md +44 -3
  28. package/bundled-references/maggiedash-booking/VOUCHERS.md +47 -0
  29. package/bundled-references/memory-hook.md +18 -5
  30. package/bundled-references/provider-adapter-contract.md +33 -0
  31. package/bundled-skills/maggie-booking/SKILL.md +8 -0
  32. package/bundled-skills/maggie-clone-to-template/SKILL.md +26 -0
  33. package/bundled-skills/maggie-deployment/SKILL.md +59 -1
  34. package/bundled-skills/maggie-deployment/references/vps.md +41 -0
  35. package/bundled-skills/maggie-design/SKILL.md +99 -0
  36. package/bundled-skills/maggie-feedback/SKILL.md +41 -2
  37. package/bundled-skills/maggie-marketplace/SKILL.md +91 -0
  38. package/bundled-skills/maggie-memory/SKILL.md +10 -1
  39. package/bundled-skills/maggie-qa-workflow/SKILL.md +41 -1
  40. package/bundled-skills/maggie-service-booking/SKILL.md +23 -0
  41. package/bundled-skills/maggie-social-share/SKILL.md +37 -5
  42. package/bundled-skills/maggie-social-share/references/queue-and-connections.md +101 -0
  43. package/bundled-skills/maggie-template/SKILL.md +57 -3
  44. package/bundled-skills/maggie-template/references/template-content-v1.example.json +34 -0
  45. package/bundled-tools/clis/maggie_booking.py +199 -26
  46. package/bundled-tools/clis/maggie_booking_vouchers.py +185 -0
  47. package/bundled-tools/clis/maggie_clone_to_template.py +14 -0
  48. package/bundled-tools/clis/maggie_deployment.py +295 -0
  49. package/bundled-tools/clis/maggie_design.py +9 -0
  50. package/bundled-tools/clis/maggie_design_lint.py +277 -0
  51. package/bundled-tools/clis/maggie_feedback.py +107 -3
  52. package/bundled-tools/clis/maggie_marketplace.py +199 -5
  53. package/bundled-tools/clis/maggie_memory.py +10 -3
  54. package/bundled-tools/clis/maggie_palette.py +280 -0
  55. package/bundled-tools/clis/maggie_qa_workflow.py +156 -1
  56. package/bundled-tools/clis/maggie_social_queue.py +338 -0
  57. package/bundled-tools/clis/maggie_social_share.py +42 -9
  58. package/bundled-tools/clis/maggie_template_package.py +1141 -0
  59. package/bundled-tools/runtime/maggie_memory.py +17 -2
  60. package/package.json +1 -1
  61. package/references/browser-inspection.md +25 -0
  62. package/references/memory-hook.md +18 -5
  63. package/references/provider-adapter-contract.md +33 -0
package/README-zh-TW.md CHANGED
@@ -29,9 +29,17 @@ npx @topy-ai/maggie init --scope project --agent all
29
29
  npx @topy-ai/maggie doctor --scope project --project .
30
30
  ```
31
31
 
32
- 目前 release 是 `0.7.46`。新增 browser adapter capability preflight、privacy-safe
33
- feedback evidence references/relationships、bounded batch-review evidence graph、
34
- remediation suggestions,以及 root-level unittest import 支援。`browser-audit
32
+ 目前 npm 版本為 `0.7.48`,處理 2026-10-10 的 27 條 hosted feedback(batch 26):Social Share 新增 `adapters`(每個 provider 一組 canonical OAuth scope,LinkedIn 不同 scope 會撤銷舊 token;共用 OAuth client 警告)、`connections`(撤銷或無法解密的 token 標為 `needs_reconnect`,偵測會過期的簽名頭像 URL)、`queue`(slot-based 排程:not-before、最新優先、campaign 輪流與每日上限、DST-safe)與 `campaigns`(idea stage Start gate);Deployment 新增 hash-only `secret-fingerprint`/`secret-parity`、`env-isolation`(本機 `.env` 指向 production database 時警告)、release retention 與 worker-before-enqueue 發布順序;QA 在未明確同意時阻擋對 production API 的寫入情境,並以 `maggie qa cors-preflight` 只用 OPTIONS 檢查每個 HTTP method;Design 新增 `pressable-check`、`layer-check`(Tailwind v4 unlayered CSS)、onboarding wizard/picker 模式與 `maggie-palette-roles-v1` palette generate/validate;Marketplace 加入 screenshot 完整性與像素預算、從 CSS 量測 palette、asset provenance、中性 `displayName`(全部模板已補齊)、template studio、`maggie-template-content-v1` 合約與圖片生成成本/無文字審查 gate;Booking 新增唯讀 Stripe live setup runbook 與 gift voucher lifecycle 合約(`maggie booking voucher-contract --ledger`);Feedback 新增 `improvement` 類型與 `maggie feedback session-summary`。MaggieDash 0.2.11 會保留尚未部署 template 的 outbox email 而不是 dead-letter,並從 ORA host 上游通用修正。本版也包含 Booking 十個 email events 合約與 CLI validator 同步及安全輸出的 `arrivalNote`。前一版 `0.7.47` 處理 2026-09-26 五條新 feedback:project-scope
33
+ `maggie init` 會建立本地 memory store;context 預設只讀取本 project scope;memory hook
34
+ 在 local Python adapter 不存在時 fallback 到已安裝 CLI;重複 init 保留既有檔案與時間戳;
35
+ `maggie feedback list` 的 `--project` 可放在子命令前或後。Generated VPS runner 現在記錄
36
+ Maggie 版本與 template fingerprint;preflight 會警示過期/無標記 runner,其他路徑可用
37
+ `maggie deployment --check-runner PATH` 檢查。
38
+
39
+ 0.7.46 feedback batch 仍包含 release profile capability gate、deployment readiness bounded
40
+ retry、Google account/property target verification、GA/GTM external-write idempotency/readback、
41
+ browser adapter capability preflight、privacy-safe feedback evidence references/relationships,
42
+ 以及 root-level unittest import 支援。`browser-audit
35
43
  --check-browser` 會在導覽前拒絕 missing/incompatible adapter,包括解析成
36
44
  `xdg-open` 的系統 `browse`;feedback graph 不保存 raw payload、logs、credentials
37
45
  或本機路徑。另包含 0.7.45 的 Codex/Claude Code 一次性 user-scope 安裝、bundled
@@ -105,7 +113,7 @@ structure drift 或重複 treatment product 時 fail closed。
105
113
  deployment、memory、feedback 和 MaggieDash。內容先 draft/review,外部寫入、
106
114
  publish 與 production deployment 需要明確確認。
107
115
 
108
- 目前 source tree 的正式 release 是 `0.7.46`。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
116
+ 目前 npm 版本為 `0.7.48`,包含 batch 26 feedback 修正與 Booking email-template 合約/CLI validator 同步。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
109
117
  dispatch、`maggie --version`、feedback batch review 聚合與重複偵測、marketplace enrichment evidence、booking
110
118
  worker/resolver evidence,以及 read-only migration preflight。它也包含 host-owned mobile app surface contract、signed-in
111
119
  camera-state QA、直接 Astro route resolution、correlated feedback batch,以及
package/README.md CHANGED
@@ -89,10 +89,54 @@ Maggie keeps the existing project foundation and asks for decisions before
89
89
  shared routes, analytics, or publishing boundaries change. The current
90
90
  package ships 20 installable skills and a local-first MaggieDash foundation.
91
91
 
92
- The current release is `0.7.46`. It adds browser-adapter capability preflight,
93
- privacy-safe feedback evidence references/relationships, bounded batch-review
94
- evidence graphs, remediation suggestions, and root-level unittest import
95
- support. `browser-audit --check-browser` rejects missing or incompatible
92
+ This package is `0.7.48`. It processes the 27 hosted feedback
93
+ records of 2026-10-10 (batch 26) and includes the Booking email-template
94
+ contract/CLI sync with escaped `arrivalNote` rendering:
95
+
96
+ - Social Share: `adapters` enforces one canonical OAuth scope set per provider
97
+ (LinkedIn revokes earlier tokens on a different scope set) and warns about
98
+ shared OAuth clients; `connections` marks revoked/undecryptable tokens
99
+ `needs_reconnect` and flags expiring signed avatar URLs; `queue` is a
100
+ deterministic slot-based planner (not-before times, newest-first queue,
101
+ campaign round-robin with daily limits, DST-safe); `campaigns` gates the
102
+ idea stage before Start.
103
+ - Deployment: hash-only `secret-fingerprint`/`secret-parity` across hosts,
104
+ `env-isolation` plus a preflight warning when local `.env` points at the
105
+ production database, documented release retention, and worker-before-enqueue
106
+ release ordering.
107
+ - QA: mutating scenarios are blocked against a production API without
108
+ explicit consent, and `maggie qa cors-preflight` checks every HTTP method with
109
+ OPTIONS only.
110
+ - Design: `pressable-check` (nested pressables on React Native Web),
111
+ `layer-check` (unlayered CSS overriding Tailwind v4 utilities), onboarding
112
+ wizard/picker patterns, and the `maggie-palette-roles-v1` contract with
113
+ `maggie design palette generate|validate`.
114
+ - Marketplace/template: package audits for screenshot integrity and pixel
115
+ budget, palettes measured from template CSS, asset provenance, and neutral
116
+ `displayName`s (all catalogue templates backfilled); a template studio
117
+ (viewport × palette with overflow check); the `maggie-template-content-v1`
118
+ contract; and image-generation cost reports with a no-text review gate.
119
+ - Booking: a read-only Stripe live-setup runbook and the provider-neutral gift
120
+ voucher lifecycle contract with `maggie booking voucher-contract --ledger`.
121
+ - Feedback: an `improvement` type (hosted as `feature` + `subtype`) and
122
+ `maggie feedback session-summary`.
123
+ - MaggieDash 0.2.11 holds outbox emails whose template is not yet deployed
124
+ instead of dead-lettering them, and upstreams generic fixes from the ORA host.
125
+
126
+ The 0.7.47 release remains included: project
127
+ initialization creates the repository's Maggie Memory store, memory context
128
+ uses project-scope entries by default, the shared memory hook falls back to
129
+ the installed CLI, repeated memory initialization preserves unchanged
130
+ files, and `maggie feedback list` accepts `--project` before or after the
131
+ subcommand. Generated VPS release runners also record their Maggie version and
132
+ template fingerprint; deployment preflight warns about stale or unmarked
133
+ runners, with `maggie deployment --check-runner PATH` for other locations.
134
+
135
+ The 0.7.46 feedback batch remains included: capability-aware release profiles,
136
+ bounded deployment-readiness retries, verified Google account/target evidence,
137
+ idempotent external-write readback, browser-adapter capability preflight,
138
+ privacy-safe feedback evidence and relationships, and root-level unittest
139
+ import support. `browser-audit --check-browser` rejects missing or incompatible
96
140
  adapters before navigation, including a system `browse`/`xdg-open` opener.
97
141
  It also includes the 0.7.45 one-time user-scope installation for
98
142
  Codex and Claude Code, a bundled workflow runner, and scoped maintenance
@@ -657,8 +701,8 @@ artifact schemas.
657
701
  Recommended upgrade sequence for the current release:
658
702
 
659
703
  ```bash
660
- npx @topy-ai/maggie@0.7.46 update --scope project --project . --force
661
- npx @topy-ai/maggie@0.7.46 cleanup --scope project --project .
704
+ npx @topy-ai/maggie@0.7.48 update --scope project --project . --force
705
+ npx @topy-ai/maggie@0.7.48 cleanup --scope project --project .
662
706
  ```
663
707
 
664
708
  Maintainers should pass npm credentials through the repository helper, never
@@ -863,11 +907,11 @@ delivery outbox. It shows redacted delivery state and sanitized errors through
863
907
  manages Maggie's server-side transactional delivery queue and audit trail; it
864
908
  does not replace Resend's own domain, audience, campaign, or analytics console.
865
909
 
866
- The Booking browser-evidence gate covers all 15 manager routes at mobile,
867
- tablet, and desktop viewports (45 required screens), including waitlist,
868
- locations, notifications, reports, and audit. A production release still
869
- requires an authenticated HTTPS capture with zero console, request, and
870
- layout errors.
910
+ The Booking browser-evidence gate covers all 17 manager routes at mobile,
911
+ tablet, and desktop viewports (51 required screens), including waitlist,
912
+ locations, notifications, email templates, reports, settings, and audit. A
913
+ production release still requires an authenticated HTTPS capture with zero
914
+ console, request, and layout errors.
871
915
 
872
916
  Compare an existing dashboard before replacing it:
873
917
 
package/bin/maggie.js CHANGED
@@ -19,6 +19,23 @@ const TEMPLATES_ROOT = join(PACKAGE_ROOT, "bundled-templates");
19
19
  const STATE_DIR = ".maggie";
20
20
  const USER_SCOPE = "user";
21
21
  const PROJECT_SCOPE = "project";
22
+ const PROJECT_MEMORY_FILES = {
23
+ preferences: "preferences.json",
24
+ conventions: "project-conventions.json",
25
+ lessons: "lessons.json",
26
+ errors: "error-patterns.json",
27
+ };
28
+
29
+ function initializeProjectMemory(root) {
30
+ const memoryRoot = join(root, STATE_DIR, "memory");
31
+ mkdirSync(memoryRoot, { recursive: true });
32
+ for (const [kind, filename] of Object.entries(PROJECT_MEMORY_FILES)) {
33
+ const path = join(memoryRoot, filename);
34
+ if (!existsSync(path)) {
35
+ writeFileSync(path, `${JSON.stringify({ schemaVersion: 1, kind, updatedAt: new Date().toISOString(), items: [] }, null, 2)}\n`, { flag: "wx" });
36
+ }
37
+ }
38
+ }
22
39
  function loadSkillNames() {
23
40
  try {
24
41
  return JSON.parse(readFileSync(join(SKILLS_ROOT, "catalog.json"), "utf8")).skills.map((skill) => skill.name);
@@ -82,6 +99,8 @@ Usage:
82
99
  maggie dash structure-validate --model FILE --evidence FILE
83
100
  maggie design progressive-check|css-check|css-cascade-check|style-check --evidence FILE
84
101
  maggie design dash-init|dash-validate|sample-init|sample-validate [options]
102
+ maggie design pressable-check|layer-check --project PATH
103
+ maggie design palette generate --canvas HEX --text HEX --accent HEX | palette validate --palette FILE
85
104
  maggie seo privacy-check --evidence FILE
86
105
  maggie content FILE --source PROVIDER --project PATH --confirm
87
106
  maggie agent-content write --url URL --allowed-origin ORIGIN --token-env ENV --payload FILE
@@ -136,6 +155,8 @@ Usage:
136
155
  maggie service match-pages --project PATH --pages-dir src/pages
137
156
  maggie deployment --project PATH --target vps-with-cloudflare-dns
138
157
  maggie deployment worker-secrets --project PATH --environment staging --required RESEND_API_KEY
158
+ maggie deployment secret-parity --manifest api-1.json --manifest api-2.json --required KEY
159
+ maggie deployment env-isolation --project PATH --production-env .env.production
139
160
  maggie deployment readiness --project PATH
140
161
  maggie deployment parity --project PATH --evidence FILE --output FILE
141
162
  maggie deployment canary --project PATH --asset URL=SHA256 --render-report report.json --output docs/deployment-canary.json
@@ -158,8 +179,8 @@ Usage:
158
179
  maggie memory <init|list|search|context|add|record-error|transition|export> --project PATH
159
180
  maggie localization <extract|plan|generate|preview|validate|review|publish|stale|glossary> [options]
160
181
  maggie seo performance|images|sitemap|indexnow|social-cards|head-tags [options] (sitemap supports strict validate and agent-files)
161
- maggie feedback <collect|preview|batch|batch-review|submit|list> [options]
162
- maggie qa <start|record|summary|export|assertion-audit> [options]
182
+ maggie feedback <collect|preview|batch|batch-review|session-summary|submit|list> [options]
183
+ maggie qa <start|record|summary|export|assertion-audit|cors-preflight> [options]
163
184
  maggie site-audit URL [--crawl] [--access-log FILE] [--require-sitemap-request] [--languages en-GB,es-MX,ja-JP] [--check-hreflang] [--check-internal-links]
164
185
  maggie site-audit URL --crawl --save-baseline FILE --reviewer NAME
165
186
  maggie site-audit URL --crawl --baseline FILE [--reason-all REASON]
@@ -488,6 +509,7 @@ function install(args) {
488
509
  if (existsSync(MARKETPLACE_ROOT)) copyIfMissing(MARKETPLACE_ROOT, join(root, "marketplace"));
489
510
  if (existsSync(CONTRACTS_ROOT)) copyIfMissing(CONTRACTS_ROOT, join(root, "contracts"));
490
511
  if (existsSync(join(TEMPLATES_ROOT, "maggiedash"))) copyIfMissing(join(TEMPLATES_ROOT, "maggiedash"), join(root, "templates", "maggiedash"));
512
+ initializeProjectMemory(root);
491
513
  }
492
514
  const manifestRoots = scope === USER_SCOPE ? allUserAgentRoots() : roots;
493
515
  const installedUserSkills = scope === USER_SCOPE ? mergedUserSkillNames(manifestRoots) : [];
@@ -496,7 +518,7 @@ function install(args) {
496
518
  : { scope, version: PACKAGE_VERSION, agents: roots.map((item) => item.slice(root.length + 1)), skills: mergedSkillNames(root, skills), managedFiles: managedFileDigests(root, roots, skills), installed_at: new Date().toISOString() };
497
519
  writeInstallManifest(root, manifest, scope);
498
520
  console.log(scope === USER_SCOPE ? `Maggie installed for this user in ${userStateRoot()}` : `Maggie installed in ${root}`);
499
- console.log(scope === USER_SCOPE ? "Project state remains local; run `maggie doctor --scope user` to verify the user install." : "Run `maggie doctor --project .` before using mutating workflows.");
521
+ console.log(scope === USER_SCOPE ? "Project state remains local; run `maggie doctor --scope user` to verify the user install." : "Project-scoped Maggie Memory is initialized locally; run `maggie doctor --project .` before using mutating workflows.");
500
522
  }
501
523
 
502
524
  function update(args) {
@@ -591,7 +613,7 @@ function workflowCli(name, args) {
591
613
  const root = projectRoot(args);
592
614
  const script = toolScript(name, root);
593
615
  if (!existsSync(script)) throw new Error(`${name} is missing: ${script}`);
594
- const env = name === "maggie_feedback.py" ? { ...process.env, MAGGIE_VERSION: PACKAGE_VERSION } : process.env;
616
+ const env = { ...process.env, MAGGIE_VERSION: PACKAGE_VERSION };
595
617
  const result = spawnSync("python3", [script, ...args], { stdio: "inherit", cwd: root, env });
596
618
  if (result.error) throw result.error;
597
619
  process.exitCode = result.status ?? 1;
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/TOPY-AI-LTD/ai-cmo-skills/blob/main/contracts/maggie-design/palette-roles-v1.schema.json",
4
+ "title": "Maggie template palette role contract",
5
+ "description": "Semantic colour roles for one template: its signature palette plus derived, contrast-safe variants. Generated and validated by `maggie design palette`. Contrast rules (text, accentText and onAccent at 4.5:1) and the variant accent saturation cap are enforced by `maggie design palette validate`, not by this schema.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "template", "signature", "variants"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "maggie-palette-roles-v1" },
11
+ "template": { "type": ["string", "null"] },
12
+ "signature": {
13
+ "allOf": [
14
+ { "$ref": "#/$defs/palette" },
15
+ { "properties": { "id": { "const": "signature" } } }
16
+ ]
17
+ },
18
+ "variants": { "type": "array", "items": { "$ref": "#/$defs/palette" } }
19
+ },
20
+ "$defs": {
21
+ "hex": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
22
+ "palette": {
23
+ "type": "object",
24
+ "required": ["id", "name", "roles"],
25
+ "properties": {
26
+ "id": { "type": "string", "minLength": 1 },
27
+ "name": { "type": "string", "minLength": 1 },
28
+ "roles": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["canvas", "panel", "soft", "text", "accent", "accentText", "onAccent", "dark", "deep"],
32
+ "properties": {
33
+ "canvas": { "$ref": "#/$defs/hex", "description": "Page background." },
34
+ "panel": { "$ref": "#/$defs/hex", "description": "Cards and raised surfaces; body text must pass on it." },
35
+ "soft": { "$ref": "#/$defs/hex", "description": "Tinted band or chip background; not for long body copy." },
36
+ "text": { "$ref": "#/$defs/hex", "description": "Body text on canvas and panel." },
37
+ "accent": { "$ref": "#/$defs/hex", "description": "Buttons and highlights (fills)." },
38
+ "accentText": { "$ref": "#/$defs/hex", "description": "Accent-coloured text and links on canvas." },
39
+ "onAccent": { "$ref": "#/$defs/hex", "description": "Text placed on an accent fill." },
40
+ "dark": { "$ref": "#/$defs/hex", "description": "Dark band background." },
41
+ "deep": { "$ref": "#/$defs/hex", "description": "Deepest band, footer or overlay." }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/TOPY-AI-LTD/ai-cmo-skills/blob/main/contracts/maggie-marketplace/template-content-v1.schema.json",
4
+ "title": "Maggie template content contract",
5
+ "description": "Neutral business content a marketplace template renders when exported as a data-driven component, so one design serves many businesses from their own data. Palette roles come from maggie-palette-roles-v1 and are emitted as --maggie-<role> CSS variables. Business rules (sample paths resolve, reviews carry a source or sample=true, hours are HH:MM) are enforced by `maggie_marketplace.py content-validate`.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "brand", "contact", "hero", "categories", "about", "gallery", "reviews", "hours", "faqs"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "maggie-template-content-v1" },
10
+ "brand": {
11
+ "type": "object",
12
+ "required": ["name"],
13
+ "properties": {
14
+ "name": { "type": "string", "minLength": 1 },
15
+ "tagline": { "type": ["string", "null"] },
16
+ "logo": { "$ref": "#/$defs/image" }
17
+ }
18
+ },
19
+ "contact": {
20
+ "type": "object",
21
+ "properties": {
22
+ "phone": { "type": ["string", "null"] },
23
+ "email": { "type": ["string", "null"] },
24
+ "address": { "type": ["string", "null"] },
25
+ "bookingUrl": { "type": ["string", "null"] }
26
+ }
27
+ },
28
+ "hero": {
29
+ "type": "object",
30
+ "required": ["headline"],
31
+ "properties": {
32
+ "headline": { "type": "string", "minLength": 1 },
33
+ "subheadline": { "type": ["string", "null"] },
34
+ "image": { "$ref": "#/$defs/image" },
35
+ "cta": { "type": "object", "properties": { "label": { "type": "string" }, "href": { "type": "string" } } }
36
+ }
37
+ },
38
+ "categories": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "object",
42
+ "required": ["name", "services"],
43
+ "properties": {
44
+ "name": { "type": "string", "minLength": 1 },
45
+ "description": { "type": ["string", "null"] },
46
+ "services": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "object",
50
+ "required": ["name"],
51
+ "properties": {
52
+ "name": { "type": "string", "minLength": 1 },
53
+ "description": { "type": ["string", "null"] },
54
+ "price": { "type": ["number", "null"], "minimum": 0 },
55
+ "currency": { "type": "string", "default": "GBP" },
56
+ "durationMinutes": { "type": ["integer", "null"], "minimum": 1 },
57
+ "bookingRef": { "type": ["string", "null"], "description": "Host booking/catalogue identifier, e.g. a MaggieDash Booking service id." }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "about": { "type": "object", "properties": { "heading": { "type": ["string", "null"] }, "body": { "type": ["string", "null"] }, "image": { "$ref": "#/$defs/image" } } },
65
+ "gallery": { "type": "array", "items": { "$ref": "#/$defs/image" } },
66
+ "reviews": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "required": ["quote"],
71
+ "properties": {
72
+ "quote": { "type": "string" },
73
+ "author": { "type": ["string", "null"] },
74
+ "rating": { "type": ["number", "null"], "minimum": 0, "maximum": 5 },
75
+ "source": { "type": ["string", "null"], "description": "Where the real review came from; required unless sample is true." },
76
+ "sample": { "type": "boolean" }
77
+ }
78
+ }
79
+ },
80
+ "hours": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "object",
84
+ "required": ["day"],
85
+ "properties": {
86
+ "day": { "enum": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] },
87
+ "opens": { "type": "string", "pattern": "^\\d{2}:\\d{2}$" },
88
+ "closes": { "type": "string", "pattern": "^\\d{2}:\\d{2}$" },
89
+ "closed": { "type": "boolean" }
90
+ }
91
+ }
92
+ },
93
+ "faqs": { "type": "array", "items": { "type": "object", "required": ["question", "answer"], "properties": { "question": { "type": "string" }, "answer": { "type": "string" } } } },
94
+ "samples": { "type": "array", "items": { "type": "string" }, "description": "Dotted content paths that still hold template sample copy the owner must replace (e.g. hero.headline, reviews.0)." },
95
+ "palette": { "type": "object", "description": "One maggie-palette-roles-v1 palette (id, name, roles)." }
96
+ },
97
+ "$defs": {
98
+ "image": {
99
+ "type": ["object", "null"],
100
+ "properties": { "src": { "type": "string" }, "alt": { "type": "string" } }
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggiedash.topy.ai/contracts/booking-browser-evidence-v1.json",
4
+ "title": "MaggieDash Booking production browser evidence v1",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "baseUrl", "generatedAt", "viewports", "screens", "consoleErrors", "failedRequests", "layoutErrors"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "maggiedash-booking-browser-evidence.v1" },
9
+ "baseUrl": { "type": "string", "pattern": "^https://" },
10
+ "generatedAt": { "type": "string", "format": "date-time" },
11
+ "version": { "type": "string" },
12
+ "viewports": { "type": "array", "minItems": 3, "items": { "type": "object", "required": ["name", "width", "height"] } },
13
+ "screens": { "type": "array", "minItems": 51, "items": { "type": "object", "required": ["route", "viewport", "httpStatus", "screenshot", "ready"] } },
14
+ "consoleErrors": { "type": "array", "items": { "type": "string" } },
15
+ "failedRequests": { "type": "array", "items": { "type": "string" } },
16
+ "layoutErrors": { "type": "array", "items": { "type": "string" } },
17
+ "notes": { "type": "array", "items": { "type": "string" } }
18
+ },
19
+ "x-required-routes": ["/_maggie/booking/", "/_maggie/booking/calendar", "/_maggie/booking/bookings", "/_maggie/booking/customers", "/_maggie/booking/waitlist", "/_maggie/booking/locations", "/_maggie/booking/catalog", "/_maggie/booking/packages", "/_maggie/booking/staff", "/_maggie/booking/resources", "/_maggie/booking/schedule", "/_maggie/booking/payments", "/_maggie/booking/notifications", "/_maggie/booking/email-templates", "/_maggie/booking/reports", "/_maggie/booking/settings", "/_maggie/booking/audit"],
20
+ "x-required-viewports": [{"name":"mobile","width":390,"height":844},{"name":"tablet","width":768,"height":1024},{"name":"desktop","width":1440,"height":1000}]
21
+ }
@@ -0,0 +1,191 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggiedash.topy.ai/contracts/booking-browser-evidence-v2.json",
4
+ "title": "MaggieDash Booking production browser evidence v2",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "baseUrl",
9
+ "generatedAt",
10
+ "viewports",
11
+ "screens",
12
+ "consoleErrors",
13
+ "failedRequests",
14
+ "layoutErrors"
15
+ ],
16
+ "properties": {
17
+ "schemaVersion": {
18
+ "const": "maggiedash-booking-browser-evidence.v2"
19
+ },
20
+ "baseUrl": {
21
+ "type": "string",
22
+ "pattern": "^https://"
23
+ },
24
+ "generatedAt": {
25
+ "type": "string",
26
+ "format": "date-time"
27
+ },
28
+ "version": {
29
+ "type": "string"
30
+ },
31
+ "viewports": {
32
+ "type": "array",
33
+ "minItems": 3,
34
+ "items": {
35
+ "type": "object",
36
+ "required": [
37
+ "name",
38
+ "width",
39
+ "height"
40
+ ]
41
+ }
42
+ },
43
+ "screens": {
44
+ "type": "array",
45
+ "minItems": 51,
46
+ "items": {
47
+ "type": "object",
48
+ "required": [
49
+ "route",
50
+ "viewport",
51
+ "httpStatus",
52
+ "finalPath",
53
+ "heading",
54
+ "screenshot",
55
+ "ready"
56
+ ],
57
+ "properties": {
58
+ "route": {
59
+ "type": "string",
60
+ "enum": [
61
+ "/_maggie/booking/",
62
+ "/_maggie/booking/calendar",
63
+ "/_maggie/booking/bookings",
64
+ "/_maggie/booking/customers",
65
+ "/_maggie/booking/waitlist",
66
+ "/_maggie/booking/locations",
67
+ "/_maggie/booking/catalog",
68
+ "/_maggie/booking/packages",
69
+ "/_maggie/booking/staff",
70
+ "/_maggie/booking/resources",
71
+ "/_maggie/booking/schedule",
72
+ "/_maggie/booking/payments",
73
+ "/_maggie/booking/notifications",
74
+ "/_maggie/booking/email-templates",
75
+ "/_maggie/booking/reports",
76
+ "/_maggie/booking/settings",
77
+ "/_maggie/booking/audit"
78
+ ]
79
+ },
80
+ "viewport": {
81
+ "type": "string",
82
+ "enum": [
83
+ "mobile",
84
+ "tablet",
85
+ "desktop"
86
+ ]
87
+ },
88
+ "httpStatus": {
89
+ "type": "integer",
90
+ "minimum": 200,
91
+ "maximum": 399
92
+ },
93
+ "finalPath": {
94
+ "type": "string",
95
+ "pattern": "^/_maggie/booking(?:/|$)"
96
+ },
97
+ "heading": {
98
+ "type": "string",
99
+ "minLength": 1
100
+ },
101
+ "screenshot": {
102
+ "type": "string",
103
+ "minLength": 1
104
+ },
105
+ "ready": {
106
+ "const": true
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "consoleErrors": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "failedRequests": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "string"
121
+ }
122
+ },
123
+ "layoutErrors": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "string"
127
+ }
128
+ },
129
+ "notes": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "string"
133
+ }
134
+ }
135
+ },
136
+ "x-required-routes": [
137
+ "/_maggie/booking/",
138
+ "/_maggie/booking/calendar",
139
+ "/_maggie/booking/bookings",
140
+ "/_maggie/booking/customers",
141
+ "/_maggie/booking/waitlist",
142
+ "/_maggie/booking/locations",
143
+ "/_maggie/booking/catalog",
144
+ "/_maggie/booking/packages",
145
+ "/_maggie/booking/staff",
146
+ "/_maggie/booking/resources",
147
+ "/_maggie/booking/schedule",
148
+ "/_maggie/booking/payments",
149
+ "/_maggie/booking/notifications",
150
+ "/_maggie/booking/email-templates",
151
+ "/_maggie/booking/reports",
152
+ "/_maggie/booking/settings",
153
+ "/_maggie/booking/audit"
154
+ ],
155
+ "x-required-viewports": [
156
+ {
157
+ "name": "mobile",
158
+ "width": 390,
159
+ "height": 844
160
+ },
161
+ {
162
+ "name": "tablet",
163
+ "width": 768,
164
+ "height": 1024
165
+ },
166
+ {
167
+ "name": "desktop",
168
+ "width": 1440,
169
+ "height": 1000
170
+ }
171
+ ],
172
+ "x-required-headings": {
173
+ "/_maggie/booking/": "Overview",
174
+ "/_maggie/booking/calendar": "Calendar",
175
+ "/_maggie/booking/bookings": "Bookings",
176
+ "/_maggie/booking/customers": "Customers",
177
+ "/_maggie/booking/waitlist": "Waitlist",
178
+ "/_maggie/booking/locations": "Locations",
179
+ "/_maggie/booking/catalog": "Catalogue",
180
+ "/_maggie/booking/packages": "Packages",
181
+ "/_maggie/booking/staff": "Staff",
182
+ "/_maggie/booking/resources": "Resources",
183
+ "/_maggie/booking/schedule": "Schedule",
184
+ "/_maggie/booking/payments": "Payments",
185
+ "/_maggie/booking/notifications": "Notifications",
186
+ "/_maggie/booking/email-templates": "Email templates",
187
+ "/_maggie/booking/reports": "Reports",
188
+ "/_maggie/booking/settings": "Settings",
189
+ "/_maggie/booking/audit": "Audit"
190
+ }
191
+ }
@@ -11,16 +11,18 @@
11
11
  },
12
12
  "roles": ["owner", "admin", "manager"],
13
13
  "events": [
14
- { "id": "booking.confirmed", "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "manageUrl", "siteName"] },
14
+ { "id": "booking.confirmed", "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "manageUrl", "siteName", "arrivalNote"] },
15
15
  { "id": "booking.rescheduled", "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "manageUrl", "siteName"] },
16
16
  { "id": "booking.cancelled", "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "reason", "siteName"] },
17
17
  { "id": "booking.reminder", "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "manageUrl", "siteName"] },
18
18
  { "id": "payment.action_required", "variables": ["customerName", "serviceName", "bookingId", "actionUrl", "siteName"] },
19
19
  { "id": "payment.refunded", "variables": ["customerName", "serviceName", "bookingId", "siteName"] },
20
+ { "id": "payment.no_show_fee", "variables": ["customerName", "serviceName", "bookingId", "amount", "siteName"] },
20
21
  { "id": "package.purchase.confirmed", "variables": ["customerName", "packageName", "amount", "expiresAt", "siteName"] },
21
22
  { "id": "package.purchase.refunded", "variables": ["customerName", "packageName", "amount", "siteName"] },
22
23
  { "id": "booking.waitlist.available", "variables": ["customerName", "serviceName", "when", "locationName", "bookingUrl", "siteName"] }
23
24
  ],
25
+ "variables": ["customerName", "serviceName", "when", "locationName", "bookingId", "manageUrl", "bookingUrl", "reason", "actionUrl", "packageName", "amount", "expiresAt", "siteName", "arrivalNote"],
24
26
  "endpointIds": ["booking.email-templates.read", "booking.email-templates.draft", "booking.email-templates.publish", "booking.email-templates.rollback"],
25
27
  "canonicalRoutes": {
26
28
  "booking.email-templates.read": "GET /email-templates.json",