@contractspec/bundle.library 2.9.1 → 3.1.1

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 (130) hide show
  1. package/.turbo/turbo-build.log +240 -214
  2. package/AGENTS.md +19 -12
  3. package/CHANGELOG.md +84 -0
  4. package/dist/application/context-storage/index.d.ts +18 -0
  5. package/dist/application/context-storage/index.js +29 -0
  6. package/dist/application/index.d.ts +1 -0
  7. package/dist/application/index.js +662 -2
  8. package/dist/application/mcp/cliMcp.js +12 -2
  9. package/dist/application/mcp/common.d.ts +11 -1
  10. package/dist/application/mcp/common.js +12 -2
  11. package/dist/application/mcp/contractsMcp.d.ts +51 -0
  12. package/dist/application/mcp/contractsMcp.js +531 -0
  13. package/dist/application/mcp/contractsMcpResources.d.ts +7 -0
  14. package/dist/application/mcp/contractsMcpResources.js +124 -0
  15. package/dist/application/mcp/contractsMcpTools.d.ts +9 -0
  16. package/dist/application/mcp/contractsMcpTools.js +200 -0
  17. package/dist/application/mcp/contractsMcpTypes.d.ts +50 -0
  18. package/dist/application/mcp/contractsMcpTypes.js +1 -0
  19. package/dist/application/mcp/docsMcp.js +12 -2
  20. package/dist/application/mcp/index.d.ts +2 -0
  21. package/dist/application/mcp/index.js +635 -2
  22. package/dist/application/mcp/internalMcp.js +12 -2
  23. package/dist/application/mcp/providerRankingMcp.d.ts +46 -0
  24. package/dist/application/mcp/providerRankingMcp.js +494 -0
  25. package/dist/components/docs/DocsIndexPage.js +1 -1
  26. package/dist/components/docs/architecture/ArchitectureControlPlanePage.d.ts +1 -0
  27. package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +204 -0
  28. package/dist/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
  29. package/dist/components/docs/architecture/index.d.ts +1 -0
  30. package/dist/components/docs/architecture/index.js +507 -289
  31. package/dist/components/docs/ecosystem/IntegrationsPage.js +6 -3
  32. package/dist/components/docs/ecosystem/PluginsPage.js +98 -98
  33. package/dist/components/docs/ecosystem/RegistryPage.js +39 -42
  34. package/dist/components/docs/ecosystem/TemplatesPage.js +26 -21
  35. package/dist/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
  36. package/dist/components/docs/ecosystem/index.js +179 -174
  37. package/dist/components/docs/index.js +6795 -5376
  38. package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
  39. package/dist/components/docs/integrations/IntegrationsGithubPage.d.ts +1 -0
  40. package/dist/components/docs/integrations/IntegrationsGithubPage.js +155 -0
  41. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.d.ts +1 -0
  42. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +168 -0
  43. package/dist/components/docs/integrations/IntegrationsMistralPage.d.ts +1 -0
  44. package/dist/components/docs/integrations/IntegrationsMistralPage.js +203 -0
  45. package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  46. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
  47. package/dist/components/docs/integrations/IntegrationsSlackPage.d.ts +1 -0
  48. package/dist/components/docs/integrations/IntegrationsSlackPage.js +161 -0
  49. package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
  50. package/dist/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
  51. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.d.ts +1 -0
  52. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +157 -0
  53. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.d.ts +1 -0
  54. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +165 -0
  55. package/dist/components/docs/integrations/index.d.ts +6 -0
  56. package/dist/components/docs/integrations/index.js +1688 -492
  57. package/dist/index.js +8016 -6597
  58. package/dist/node/application/context-storage/index.js +28 -0
  59. package/dist/node/application/index.js +662 -2
  60. package/dist/node/application/mcp/cliMcp.js +12 -2
  61. package/dist/node/application/mcp/common.js +12 -2
  62. package/dist/node/application/mcp/contractsMcp.js +530 -0
  63. package/dist/node/application/mcp/contractsMcpResources.js +123 -0
  64. package/dist/node/application/mcp/contractsMcpTools.js +199 -0
  65. package/dist/node/application/mcp/contractsMcpTypes.js +0 -0
  66. package/dist/node/application/mcp/docsMcp.js +12 -2
  67. package/dist/node/application/mcp/index.js +635 -2
  68. package/dist/node/application/mcp/internalMcp.js +12 -2
  69. package/dist/node/application/mcp/providerRankingMcp.js +493 -0
  70. package/dist/node/components/docs/DocsIndexPage.js +1 -1
  71. package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +203 -0
  72. package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
  73. package/dist/node/components/docs/architecture/index.js +507 -289
  74. package/dist/node/components/docs/ecosystem/IntegrationsPage.js +6 -3
  75. package/dist/node/components/docs/ecosystem/PluginsPage.js +98 -98
  76. package/dist/node/components/docs/ecosystem/RegistryPage.js +39 -42
  77. package/dist/node/components/docs/ecosystem/TemplatesPage.js +26 -21
  78. package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
  79. package/dist/node/components/docs/ecosystem/index.js +179 -174
  80. package/dist/node/components/docs/index.js +6795 -5376
  81. package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
  82. package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +154 -0
  83. package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +167 -0
  84. package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +202 -0
  85. package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
  86. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
  87. package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +160 -0
  88. package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
  89. package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
  90. package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +156 -0
  91. package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +164 -0
  92. package/dist/node/components/docs/integrations/index.js +1688 -492
  93. package/dist/node/index.js +8016 -6597
  94. package/package.json +195 -25
  95. package/src/application/context-storage/index.ts +58 -0
  96. package/src/application/index.ts +1 -0
  97. package/src/application/mcp/common.ts +28 -1
  98. package/src/application/mcp/contractsMcp.ts +34 -0
  99. package/src/application/mcp/contractsMcpResources.ts +142 -0
  100. package/src/application/mcp/contractsMcpTools.ts +246 -0
  101. package/src/application/mcp/contractsMcpTypes.ts +47 -0
  102. package/src/application/mcp/index.ts +2 -0
  103. package/src/application/mcp/providerRankingMcp.ts +380 -0
  104. package/src/components/docs/DocsIndexPage.tsx +2 -1
  105. package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +136 -0
  106. package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +13 -1
  107. package/src/components/docs/architecture/index.ts +1 -0
  108. package/src/components/docs/ecosystem/IntegrationsPage.tsx +4 -3
  109. package/src/components/docs/ecosystem/PluginsPage.tsx +68 -87
  110. package/src/components/docs/ecosystem/RegistryPage.tsx +35 -43
  111. package/src/components/docs/ecosystem/TemplatesPage.tsx +28 -21
  112. package/src/components/docs/ecosystem/ecosystem.docblocks.ts +12 -10
  113. package/src/components/docs/generated/docs-index._common.json +1119 -1
  114. package/src/components/docs/generated/docs-index.health.json +98 -0
  115. package/src/components/docs/generated/docs-index.manifest.json +15 -5
  116. package/src/components/docs/generated/docs-index.metrics.json +8 -0
  117. package/src/components/docs/generated/docs-index.platform-integrations.json +89 -1
  118. package/src/components/docs/generated/docs-index.video-api-showcase.json +26 -0
  119. package/src/components/docs/integrations/IntegrationsElevenLabsPage.tsx +2 -2
  120. package/src/components/docs/integrations/IntegrationsGithubPage.tsx +90 -0
  121. package/src/components/docs/integrations/IntegrationsHealthRoutingPage.tsx +112 -0
  122. package/src/components/docs/integrations/IntegrationsMistralPage.tsx +133 -0
  123. package/src/components/docs/integrations/IntegrationsOpenAIPage.tsx +2 -2
  124. package/src/components/docs/integrations/IntegrationsOverviewPage.tsx +108 -9
  125. package/src/components/docs/integrations/IntegrationsSlackPage.tsx +98 -0
  126. package/src/components/docs/integrations/IntegrationsSpecModelPage.tsx +59 -0
  127. package/src/components/docs/integrations/IntegrationsTwilioPage.tsx +2 -2
  128. package/src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx +90 -0
  129. package/src/components/docs/integrations/IntegrationsWhatsappTwilioPage.tsx +92 -0
  130. package/src/components/docs/integrations/index.ts +6 -0
@@ -103,15 +103,22 @@ function IntegrationsOverviewPage() {
103
103
  children: /* @__PURE__ */ jsxDEV("pre", {
104
104
  children: `type IntegrationCategory =
105
105
  | "payments" // Stripe
106
+ | "open-banking" // Powens
106
107
  | "email" // Postmark, Resend, Gmail
107
108
  | "calendar" // Google Calendar
108
109
  | "sms" // Twilio
109
- | "ai-llm" // OpenAI
110
- | "ai-voice" // ElevenLabs
111
- | "speech-to-text" // OpenAI Whisper
110
+ | "messaging" // Slack, GitHub, WhatsApp
111
+ | "health" // Whoop, Oura, Strava, Fitbit
112
+ | "ai-llm" // OpenAI, Mistral
113
+ | "ai-voice-tts" // ElevenLabs
114
+ | "ai-voice-stt" // OpenAI Whisper, Mistral Voxtral
115
+ | "ai-voice-conversational" // OpenAI Realtime, Mistral Voice
116
+ | "ai-image" // OpenAI Image, Fal
112
117
  | "vector-db" // Qdrant
118
+ | "database" // Supabase Postgres
113
119
  | "storage" // S3-compatible
114
- | "open-banking" // Powens (read-only)
120
+ | "meeting-recorder" // Fireflies, tl;dv
121
+ | "project-management" // Linear, Jira, Notion
115
122
  | "accounting" // Coming soon
116
123
  | "crm" // Coming soon
117
124
  | "helpdesk" // Coming soon
@@ -288,6 +295,20 @@ function IntegrationsOverviewPage() {
288
295
  }, undefined, false, undefined, this)
289
296
  ]
290
297
  }, undefined, true, undefined, this),
298
+ /* @__PURE__ */ jsxDEV(Link, {
299
+ href: "/docs/integrations/mistral",
300
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
301
+ children: [
302
+ /* @__PURE__ */ jsxDEV("h4", {
303
+ className: "font-bold transition-colors group-hover:text-violet-400",
304
+ children: "Mistral"
305
+ }, undefined, false, undefined, this),
306
+ /* @__PURE__ */ jsxDEV("p", {
307
+ className: "text-muted-foreground mt-1 text-sm",
308
+ children: "LLMs, embeddings, Voxtral STT, and conversational voice"
309
+ }, undefined, false, undefined, this)
310
+ ]
311
+ }, undefined, true, undefined, this),
291
312
  /* @__PURE__ */ jsxDEV(Link, {
292
313
  href: "/docs/integrations/elevenlabs",
293
314
  className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
@@ -351,7 +372,7 @@ function IntegrationsOverviewPage() {
351
372
  children: [
352
373
  /* @__PURE__ */ jsxDEV("h3", {
353
374
  className: "text-xl font-semibold",
354
- children: "SMS & Messaging"
375
+ children: "SMS"
355
376
  }, undefined, false, undefined, this),
356
377
  /* @__PURE__ */ jsxDEV("div", {
357
378
  className: "grid gap-4 md:grid-cols-2",
@@ -365,7 +386,103 @@ function IntegrationsOverviewPage() {
365
386
  }, undefined, false, undefined, this),
366
387
  /* @__PURE__ */ jsxDEV("p", {
367
388
  className: "text-muted-foreground mt-1 text-sm",
368
- children: "SMS notifications and messaging"
389
+ children: "SMS notifications and transactional messaging"
390
+ }, undefined, false, undefined, this)
391
+ ]
392
+ }, undefined, true, undefined, this)
393
+ }, undefined, false, undefined, this)
394
+ ]
395
+ }, undefined, true, undefined, this),
396
+ /* @__PURE__ */ jsxDEV("div", {
397
+ className: "space-y-3",
398
+ children: [
399
+ /* @__PURE__ */ jsxDEV("h3", {
400
+ className: "text-xl font-semibold",
401
+ children: "Messaging channels"
402
+ }, undefined, false, undefined, this),
403
+ /* @__PURE__ */ jsxDEV("div", {
404
+ className: "grid gap-4 md:grid-cols-2",
405
+ children: [
406
+ /* @__PURE__ */ jsxDEV(Link, {
407
+ href: "/docs/integrations/slack",
408
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
409
+ children: [
410
+ /* @__PURE__ */ jsxDEV("h4", {
411
+ className: "font-bold transition-colors group-hover:text-violet-400",
412
+ children: "Slack"
413
+ }, undefined, false, undefined, this),
414
+ /* @__PURE__ */ jsxDEV("p", {
415
+ className: "text-muted-foreground mt-1 text-sm",
416
+ children: "Signed event ingestion and outbox-backed replies"
417
+ }, undefined, false, undefined, this)
418
+ ]
419
+ }, undefined, true, undefined, this),
420
+ /* @__PURE__ */ jsxDEV(Link, {
421
+ href: "/docs/integrations/github",
422
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
423
+ children: [
424
+ /* @__PURE__ */ jsxDEV("h4", {
425
+ className: "font-bold transition-colors group-hover:text-violet-400",
426
+ children: "GitHub"
427
+ }, undefined, false, undefined, this),
428
+ /* @__PURE__ */ jsxDEV("p", {
429
+ className: "text-muted-foreground mt-1 text-sm",
430
+ children: "Issue and PR comment workflows with webhook verification"
431
+ }, undefined, false, undefined, this)
432
+ ]
433
+ }, undefined, true, undefined, this),
434
+ /* @__PURE__ */ jsxDEV(Link, {
435
+ href: "/docs/integrations/whatsapp-meta",
436
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
437
+ children: [
438
+ /* @__PURE__ */ jsxDEV("h4", {
439
+ className: "font-bold transition-colors group-hover:text-violet-400",
440
+ children: "WhatsApp Meta"
441
+ }, undefined, false, undefined, this),
442
+ /* @__PURE__ */ jsxDEV("p", {
443
+ className: "text-muted-foreground mt-1 text-sm",
444
+ children: "Primary WhatsApp Business API transport for inbound and outbound"
445
+ }, undefined, false, undefined, this)
446
+ ]
447
+ }, undefined, true, undefined, this),
448
+ /* @__PURE__ */ jsxDEV(Link, {
449
+ href: "/docs/integrations/whatsapp-twilio",
450
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
451
+ children: [
452
+ /* @__PURE__ */ jsxDEV("h4", {
453
+ className: "font-bold transition-colors group-hover:text-violet-400",
454
+ children: "WhatsApp Twilio"
455
+ }, undefined, false, undefined, this),
456
+ /* @__PURE__ */ jsxDEV("p", {
457
+ className: "text-muted-foreground mt-1 text-sm",
458
+ children: "Fallback WhatsApp route with Twilio signature validation"
459
+ }, undefined, false, undefined, this)
460
+ ]
461
+ }, undefined, true, undefined, this)
462
+ ]
463
+ }, undefined, true, undefined, this)
464
+ ]
465
+ }, undefined, true, undefined, this),
466
+ /* @__PURE__ */ jsxDEV("div", {
467
+ className: "space-y-3",
468
+ children: [
469
+ /* @__PURE__ */ jsxDEV("h3", {
470
+ className: "text-xl font-semibold",
471
+ children: "Health & wearables"
472
+ }, undefined, false, undefined, this),
473
+ /* @__PURE__ */ jsxDEV("div", {
474
+ className: "grid gap-4 md:grid-cols-2",
475
+ children: /* @__PURE__ */ jsxDEV(Link, {
476
+ href: "/docs/integrations/health-routing",
477
+ className: "card-subtle group p-4 transition-colors hover:border-violet-500/50",
478
+ children: [
479
+ /* @__PURE__ */ jsxDEV("h4", {
480
+ className: "font-bold transition-colors group-hover:text-violet-400",
481
+ children: "Health routing strategy"
482
+ }, undefined, false, undefined, this),
483
+ /* @__PURE__ */ jsxDEV("p", {
484
+ className: "text-muted-foreground mt-1 text-sm",
485
+ children: "Official vs aggregator transport order, unofficial gating, and OAuth refresh config"
369
486
  }, undefined, false, undefined, this)
370
487
  ]
371
488
  }, undefined, true, undefined, this)
@@ -558,6 +675,8 @@ POSTMARK_FROM_EMAIL=noreply@example.com
558
675
  OPENAI_API_KEY=sk-...
559
676
  OPENAI_ORGANIZATION=org-...
560
677
 
678
+ MISTRAL_API_KEY=...
679
+
561
680
  QDRANT_URL=https://...
562
681
  QDRANT_API_KEY=...
563
682
 
@@ -590,14 +709,22 @@ STRIPE_SECRET_OVERRIDE=env://STRIPE_SECRET_KEY`
590
709
  children: /* @__PURE__ */ jsxDEV("pre", {
591
710
  children: `type IntegrationCategory =
592
711
  | "payments" // Stripe, PayPal, etc.
712
+ | "open-banking" // Powens and open banking providers
593
713
  | "email" // Postmark, Resend, Gmail
594
714
  | "calendar" // Google Calendar, Outlook
595
715
  | "sms" // Twilio, MessageBird
596
- | "ai-llm" // OpenAI, Anthropic, Cohere
597
- | "ai-voice" // ElevenLabs, Google TTS
598
- | "speech-to-text" // OpenAI Whisper, Google STT
716
+ | "messaging" // Slack, GitHub, WhatsApp
717
+ | "health" // Whoop, Oura, Strava, Fitbit
718
+ | "ai-llm" // OpenAI, Anthropic, Cohere, Mistral
719
+ | "ai-voice-tts" // ElevenLabs, Google TTS
720
+ | "ai-voice-stt" // OpenAI Whisper, Google STT, Mistral Voxtral
721
+ | "ai-voice-conversational" // OpenAI Realtime, Mistral Voice
722
+ | "ai-image" // OpenAI Image, Fal
599
723
  | "vector-db" // Qdrant, Pinecone, Weaviate
724
+ | "database" // Supabase, Postgres
600
725
  | "storage" // S3, GCS, Azure Blob
726
+ | "meeting-recorder" // Fireflies, tl;dv, Granola
727
+ | "project-management" // Linear, Jira, Notion
601
728
  | "accounting" // QuickBooks, Xero (coming soon)
602
729
  | "crm" // Salesforce, HubSpot (coming soon)
603
730
  | "helpdesk" // Zendesk, Intercom (coming soon)
@@ -0,0 +1,160 @@
1
+ // src/components/docs/integrations/IntegrationsSlackPage.tsx
2
+ import Link from "@contractspec/lib.ui-link";
3
+ import { ChevronRight } from "lucide-react";
4
+ import { jsxDEV } from "react/jsx-dev-runtime";
5
+ function IntegrationsSlackPage() {
6
+ return /* @__PURE__ */ jsxDEV("div", {
7
+ className: "space-y-8",
8
+ children: [
9
+ /* @__PURE__ */ jsxDEV("div", {
10
+ className: "space-y-4",
11
+ children: [
12
+ /* @__PURE__ */ jsxDEV("h1", {
13
+ className: "text-4xl font-bold",
14
+ children: "Slack Messaging"
15
+ }, undefined, false, undefined, this),
16
+ /* @__PURE__ */ jsxDEV("p", {
17
+ className: "text-muted-foreground",
18
+ children: "ContractSpec supports signed Slack event ingestion and outbox-backed outbound replies through the channel runtime."
19
+ }, undefined, false, undefined, this)
20
+ ]
21
+ }, undefined, true, undefined, this),
22
+ /* @__PURE__ */ jsxDEV("div", {
23
+ className: "space-y-4",
24
+ children: [
25
+ /* @__PURE__ */ jsxDEV("h2", {
26
+ className: "text-2xl font-bold",
27
+ children: "Required secrets and config"
28
+ }, undefined, false, undefined, this),
29
+ /* @__PURE__ */ jsxDEV("div", {
30
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
31
+ children: /* @__PURE__ */ jsxDEV("pre", {
32
+ children: `// secret payload
33
+ {
34
+ "botToken": "xoxb-...",
35
+ "signingSecret": "..."
36
+ }
37
+
38
+ // optional connection config
39
+ {
40
+ "defaultChannelId": "C0123456789",
41
+ "apiBaseUrl": "https://slack.com/api"
42
+ }`
43
+ }, undefined, false, undefined, this)
44
+ }, undefined, false, undefined, this)
45
+ ]
46
+ }, undefined, true, undefined, this),
47
+ /* @__PURE__ */ jsxDEV("div", {
48
+ className: "space-y-4",
49
+ children: [
50
+ /* @__PURE__ */ jsxDEV("h2", {
51
+ className: "text-2xl font-bold",
52
+ children: "Webhook ingress"
53
+ }, undefined, false, undefined, this),
54
+ /* @__PURE__ */ jsxDEV("ul", {
55
+ className: "text-muted-foreground list-inside list-disc space-y-2",
56
+ children: [
57
+ /* @__PURE__ */ jsxDEV("li", {
58
+ children: [
59
+ "Inbound events are accepted on",
60
+ " ",
61
+ /* @__PURE__ */ jsxDEV("code", {
62
+ className: "bg-background/50 rounded px-2 py-1",
63
+ children: "/webhooks/slack/events"
64
+ }, undefined, false, undefined, this),
65
+ "."
66
+ ]
67
+ }, undefined, true, undefined, this),
68
+ /* @__PURE__ */ jsxDEV("li", {
69
+ children: [
70
+ "Requests are validated with Slack signatures (",
71
+ /* @__PURE__ */ jsxDEV("code", {
72
+ className: "bg-background/50 rounded px-2 py-1",
73
+ children: "x-slack-signature"
74
+ }, undefined, false, undefined, this),
75
+ " ",
76
+ "+ timestamp tolerance)."
77
+ ]
78
+ }, undefined, true, undefined, this),
79
+ /* @__PURE__ */ jsxDEV("li", {
80
+ children: "Normalized events are deduplicated and persisted before any outbound side effects."
81
+ }, undefined, false, undefined, this)
82
+ ]
83
+ }, undefined, true, undefined, this)
84
+ ]
85
+ }, undefined, true, undefined, this),
86
+ /* @__PURE__ */ jsxDEV("div", {
87
+ className: "space-y-4",
88
+ children: [
89
+ /* @__PURE__ */ jsxDEV("h2", {
90
+ className: "text-2xl font-bold",
91
+ children: "Workspace routing and dispatch"
92
+ }, undefined, false, undefined, this),
93
+ /* @__PURE__ */ jsxDEV("div", {
94
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
95
+ children: /* @__PURE__ */ jsxDEV("pre", {
96
+ children: `# Workspace mapping (recommended)
97
+ CHANNEL_WORKSPACE_MAP_SLACK={"T123":"workspace-acme"}
98
+
99
+ # Dispatch protection
100
+ CHANNEL_DISPATCH_TOKEN=...
101
+
102
+ # Optional scheduler
103
+ CHANNEL_DISPATCH_INTERVAL_MS=120000
104
+ CHANNEL_DISPATCH_RUN_ON_START=1`
105
+ }, undefined, false, undefined, this)
106
+ }, undefined, false, undefined, this)
107
+ ]
108
+ }, undefined, true, undefined, this),
109
+ /* @__PURE__ */ jsxDEV("div", {
110
+ className: "space-y-4",
111
+ children: [
112
+ /* @__PURE__ */ jsxDEV("h2", {
113
+ className: "text-2xl font-bold",
114
+ children: "Best practices"
115
+ }, undefined, false, undefined, this),
116
+ /* @__PURE__ */ jsxDEV("ul", {
117
+ className: "text-muted-foreground list-inside list-disc space-y-2",
118
+ children: [
119
+ /* @__PURE__ */ jsxDEV("li", {
120
+ children: "Keep bot tokens and signing secrets in a managed secret provider."
121
+ }, undefined, false, undefined, this),
122
+ /* @__PURE__ */ jsxDEV("li", {
123
+ children: "Use workspace mapping to prevent cross-tenant event leakage."
124
+ }, undefined, false, undefined, this),
125
+ /* @__PURE__ */ jsxDEV("li", {
126
+ children: "Keep dispatch asynchronous so webhook handlers stay fast and reliable."
127
+ }, undefined, false, undefined, this),
128
+ /* @__PURE__ */ jsxDEV("li", {
129
+ children: "Monitor telemetry for ingest, decision, outbox, and dispatch stages."
130
+ }, undefined, false, undefined, this)
131
+ ]
132
+ }, undefined, true, undefined, this)
133
+ ]
134
+ }, undefined, true, undefined, this),
135
+ /* @__PURE__ */ jsxDEV("div", {
136
+ className: "flex items-center gap-4 pt-4",
137
+ children: [
138
+ /* @__PURE__ */ jsxDEV(Link, {
139
+ href: "/docs/integrations/twilio",
140
+ className: "btn-ghost",
141
+ children: "Previous: Twilio SMS"
142
+ }, undefined, false, undefined, this),
143
+ /* @__PURE__ */ jsxDEV(Link, {
144
+ href: "/docs/integrations/github",
145
+ className: "btn-primary",
146
+ children: [
147
+ "Next: GitHub Messaging ",
148
+ /* @__PURE__ */ jsxDEV(ChevronRight, {
149
+ size: 16
150
+ }, undefined, false, undefined, this)
151
+ ]
152
+ }, undefined, true, undefined, this)
153
+ ]
154
+ }, undefined, true, undefined, this)
155
+ ]
156
+ }, undefined, true, undefined, this);
157
+ }
158
+ export {
159
+ IntegrationsSlackPage
160
+ };
@@ -270,6 +270,78 @@ function IntegrationsSpecModelPage() {
270
270
  createdAt: "2025-01-01T00:00:00Z",
271
271
  updatedAt: "2025-01-15T10:25:00Z",
272
272
  createdBy: "dev@acme.com"
273
+ }`
274
+ }, undefined, false, undefined, this)
275
+ }, undefined, false, undefined, this)
276
+ ]
277
+ }, undefined, true, undefined, this),
278
+ /* @__PURE__ */ jsxDEV("div", {
279
+ className: "space-y-4",
280
+ children: [
281
+ /* @__PURE__ */ jsxDEV("h2", {
282
+ className: "text-2xl font-bold",
283
+ children: "Example: Messaging IntegrationConnection"
284
+ }, undefined, false, undefined, this),
285
+ /* @__PURE__ */ jsxDEV("p", {
286
+ className: "text-muted-foreground",
287
+ children: "Messaging providers use the same spec + connection model, then route inbound events through the channel runtime for signature validation, idempotent ingestion, policy decisions, and outbox-backed dispatch."
288
+ }, undefined, false, undefined, this),
289
+ /* @__PURE__ */ jsxDEV("div", {
290
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
291
+ children: /* @__PURE__ */ jsxDEV("pre", {
292
+ children: `{
293
+ id: "conn_slack_acme_prod",
294
+ tenantId: "acme-corp",
295
+ integrationId: "messaging.slack",
296
+ environment: "production",
297
+ config: {
298
+ defaultChannelId: "C0123456789",
299
+ apiBaseUrl: "https://slack.com/api"
300
+ },
301
+ secretRef: "secret_slack_acme_prod_v1",
302
+ status: "connected"
303
+ }
304
+
305
+ // secret payload behind secretRef
306
+ {
307
+ "botToken": "xoxb-...",
308
+ "signingSecret": "..."
309
+ }`
310
+ }, undefined, false, undefined, this)
311
+ }, undefined, false, undefined, this)
312
+ ]
313
+ }, undefined, true, undefined, this),
314
+ /* @__PURE__ */ jsxDEV("div", {
315
+ className: "space-y-4",
316
+ children: [
317
+ /* @__PURE__ */ jsxDEV("h2", {
318
+ className: "text-2xl font-bold",
319
+ children: "Health transport strategy config"
320
+ }, undefined, false, undefined, this),
321
+ /* @__PURE__ */ jsxDEV("p", {
322
+ className: "text-muted-foreground",
323
+ children: "Health providers support deterministic transport routing and explicit unofficial gating in connection config."
324
+ }, undefined, false, undefined, this),
325
+ /* @__PURE__ */ jsxDEV("div", {
326
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
327
+ children: /* @__PURE__ */ jsxDEV("pre", {
328
+ children: `{
329
+ "defaultTransport": "official-api",
330
+ "strategyOrder": ["official-api", "aggregator-api", "unofficial"],
331
+ "allowUnofficial": false,
332
+ "unofficialAllowList": ["health.peloton"],
333
+ "mcpUrl": "https://mcp.provider.example",
334
+ "oauthTokenUrl": "https://api.provider.example/oauth/token"
335
+ }
336
+
337
+ // secret payload behind secretRef
338
+ {
339
+ "accessToken": "...",
340
+ "refreshToken": "...",
341
+ "clientId": "...",
342
+ "clientSecret": "...",
343
+ "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
344
+ "mcpAccessToken": "..."
273
345
  }`
274
346
  }, undefined, false, undefined, this)
275
347
  }, undefined, false, undefined, this)
@@ -132,9 +132,9 @@ outputs:
132
132
  children: "Previous: S3 Storage"
133
133
  }, undefined, false, undefined, this),
134
134
  /* @__PURE__ */ jsxDEV(Link, {
135
- href: "/docs/integrations",
135
+ href: "/docs/integrations/slack",
136
136
  className: "btn-primary",
137
- children: "Back to Integrations"
137
+ children: "Next: Slack Messaging"
138
138
  }, undefined, false, undefined, this)
139
139
  ]
140
140
  }, undefined, true, undefined, this)
@@ -0,0 +1,156 @@
1
+ // src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx
2
+ import Link from "@contractspec/lib.ui-link";
3
+ import { ChevronRight } from "lucide-react";
4
+ import { jsxDEV } from "react/jsx-dev-runtime";
5
+ function IntegrationsWhatsappMetaPage() {
6
+ return /* @__PURE__ */ jsxDEV("div", {
7
+ className: "space-y-8",
8
+ children: [
9
+ /* @__PURE__ */ jsxDEV("div", {
10
+ className: "space-y-4",
11
+ children: [
12
+ /* @__PURE__ */ jsxDEV("h1", {
13
+ className: "text-4xl font-bold",
14
+ children: "WhatsApp Meta"
15
+ }, undefined, false, undefined, this),
16
+ /* @__PURE__ */ jsxDEV("p", {
17
+ className: "text-muted-foreground",
18
+ children: "Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."
19
+ }, undefined, false, undefined, this)
20
+ ]
21
+ }, undefined, true, undefined, this),
22
+ /* @__PURE__ */ jsxDEV("div", {
23
+ className: "space-y-4",
24
+ children: [
25
+ /* @__PURE__ */ jsxDEV("h2", {
26
+ className: "text-2xl font-bold",
27
+ children: "Required secrets and config"
28
+ }, undefined, false, undefined, this),
29
+ /* @__PURE__ */ jsxDEV("div", {
30
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
31
+ children: /* @__PURE__ */ jsxDEV("pre", {
32
+ children: `// secret payload
33
+ {
34
+ "accessToken": "...",
35
+ "appSecret": "...",
36
+ "verifyToken": "..."
37
+ }
38
+
39
+ // required connection config
40
+ {
41
+ "phoneNumberId": "120000000001",
42
+ "apiVersion": "v22.0"
43
+ }`
44
+ }, undefined, false, undefined, this)
45
+ }, undefined, false, undefined, this)
46
+ ]
47
+ }, undefined, true, undefined, this),
48
+ /* @__PURE__ */ jsxDEV("div", {
49
+ className: "space-y-4",
50
+ children: [
51
+ /* @__PURE__ */ jsxDEV("h2", {
52
+ className: "text-2xl font-bold",
53
+ children: "Webhook endpoints"
54
+ }, undefined, false, undefined, this),
55
+ /* @__PURE__ */ jsxDEV("ul", {
56
+ className: "text-muted-foreground list-inside list-disc space-y-2",
57
+ children: [
58
+ /* @__PURE__ */ jsxDEV("li", {
59
+ children: [
60
+ "Verification challenge:",
61
+ " ",
62
+ /* @__PURE__ */ jsxDEV("code", {
63
+ className: "bg-background/50 rounded px-2 py-1",
64
+ children: "GET /webhooks/whatsapp/meta"
65
+ }, undefined, false, undefined, this)
66
+ ]
67
+ }, undefined, true, undefined, this),
68
+ /* @__PURE__ */ jsxDEV("li", {
69
+ children: [
70
+ "Inbound messages:",
71
+ " ",
72
+ /* @__PURE__ */ jsxDEV("code", {
73
+ className: "bg-background/50 rounded px-2 py-1",
74
+ children: "POST /webhooks/whatsapp/meta"
75
+ }, undefined, false, undefined, this)
76
+ ]
77
+ }, undefined, true, undefined, this),
78
+ /* @__PURE__ */ jsxDEV("li", {
79
+ children: [
80
+ "Signatures are validated with",
81
+ " ",
82
+ /* @__PURE__ */ jsxDEV("code", {
83
+ className: "bg-background/50 rounded px-2 py-1",
84
+ children: "x-hub-signature-256"
85
+ }, undefined, false, undefined, this),
86
+ "."
87
+ ]
88
+ }, undefined, true, undefined, this)
89
+ ]
90
+ }, undefined, true, undefined, this)
91
+ ]
92
+ }, undefined, true, undefined, this),
93
+ /* @__PURE__ */ jsxDEV("div", {
94
+ className: "space-y-4",
95
+ children: [
96
+ /* @__PURE__ */ jsxDEV("h2", {
97
+ className: "text-2xl font-bold",
98
+ children: "Workspace mapping"
99
+ }, undefined, false, undefined, this),
100
+ /* @__PURE__ */ jsxDEV("div", {
101
+ className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
102
+ children: /* @__PURE__ */ jsxDEV("pre", {
103
+ children: `CHANNEL_WORKSPACE_MAP_WHATSAPP_META={"120000000001":"workspace-acme"}`
104
+ }, undefined, false, undefined, this)
105
+ }, undefined, false, undefined, this)
106
+ ]
107
+ }, undefined, true, undefined, this),
108
+ /* @__PURE__ */ jsxDEV("div", {
109
+ className: "space-y-4",
110
+ children: [
111
+ /* @__PURE__ */ jsxDEV("h2", {
112
+ className: "text-2xl font-bold",
113
+ children: "Best practices"
114
+ }, undefined, false, undefined, this),
115
+ /* @__PURE__ */ jsxDEV("ul", {
116
+ className: "text-muted-foreground list-inside list-disc space-y-2",
117
+ children: [
118
+ /* @__PURE__ */ jsxDEV("li", {
119
+ children: "Keep verify and app secrets separate from access tokens."
120
+ }, undefined, false, undefined, this),
121
+ /* @__PURE__ */ jsxDEV("li", {
122
+ children: "Map each phone number ID to a workspace for strict tenant routing."
123
+ }, undefined, false, undefined, this),
124
+ /* @__PURE__ */ jsxDEV("li", {
125
+ children: "Use Twilio WhatsApp only as fallback when you need active-passive routing."
126
+ }, undefined, false, undefined, this)
127
+ ]
128
+ }, undefined, true, undefined, this)
129
+ ]
130
+ }, undefined, true, undefined, this),
131
+ /* @__PURE__ */ jsxDEV("div", {
132
+ className: "flex items-center gap-4 pt-4",
133
+ children: [
134
+ /* @__PURE__ */ jsxDEV(Link, {
135
+ href: "/docs/integrations/github",
136
+ className: "btn-ghost",
137
+ children: "Previous: GitHub Messaging"
138
+ }, undefined, false, undefined, this),
139
+ /* @__PURE__ */ jsxDEV(Link, {
140
+ href: "/docs/integrations/whatsapp-twilio",
141
+ className: "btn-primary",
142
+ children: [
143
+ "Next: WhatsApp Twilio ",
144
+ /* @__PURE__ */ jsxDEV(ChevronRight, {
145
+ size: 16
146
+ }, undefined, false, undefined, this)
147
+ ]
148
+ }, undefined, true, undefined, this)
149
+ ]
150
+ }, undefined, true, undefined, this)
151
+ ]
152
+ }, undefined, true, undefined, this);
153
+ }
154
+ export {
155
+ IntegrationsWhatsappMetaPage
156
+ };