@contractspec/bundle.library 3.10.0 → 3.10.2

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 (60) hide show
  1. package/.turbo/turbo-build.log +212 -206
  2. package/CHANGELOG.md +43 -0
  3. package/dist/components/docs/DocsIndexPage.js +2 -2
  4. package/dist/components/docs/docsManifest.js +1 -1
  5. package/dist/components/docs/guides/GuideProviderBackedKnowledgePage.d.ts +1 -0
  6. package/dist/components/docs/guides/GuideProviderBackedKnowledgePage.js +73 -0
  7. package/dist/components/docs/guides/GuidesIndexPage.js +1 -1
  8. package/dist/components/docs/guides/guides.docblocks.js +10 -1
  9. package/dist/components/docs/guides/index.d.ts +1 -0
  10. package/dist/components/docs/guides/index.js +132 -52
  11. package/dist/components/docs/index.js +414 -284
  12. package/dist/components/docs/integrations/IntegrationsGmailPage.js +3 -3
  13. package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +1 -1
  14. package/dist/components/docs/integrations/IntegrationsGoogleDrivePage.d.ts +1 -0
  15. package/dist/components/docs/integrations/IntegrationsGoogleDrivePage.js +22 -0
  16. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +1 -1
  17. package/dist/components/docs/integrations/index.d.ts +1 -0
  18. package/dist/components/docs/integrations/index.js +65 -45
  19. package/dist/components/docs/knowledge/KnowledgeGovernancePage.d.ts +1 -0
  20. package/dist/components/docs/knowledge/KnowledgeGovernancePage.js +23 -0
  21. package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +1 -1
  22. package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +11 -2
  23. package/dist/components/docs/knowledge/index.d.ts +1 -0
  24. package/dist/components/docs/knowledge/index.js +49 -19
  25. package/dist/index.js +430 -300
  26. package/dist/node/components/docs/DocsIndexPage.js +2 -2
  27. package/dist/node/components/docs/docsManifest.js +1 -1
  28. package/dist/node/components/docs/guides/GuideProviderBackedKnowledgePage.js +72 -0
  29. package/dist/node/components/docs/guides/GuidesIndexPage.js +1 -1
  30. package/dist/node/components/docs/guides/guides.docblocks.js +10 -1
  31. package/dist/node/components/docs/guides/index.js +132 -52
  32. package/dist/node/components/docs/index.js +414 -284
  33. package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +3 -3
  34. package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +1 -1
  35. package/dist/node/components/docs/integrations/IntegrationsGoogleDrivePage.js +21 -0
  36. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +1 -1
  37. package/dist/node/components/docs/integrations/index.js +65 -45
  38. package/dist/node/components/docs/knowledge/KnowledgeGovernancePage.js +22 -0
  39. package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +1 -1
  40. package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +11 -2
  41. package/dist/node/components/docs/knowledge/index.js +49 -19
  42. package/dist/node/index.js +430 -300
  43. package/package.json +59 -23
  44. package/src/components/docs/docsManifest.ts +62 -0
  45. package/src/components/docs/generated/docs-index._common.json +32 -0
  46. package/src/components/docs/generated/docs-index.manifest.json +2 -2
  47. package/src/components/docs/generated/docs-index.notifications.json +7 -7
  48. package/src/components/docs/guides/GuideProviderBackedKnowledgePage.tsx +191 -0
  49. package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
  50. package/src/components/docs/guides/guides.docblocks.ts +20 -0
  51. package/src/components/docs/guides/index.ts +1 -0
  52. package/src/components/docs/integrations/IntegrationsGmailPage.tsx +23 -2
  53. package/src/components/docs/integrations/IntegrationsGoogleCalendarPage.tsx +2 -2
  54. package/src/components/docs/integrations/IntegrationsGoogleDrivePage.tsx +88 -0
  55. package/src/components/docs/integrations/IntegrationsOverviewPage.tsx +1 -0
  56. package/src/components/docs/integrations/index.ts +1 -0
  57. package/src/components/docs/knowledge/KnowledgeGovernancePage.tsx +94 -0
  58. package/src/components/docs/knowledge/KnowledgeOverviewPage.tsx +10 -0
  59. package/src/components/docs/knowledge/KnowledgeSourcesPage.tsx +45 -0
  60. package/src/components/docs/knowledge/index.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var ne=Object.defineProperty;var ce=(T)=>T;function pe(T,P){this[T]=ce.bind(null,P)}var Je=(T,P)=>{for(var q in P)ne(T,q,{get:P[q],enumerable:!0,configurable:!0,set:pe.bind(P,q)})};var Qe=(T,P)=>()=>(T&&(P=T(T=0)),P);import{jsx as s,jsxs as z}from"react/jsx-runtime";function me(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[s("h1",{className:"font-bold text-4xl",children:"Integration Circuit Breakers"}),s("p",{className:"text-lg text-muted-foreground",children:"External APIs are the most common source of instability. Wrap every integration call in a circuit breaker to protect your system."})]}),z("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Pattern"}),s("p",{children:"Create a dedicated circuit breaker instance for each external service. This ensures that a failure in Stripe doesn't trigger the circuit breaker for Twilio."}),s("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`// integrations/stripe.ts
2
+ var ge=Object.defineProperty;var ue=(P)=>P;function fe(P,T){this[P]=ue.bind(null,T)}var et=(P,T)=>{for(var F in T)ge(P,F,{get:T[F],enumerable:!0,configurable:!0,set:fe.bind(T,F)})};var tt=(P,T)=>()=>(P&&(T=P(P=0)),T);import{jsx as q,jsxs as V}from"react/jsx-runtime";function he(){return V("div",{className:"space-y-8",children:[V("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"Integration Circuit Breakers"}),q("p",{className:"text-lg text-muted-foreground",children:"External APIs are the most common source of instability. Wrap every integration call in a circuit breaker to protect your system."})]}),V("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Pattern"}),q("p",{children:"Create a dedicated circuit breaker instance for each external service. This ensures that a failure in Stripe doesn't trigger the circuit breaker for Twilio."}),q("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`// integrations/stripe.ts
3
3
  import { CircuitBreaker } from '@contractspec/lib.resilience/circuit-breaker';
4
4
 
5
5
  const stripeBreaker = new CircuitBreaker({
@@ -9,8 +9,8 @@ const stripeBreaker = new CircuitBreaker({
9
9
 
10
10
  export async function createCharge(amount: number) {
11
11
  return stripeBreaker.execute(() => stripe.charges.create({ amount }));
12
- }`})]})]})}import V from"@contractspec/lib.ui-link";import{ChevronRight as ue}from"lucide-react";import{jsx as k,jsxs as L}from"react/jsx-runtime";function ge(){return L("div",{className:"space-y-8",children:[L("div",{className:"space-y-4",children:[k("h1",{className:"font-bold text-4xl",children:"ElevenLabs"}),k("p",{className:"text-muted-foreground",children:"ElevenLabs provides state-of-the-art text-to-speech and voice cloning technology. Create natural-sounding voiceovers, audiobooks, and voice assistants."})]}),L("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Setup"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`# .env
13
- ELEVENLABS_API_KEY=...`})})]}),L("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Text-to-Speech"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`capabilityId: elevenlabs-tts
12
+ }`})]})]})}import Y from"@contractspec/lib.ui-link";import{ChevronRight as ve}from"lucide-react";import{jsx as w,jsxs as R}from"react/jsx-runtime";function be(){return R("div",{className:"space-y-8",children:[R("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"ElevenLabs"}),w("p",{className:"text-muted-foreground",children:"ElevenLabs provides state-of-the-art text-to-speech and voice cloning technology. Create natural-sounding voiceovers, audiobooks, and voice assistants."})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Setup"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`# .env
13
+ ELEVENLABS_API_KEY=...`})})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Text-to-Speech"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`capabilityId: elevenlabs-tts
14
14
  provider:
15
15
  type: elevenlabs
16
16
  operation: textToSpeech
@@ -29,7 +29,7 @@ outputs:
29
29
  audioUrl:
30
30
  type: string
31
31
  audioData:
32
- type: buffer`})})]}),L("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Use cases"}),L("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[k("li",{children:"Generate voiceovers for videos"}),k("li",{children:"Create audio versions of articles"}),k("li",{children:"Build voice assistants"}),k("li",{children:"Produce audiobooks"})]})]}),L("div",{className:"flex items-center gap-4 pt-4",children:[k(V,{href:"/docs/integrations/mistral",className:"btn-ghost",children:"Previous: Mistral"}),L(V,{href:"/docs/integrations/qdrant",className:"btn-primary",children:["Next: Qdrant ",k(ue,{size:16})]})]})]})}import F from"@contractspec/lib.ui-link";import{ChevronRight as fe}from"lucide-react";import{jsx as g,jsxs as W}from"react/jsx-runtime";function he(){return W("div",{className:"space-y-8",children:[W("div",{className:"space-y-4",children:[g("h1",{className:"font-bold text-4xl",children:"GitHub Messaging"}),g("p",{className:"text-muted-foreground",children:"Use GitHub issue and pull request comments as an AI-native messaging channel with webhook verification, policy checks, and reliable outbound dispatch."})]}),W("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`// secret payload
32
+ type: buffer`})})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Use cases"}),R("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[w("li",{children:"Generate voiceovers for videos"}),w("li",{children:"Create audio versions of articles"}),w("li",{children:"Build voice assistants"}),w("li",{children:"Produce audiobooks"})]})]}),R("div",{className:"flex items-center gap-4 pt-4",children:[w(Y,{href:"/docs/integrations/mistral",className:"btn-ghost",children:"Previous: Mistral"}),R(Y,{href:"/docs/integrations/qdrant",className:"btn-primary",children:["Next: Qdrant ",w(ve,{size:16})]})]})]})}import Z from"@contractspec/lib.ui-link";import{ChevronRight as Ne}from"lucide-react";import{jsx as f,jsxs as _}from"react/jsx-runtime";function ye(){return _("div",{className:"space-y-8",children:[_("div",{className:"space-y-4",children:[f("h1",{className:"font-bold text-4xl",children:"GitHub Messaging"}),f("p",{className:"text-muted-foreground",children:"Use GitHub issue and pull request comments as an AI-native messaging channel with webhook verification, policy checks, and reliable outbound dispatch."})]}),_("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`// secret payload
33
33
  {
34
34
  "token": "ghp_...",
35
35
  "webhookSecret": "..."
@@ -40,13 +40,13 @@ outputs:
40
40
  "defaultOwner": "lssm-tech",
41
41
  "defaultRepo": "contractspec",
42
42
  "apiBaseUrl": "https://api.github.com"
43
- }`})})]}),W("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),W("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[W("li",{children:["Inbound GitHub events are accepted on"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/github/events"}),"."]}),W("li",{children:["Signatures are checked using"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-hub-signature-256"})," ","and the configured webhook secret."]}),g("li",{children:"Current normalization focuses on issue comment workflows and durable comment dispatch."})]})]}),W("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`CHANNEL_WORKSPACE_MAP_GITHUB={"lssm-tech/contractspec":"workspace-acme"}
43
+ }`})})]}),_("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),_("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[_("li",{children:["Inbound GitHub events are accepted on"," ",f("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/github/events"}),"."]}),_("li",{children:["Signatures are checked using"," ",f("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-hub-signature-256"})," ","and the configured webhook secret."]}),f("li",{children:"Current normalization focuses on issue comment workflows and durable comment dispatch."})]})]}),_("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`CHANNEL_WORKSPACE_MAP_GITHUB={"lssm-tech/contractspec":"workspace-acme"}
44
44
 
45
45
  # Optional dev fallback (off by default)
46
- CHANNEL_ALLOW_UNMAPPED_WORKSPACE=0`})})]}),W("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Best practices"}),W("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[g("li",{children:"Use a least-privileged token scoped for comment operations."}),g("li",{children:"Route repositories explicitly with workspace maps in multi-tenant environments."}),g("li",{children:"Keep dispatch endpoints protected with token or bearer auth."})]})]}),W("div",{className:"flex items-center gap-4 pt-4",children:[g(F,{href:"/docs/integrations/slack",className:"btn-ghost",children:"Previous: Slack Messaging"}),W(F,{href:"/docs/integrations/whatsapp-meta",className:"btn-primary",children:["Next: WhatsApp Meta ",g(fe,{size:16})]})]})]})}import Y from"@contractspec/lib.ui-link";import{ChevronRight as be}from"lucide-react";import{jsx as v,jsxs as B}from"react/jsx-runtime";function ve(){return B("div",{className:"space-y-8",children:[B("div",{className:"space-y-4",children:[v("h1",{className:"font-bold text-4xl",children:"Gmail API"}),v("p",{className:"text-muted-foreground",children:"The Gmail API integration allows you to read inbound emails, manage threads, and build email-based workflows. Perfect for support tickets, email parsing, and automated responses."})]}),B("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Setup"}),v("p",{className:"text-muted-foreground",children:"Configure OAuth 2.0 credentials in Google Cloud Console:"}),v("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:v("pre",{children:`# .env
46
+ CHANNEL_ALLOW_UNMAPPED_WORKSPACE=0`})})]}),_("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Best practices"}),_("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[f("li",{children:"Use a least-privileged token scoped for comment operations."}),f("li",{children:"Route repositories explicitly with workspace maps in multi-tenant environments."}),f("li",{children:"Keep dispatch endpoints protected with token or bearer auth."})]})]}),_("div",{className:"flex items-center gap-4 pt-4",children:[f(Z,{href:"/docs/integrations/slack",className:"btn-ghost",children:"Previous: Slack Messaging"}),_(Z,{href:"/docs/integrations/whatsapp-meta",className:"btn-primary",children:["Next: WhatsApp Meta ",f(Ne,{size:16})]})]})]})}import z from"@contractspec/lib.ui-link";import{ChevronRight as ke}from"lucide-react";import{jsx as c,jsxs as S}from"react/jsx-runtime";function we(){return S("div",{className:"space-y-8",children:[S("div",{className:"space-y-4",children:[c("h1",{className:"font-bold text-4xl",children:"Gmail API"}),c("p",{className:"text-muted-foreground",children:"The Gmail API integration allows you to read inbound emails, manage threads, and build email-based workflows. Perfect for support tickets, email parsing, and automated responses."})]}),S("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Setup"}),c("p",{className:"text-muted-foreground",children:"Configure OAuth 2.0 credentials in Google Cloud Console:"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`# .env
47
47
  GOOGLE_CLIENT_ID=...
48
48
  GOOGLE_CLIENT_SECRET=...
49
- GOOGLE_REDIRECT_URI=https://your-app.com/auth/google/callback`})})]}),B("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Reading emails"}),v("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:v("pre",{children:`capabilityId: gmail-list-messages
49
+ GOOGLE_REDIRECT_URI=https://your-app.com/auth/google/callback`})})]}),S("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Reading emails"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`capabilityId: gmail-list-messages
50
50
  provider:
51
51
  type: gmail
52
52
  operation: listMessages
@@ -67,10 +67,10 @@ outputs:
67
67
  properties:
68
68
  id: string
69
69
  threadId: string
70
- snippet: string`})})]}),B("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Use cases"}),B("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[v("li",{children:"Parse support emails and create tickets"}),v("li",{children:"Extract attachments and process them"}),v("li",{children:"Build email-to-task workflows"}),v("li",{children:"Monitor specific email threads"})]})]}),B("div",{className:"flex items-center gap-4 pt-4",children:[v(Y,{href:"/docs/integrations/resend",className:"btn-ghost",children:"Previous: Resend"}),B(Y,{href:"/docs/integrations/google-calendar",className:"btn-primary",children:["Next: Google Calendar ",v(be,{size:16})]})]})]})}import Z from"@contractspec/lib.ui-link";import{ChevronRight as Ne}from"lucide-react";import{jsx as E,jsxs as D}from"react/jsx-runtime";function ye(){return D("div",{className:"space-y-8",children:[D("div",{className:"space-y-4",children:[E("h1",{className:"font-bold text-4xl",children:"Google Calendar"}),E("p",{className:"text-muted-foreground",children:"Integrate Google Calendar to schedule appointments, manage availability, and sync events with your application."})]}),D("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Setup"}),E("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:E("pre",{children:`# .env
70
+ snippet: string`})})]}),S("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Use cases"}),S("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[c("li",{children:"Parse support emails and create tickets"}),c("li",{children:"Extract attachments and process them"}),c("li",{children:"Build email-to-task workflows"}),c("li",{children:"Monitor specific email threads"}),c("li",{children:"Sync threads into governed knowledge spaces with checkpointed deltas"})]})]}),S("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Knowledge sync and mutation gates"}),S("p",{className:"text-muted-foreground",children:["Gmail supports the shared ",c("code",{children:"provider.delta.watch"})," ","capability. Knowledge runtimes should persist provider cursor, watermark, dedupe, idempotency, replay, and tombstone state before acknowledging sync work. Outbound email sends should pass through knowledge mutation governance so dry-runs, approvals, audit evidence, and outbound-send gates are recorded."]}),S("div",{className:"flex flex-wrap gap-3",children:[c(z,{href:"/docs/guides/provider-backed-knowledge",className:"btn-ghost",children:"Provider-backed knowledge guide"}),c(z,{href:"/docs/knowledge/governance",className:"btn-ghost",children:"Mutation governance"})]})]}),S("div",{className:"flex items-center gap-4 pt-4",children:[c(z,{href:"/docs/integrations/resend",className:"btn-ghost",children:"Previous: Resend"}),S(z,{href:"/docs/integrations/google-drive",className:"btn-primary",children:["Next: Google Drive ",c(ke,{size:16})]})]})]})}import J from"@contractspec/lib.ui-link";import{ChevronRight as se}from"lucide-react";import{jsx as H,jsxs as K}from"react/jsx-runtime";function Ae(){return K("div",{className:"space-y-8",children:[K("div",{className:"space-y-4",children:[H("h1",{className:"font-bold text-4xl",children:"Google Calendar"}),H("p",{className:"text-muted-foreground",children:"Integrate Google Calendar to schedule appointments, manage availability, and sync events with your application."})]}),K("div",{className:"space-y-4",children:[H("h2",{className:"font-bold text-2xl",children:"Setup"}),H("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:H("pre",{children:`# .env
71
71
  GOOGLE_CLIENT_ID=...
72
72
  GOOGLE_CLIENT_SECRET=...
73
- GOOGLE_CALENDAR_ID=primary`})})]}),D("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Creating events"}),E("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:E("pre",{children:`capabilityId: calendar-create-event
73
+ GOOGLE_CALENDAR_ID=primary`})})]}),K("div",{className:"space-y-4",children:[H("h2",{className:"font-bold text-2xl",children:"Creating events"}),H("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:H("pre",{children:`capabilityId: calendar-create-event
74
74
  provider:
75
75
  type: google-calendar
76
76
  operation: createEvent
@@ -94,7 +94,27 @@ outputs:
94
94
  eventId:
95
95
  type: string
96
96
  htmlLink:
97
- type: string`})})]}),D("div",{className:"flex items-center gap-4 pt-4",children:[E(Z,{href:"/docs/integrations/gmail",className:"btn-ghost",children:"Previous: Gmail API"}),D(Z,{href:"/docs/integrations/openai",className:"btn-primary",children:["Next: OpenAI ",E(Ne,{size:16})]})]})]})}import J from"@contractspec/lib.ui-link";import{jsx as p,jsxs as _}from"react/jsx-runtime";function ke(){return _("div",{className:"space-y-8",children:[_("div",{className:"space-y-4",children:[p("h1",{className:"font-bold text-4xl",children:"Health Routing Strategy"}),p("p",{className:"text-muted-foreground",children:"Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."})]}),_("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Connection config fields"}),p("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:p("pre",{children:`{
97
+ type: string`})})]}),K("div",{className:"flex items-center gap-4 pt-4",children:[H(J,{href:"/docs/integrations/google-drive",className:"btn-ghost",children:"Previous: Google Drive"}),K(J,{href:"/docs/integrations/openai",className:"btn-primary",children:["Next: OpenAI ",H(se,{size:16})]})]})]})}import{CodeBlock as X}from"@contractspec/lib.design-system";import $ from"@contractspec/lib.ui-link";import{ChevronRight as Pe}from"lucide-react";import{jsx as b,jsxs as E}from"react/jsx-runtime";function Ie(){return E("div",{className:"space-y-8",children:[E("div",{className:"space-y-4",children:[b("h1",{className:"font-bold text-4xl",children:"Google Drive"}),b("p",{className:"text-muted-foreground",children:"Google Drive is modeled as a storage and knowledge-ingestion provider with explicit delta watch state. The contract covers file listing, file retrieval, Drive watches, channel/resource expiry, replay checkpoints, dedupe, idempotency, and tombstones."})]}),E("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Provider contract"}),b(X,{language:"typescript",filename:"google-drive-provider.ts",code:`interface GoogleDriveProvider {
98
+ listFiles(query?: GoogleDriveListFilesQuery): Promise<GoogleDriveListFilesResult>;
99
+ getFile(fileId: string): Promise<GoogleDriveFile | null>;
100
+ watchChanges?(input: GoogleDriveWatchInput): Promise<GoogleDriveWatchResult>;
101
+ }`}),E("p",{className:"text-muted-foreground text-sm",children:["The provider advertises ",b("code",{children:"storage.objects"}),","," ",b("code",{children:"knowledge.ingestion.drive"}),", and"," ",b("code",{children:"provider.delta.watch"}),". Runtime implementations should persist returned deltas before acknowledging sync work."]})]}),E("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Delta-aware ingestion"}),b(X,{language:"typescript",filename:"drive-sync.ts",code:`await knowledge.syncDriveFiles(
102
+ {
103
+ query: "mimeType = 'text/plain' and trashed = false",
104
+ },
105
+ {
106
+ sourceId: "src_drive_support",
107
+ evidenceRef: "audit://sync/drive/support",
108
+ },
109
+ );
110
+
111
+ await knowledge.watchDriveChanges(
112
+ {
113
+ channelId: "drive-support-watch",
114
+ webhookUrl: "https://app.example.com/webhooks/google-drive",
115
+ },
116
+ { sourceId: "src_drive_support" },
117
+ );`})]}),E("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Production checklist"}),E("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[b("li",{children:"Persist `ProviderDeltaSyncState` per Drive source."}),b("li",{children:"Renew webhook channels before `webhookChannel.expiresAt`."}),b("li",{children:"Skip tombstoned files before indexing or mutating them."}),b("li",{children:"Record replay checkpoint and idempotency evidence for retries."}),b("li",{children:"Use mutation governance before changing permissions or sending outbound notifications."})]})]}),E("div",{className:"flex items-center gap-4 pt-4",children:[b($,{href:"/docs/integrations/gmail",className:"btn-ghost",children:"Previous: Gmail API"}),E($,{href:"/docs/knowledge/governance",className:"btn-primary",children:["Knowledge governance ",b(Pe,{size:16})]})]})]})}import x from"@contractspec/lib.ui-link";import{jsx as m,jsxs as W}from"react/jsx-runtime";function Te(){return W("div",{className:"space-y-8",children:[W("div",{className:"space-y-4",children:[m("h1",{className:"font-bold text-4xl",children:"Health Routing Strategy"}),m("p",{className:"text-muted-foreground",children:"Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."})]}),W("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Connection config fields"}),m("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:m("pre",{children:`{
98
118
  "defaultTransport": "official-api",
99
119
  "strategyOrder": [
100
120
  "official-api",
@@ -108,7 +128,7 @@ outputs:
108
128
  "apiBaseUrl": "https://api.provider.example",
109
129
  "mcpUrl": "https://mcp.provider.example",
110
130
  "oauthTokenUrl": "https://api.provider.example/oauth/token"
111
- }`})})]}),_("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Secret payload fields"}),p("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:p("pre",{children:`{
131
+ }`})})]}),W("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Secret payload fields"}),m("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:m("pre",{children:`{
112
132
  "apiKey": "...",
113
133
  "accessToken": "...",
114
134
  "refreshToken": "...",
@@ -117,8 +137,8 @@ outputs:
117
137
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
118
138
  "mcpAccessToken": "...",
119
139
  "webhookSecret": "..."
120
- }`})})]}),_("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Routing behavior"}),_("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[p("li",{children:"Unsupported strategies are skipped per provider capability matrix."}),p("li",{children:"Missing credentials fail closed and fall through only when a later strategy is valid."}),_("li",{children:["Unofficial routes are disabled unless",p("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"allowUnofficial"}),"is true."]}),_("li",{children:["When",p("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"unofficialAllowList"}),"is set, only listed provider keys can route unofficially."]}),_("li",{children:["OAuth refresh uses",p("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"oauthTokenUrl"}),"with refresh/client credentials when APIs return 401."]})]})]}),_("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Provider guidance"}),_("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[p("li",{children:"Use official APIs when available (Whoop, Oura, Strava, Fitbit)."}),p("li",{children:"Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."}),p("li",{children:"Keep unofficial automation opt-in and auditable for production."})]})]}),_("div",{className:"flex items-center gap-4 pt-4",children:[p(J,{href:"/docs/integrations/whatsapp-twilio",className:"btn-ghost",children:"Previous: WhatsApp Twilio"}),p(J,{href:"/docs/integrations",className:"btn-primary",children:"Back to Integrations"})]})]})}import Q from"@contractspec/lib.ui-link";import{ChevronRight as we}from"lucide-react";import{jsx as r,jsxs as H}from"react/jsx-runtime";function Ae(){return H("div",{className:"space-y-8",children:[H("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"Mistral"}),r("p",{className:"text-muted-foreground",children:"Integrate Mistral models for chat, reasoning, embeddings, speech-to-text, and conversational voice workflows. ContractSpec ships first-class Mistral support across contracts, provider runtime wiring, and CLI provider selection."})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Setup"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`# .env
121
- MISTRAL_API_KEY=...`})})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Chat and reasoning"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-chat
140
+ }`})})]}),W("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Routing behavior"}),W("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:"Unsupported strategies are skipped per provider capability matrix."}),m("li",{children:"Missing credentials fail closed and fall through only when a later strategy is valid."}),W("li",{children:["Unofficial routes are disabled unless",m("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"allowUnofficial"}),"is true."]}),W("li",{children:["When",m("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"unofficialAllowList"}),"is set, only listed provider keys can route unofficially."]}),W("li",{children:["OAuth refresh uses",m("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"oauthTokenUrl"}),"with refresh/client credentials when APIs return 401."]})]})]}),W("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Provider guidance"}),W("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:"Use official APIs when available (Whoop, Oura, Strava, Fitbit)."}),m("li",{children:"Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."}),m("li",{children:"Keep unofficial automation opt-in and auditable for production."})]})]}),W("div",{className:"flex items-center gap-4 pt-4",children:[m(x,{href:"/docs/integrations/whatsapp-twilio",className:"btn-ghost",children:"Previous: WhatsApp Twilio"}),m(x,{href:"/docs/integrations",className:"btn-primary",children:"Back to Integrations"})]})]})}import j from"@contractspec/lib.ui-link";import{ChevronRight as _e}from"lucide-react";import{jsx as r,jsxs as C}from"react/jsx-runtime";function We(){return C("div",{className:"space-y-8",children:[C("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"Mistral"}),r("p",{className:"text-muted-foreground",children:"Integrate Mistral models for chat, reasoning, embeddings, speech-to-text, and conversational voice workflows. ContractSpec ships first-class Mistral support across contracts, provider runtime wiring, and CLI provider selection."})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Setup"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`# .env
141
+ MISTRAL_API_KEY=...`})})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Chat and reasoning"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-chat
122
142
  provider:
123
143
  type: mistral
124
144
  operation: chatCompletion
@@ -137,7 +157,7 @@ outputs:
137
157
  content:
138
158
  type: string
139
159
  usage:
140
- type: object`})})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Embeddings"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-embeddings
160
+ type: object`})})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Embeddings"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-embeddings
141
161
  provider:
142
162
  type: mistral
143
163
  operation: createEmbedding
@@ -153,7 +173,7 @@ outputs:
153
173
  embedding:
154
174
  type: array
155
175
  items:
156
- type: number`})})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Speech-to-Text (Voxtral)"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-stt
176
+ type: number`})})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Speech-to-Text (Voxtral)"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`capabilityId: mistral-stt
157
177
  provider:
158
178
  type: mistral
159
179
  operation: transcribe
@@ -173,9 +193,9 @@ outputs:
173
193
  segments:
174
194
  type: array
175
195
  language:
176
- type: string`})})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Conversational voice sessions"}),r("p",{className:"text-muted-foreground",children:"Use the conversational provider for session-based realtime voice flows (turn handling, events, and interruption-safe streaming)."})]}),H("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Best practices"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[r("li",{children:"Choose model families by workload: coding, reasoning, or speech"}),r("li",{children:"Persist session IDs for conversational continuity across turns"}),r("li",{children:"Capture token and latency telemetry for provider-level tuning"}),r("li",{children:"Set explicit fallbacks for network and rate-limit failures"})]})]}),H("div",{className:"flex items-center gap-4 pt-4",children:[r(Q,{href:"/docs/integrations/openai",className:"btn-ghost",children:"Previous: OpenAI"}),H(Q,{href:"/docs/integrations/elevenlabs",className:"btn-primary",children:["Next: ElevenLabs ",r(we,{size:16})]})]})]})}import X from"@contractspec/lib.ui-link";import{ChevronRight as Te}from"lucide-react";import{jsx as d,jsxs as S}from"react/jsx-runtime";function Ie(){return S("div",{className:"space-y-8",children:[S("div",{className:"space-y-4",children:[d("h1",{className:"font-bold text-4xl",children:"OpenAI"}),d("p",{className:"text-muted-foreground",children:"Integrate OpenAI's powerful AI models for chat completion, embeddings, and speech-to-text. Build intelligent features with GPT-4, generate embeddings for semantic search, and transcribe audio with Whisper."})]}),S("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Setup"}),d("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:d("pre",{children:`# .env
196
+ type: string`})})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Conversational voice sessions"}),r("p",{className:"text-muted-foreground",children:"Use the conversational provider for session-based realtime voice flows (turn handling, events, and interruption-safe streaming)."})]}),C("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Best practices"}),C("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[r("li",{children:"Choose model families by workload: coding, reasoning, or speech"}),r("li",{children:"Persist session IDs for conversational continuity across turns"}),r("li",{children:"Capture token and latency telemetry for provider-level tuning"}),r("li",{children:"Set explicit fallbacks for network and rate-limit failures"})]})]}),C("div",{className:"flex items-center gap-4 pt-4",children:[r(j,{href:"/docs/integrations/openai",className:"btn-ghost",children:"Previous: OpenAI"}),C(j,{href:"/docs/integrations/elevenlabs",className:"btn-primary",children:["Next: ElevenLabs ",r(_e,{size:16})]})]})]})}import ee from"@contractspec/lib.ui-link";import{ChevronRight as Me}from"lucide-react";import{jsx as l,jsxs as D}from"react/jsx-runtime";function Se(){return D("div",{className:"space-y-8",children:[D("div",{className:"space-y-4",children:[l("h1",{className:"font-bold text-4xl",children:"OpenAI"}),l("p",{className:"text-muted-foreground",children:"Integrate OpenAI's powerful AI models for chat completion, embeddings, and speech-to-text. Build intelligent features with GPT-4, generate embeddings for semantic search, and transcribe audio with Whisper."})]}),D("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Setup"}),l("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:l("pre",{children:`# .env
177
197
  OPENAI_API_KEY=sk-...
178
- OPENAI_ORGANIZATION=org-...`})})]}),S("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Chat completions"}),d("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:d("pre",{children:`capabilityId: openai-chat
198
+ OPENAI_ORGANIZATION=org-...`})})]}),D("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Chat completions"}),l("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:l("pre",{children:`capabilityId: openai-chat
179
199
  provider:
180
200
  type: openai
181
201
  operation: chatCompletion
@@ -200,7 +220,7 @@ outputs:
200
220
  content:
201
221
  type: string
202
222
  usage:
203
- type: object`})})]}),S("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Embeddings"}),d("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:d("pre",{children:`capabilityId: openai-embeddings
223
+ type: object`})})]}),D("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Embeddings"}),l("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:l("pre",{children:`capabilityId: openai-embeddings
204
224
  provider:
205
225
  type: openai
206
226
  operation: createEmbedding
@@ -216,7 +236,7 @@ outputs:
216
236
  embedding:
217
237
  type: array
218
238
  items:
219
- type: number`})})]}),S("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Whisper (Speech-to-Text)"}),d("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:d("pre",{children:`capabilityId: openai-transcribe
239
+ type: number`})})]}),D("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Whisper (Speech-to-Text)"}),l("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:l("pre",{children:`capabilityId: openai-transcribe
220
240
  provider:
221
241
  type: openai
222
242
  operation: transcribe
@@ -232,10 +252,10 @@ outputs:
232
252
  text:
233
253
  type: string
234
254
  language:
235
- type: string`})})]}),S("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Best practices"}),S("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[d("li",{children:"Use streaming for real-time chat responses"}),d("li",{children:"Cache embeddings to reduce API costs"}),d("li",{children:"Implement rate limiting to avoid quota issues"}),d("li",{children:"Store conversation history for context"}),d("li",{children:"Monitor token usage and costs"})]})]}),S("div",{className:"flex items-center gap-4 pt-4",children:[d(X,{href:"/docs/integrations/google-calendar",className:"btn-ghost",children:"Previous: Google Calendar"}),S(X,{href:"/docs/integrations/mistral",className:"btn-primary",children:["Next: Mistral ",d(Te,{size:16})]})]})]})}import G from"@contractspec/lib.ui-link";import{jsx as N,jsxs as C}from"react/jsx-runtime";var Pe=[{title:"Models and voice",items:[{title:"OpenAI",href:"/docs/integrations/openai"},{title:"Mistral",href:"/docs/integrations/mistral"},{title:"ElevenLabs",href:"/docs/integrations/elevenlabs"}]},{title:"Messaging and product operations",items:[{title:"GitHub",href:"/docs/integrations/github"},{title:"Slack",href:"/docs/integrations/slack"},{title:"Twilio",href:"/docs/integrations/twilio"},{title:"Postmark",href:"/docs/integrations/postmark"}]},{title:"Data, storage, and retrieval",items:[{title:"Qdrant",href:"/docs/integrations/qdrant"},{title:"S3 storage",href:"/docs/integrations/s3"},{title:"Gmail",href:"/docs/integrations/gmail"},{title:"Google Calendar",href:"/docs/integrations/google-calendar"}]},{title:"Payments and external workflows",items:[{title:"Stripe",href:"/docs/integrations/stripe"},{title:"Powens",href:"/docs/integrations/powens"},{title:"Circuit breakers",href:"/docs/integrations/circuit-breakers"},{title:"Health routing",href:"/docs/integrations/health-routing"}]}];function We(){return C("div",{className:"space-y-10",children:[C("div",{className:"space-y-3",children:[N("p",{className:"editorial-kicker",children:"Integrations"}),N("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Integrations stay explicit: spec what a provider offers, then bind it per tenant and per app."}),N("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"The integration model keeps provider behavior out of ad hoc glue code. Define the capability contract first, configure the provider connection explicitly, then bind the integration into app workflows and runtime surfaces with clear ownership."})]}),C("div",{className:"editorial-proof-strip",children:[C("div",{className:"editorial-stat",children:[N("span",{className:"editorial-label",children:"Binding model"}),N("span",{className:"editorial-stat-value",children:"Integration spec \u2192 tenant connection \u2192 app binding"})]}),N("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"That separation is what makes reuse, tenant isolation, and provider swaps practical without rewriting every surface."})]}),N("section",{className:"editorial-panel space-y-5",children:C("div",{className:"space-y-2",children:[N("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with the model, then pick a provider"}),C("div",{className:"grid gap-4 md:grid-cols-2",children:[C(G,{href:"/docs/integrations/spec-model",className:"docs-footer-link",children:[N("h3",{className:"font-semibold text-lg",children:"Integration spec model"}),N("p",{className:"text-muted-foreground text-sm leading-7",children:"Define what the provider offers, what configuration it needs, and how the runtime should treat it."})]}),C(G,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[N("h3",{className:"font-semibold text-lg",children:"Integration binding"}),N("p",{className:"text-muted-foreground text-sm leading-7",children:"Understand how tenant connections get mapped into concrete app surfaces and workflows."})]})]})]})}),N("div",{className:"grid gap-5 md:grid-cols-2",children:Pe.map((T)=>C("section",{className:"editorial-panel space-y-4",children:[N("h2",{className:"font-serif text-2xl tracking-[-0.03em]",children:T.title}),N("div",{className:"space-y-3",children:T.items.map((P)=>N(G,{href:P.href,className:"docs-chip-link",children:P.title},P.href))})]},T.title))})]})}import $ from"@contractspec/lib.ui-link";import{ChevronRight as _e}from"lucide-react";import{jsx as o,jsxs as b}from"react/jsx-runtime";function Me(){return b("div",{className:"space-y-8",children:[b("div",{className:"space-y-4",children:[o("h1",{className:"font-bold text-4xl",children:"Postmark"}),o("p",{className:"text-muted-foreground",children:"Postmark is a transactional email service with industry-leading deliverability. Use it to send order confirmations, password resets, notifications, and other critical emails."})]}),b("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Setup"}),o("p",{className:"text-muted-foreground",children:"Add your Postmark credentials to your environment variables:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`# .env
255
+ type: string`})})]}),D("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Best practices"}),D("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:"Use streaming for real-time chat responses"}),l("li",{children:"Cache embeddings to reduce API costs"}),l("li",{children:"Implement rate limiting to avoid quota issues"}),l("li",{children:"Store conversation history for context"}),l("li",{children:"Monitor token usage and costs"})]})]}),D("div",{className:"flex items-center gap-4 pt-4",children:[l(ee,{href:"/docs/integrations/google-calendar",className:"btn-ghost",children:"Previous: Google Calendar"}),D(ee,{href:"/docs/integrations/mistral",className:"btn-primary",children:["Next: Mistral ",l(Me,{size:16})]})]})]})}import Q from"@contractspec/lib.ui-link";import{jsx as y,jsxs as U}from"react/jsx-runtime";var Ce=[{title:"Models and voice",items:[{title:"OpenAI",href:"/docs/integrations/openai"},{title:"Mistral",href:"/docs/integrations/mistral"},{title:"ElevenLabs",href:"/docs/integrations/elevenlabs"}]},{title:"Messaging and product operations",items:[{title:"GitHub",href:"/docs/integrations/github"},{title:"Slack",href:"/docs/integrations/slack"},{title:"Twilio",href:"/docs/integrations/twilio"},{title:"Postmark",href:"/docs/integrations/postmark"}]},{title:"Data, storage, and retrieval",items:[{title:"Qdrant",href:"/docs/integrations/qdrant"},{title:"S3 storage",href:"/docs/integrations/s3"},{title:"Gmail",href:"/docs/integrations/gmail"},{title:"Google Drive",href:"/docs/integrations/google-drive"},{title:"Google Calendar",href:"/docs/integrations/google-calendar"}]},{title:"Payments and external workflows",items:[{title:"Stripe",href:"/docs/integrations/stripe"},{title:"Powens",href:"/docs/integrations/powens"},{title:"Circuit breakers",href:"/docs/integrations/circuit-breakers"},{title:"Health routing",href:"/docs/integrations/health-routing"}]}];function He(){return U("div",{className:"space-y-10",children:[U("div",{className:"space-y-3",children:[y("p",{className:"editorial-kicker",children:"Integrations"}),y("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Integrations stay explicit: spec what a provider offers, then bind it per tenant and per app."}),y("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"The integration model keeps provider behavior out of ad hoc glue code. Define the capability contract first, configure the provider connection explicitly, then bind the integration into app workflows and runtime surfaces with clear ownership."})]}),U("div",{className:"editorial-proof-strip",children:[U("div",{className:"editorial-stat",children:[y("span",{className:"editorial-label",children:"Binding model"}),y("span",{className:"editorial-stat-value",children:"Integration spec \u2192 tenant connection \u2192 app binding"})]}),y("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"That separation is what makes reuse, tenant isolation, and provider swaps practical without rewriting every surface."})]}),y("section",{className:"editorial-panel space-y-5",children:U("div",{className:"space-y-2",children:[y("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with the model, then pick a provider"}),U("div",{className:"grid gap-4 md:grid-cols-2",children:[U(Q,{href:"/docs/integrations/spec-model",className:"docs-footer-link",children:[y("h3",{className:"font-semibold text-lg",children:"Integration spec model"}),y("p",{className:"text-muted-foreground text-sm leading-7",children:"Define what the provider offers, what configuration it needs, and how the runtime should treat it."})]}),U(Q,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[y("h3",{className:"font-semibold text-lg",children:"Integration binding"}),y("p",{className:"text-muted-foreground text-sm leading-7",children:"Understand how tenant connections get mapped into concrete app surfaces and workflows."})]})]})]})}),y("div",{className:"grid gap-5 md:grid-cols-2",children:Ce.map((P)=>U("section",{className:"editorial-panel space-y-4",children:[y("h2",{className:"font-serif text-2xl tracking-[-0.03em]",children:P.title}),y("div",{className:"space-y-3",children:P.items.map((T)=>y(Q,{href:T.href,className:"docs-chip-link",children:T.title},T.href))})]},P.title))})]})}import te from"@contractspec/lib.ui-link";import{ChevronRight as De}from"lucide-react";import{jsx as o,jsxs as N}from"react/jsx-runtime";function Ee(){return N("div",{className:"space-y-8",children:[N("div",{className:"space-y-4",children:[o("h1",{className:"font-bold text-4xl",children:"Postmark"}),o("p",{className:"text-muted-foreground",children:"Postmark is a transactional email service with industry-leading deliverability. Use it to send order confirmations, password resets, notifications, and other critical emails."})]}),N("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Setup"}),o("p",{className:"text-muted-foreground",children:"Add your Postmark credentials to your environment variables:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`# .env
236
256
  POSTMARK_API_TOKEN=...
237
257
  POSTMARK_FROM_EMAIL=noreply@example.com
238
- POSTMARK_FROM_NAME="Your App Name"`})}),b("p",{className:"text-muted-foreground text-sm",children:["Get your API token from the"," ",o("a",{href:"https://account.postmarkapp.com/servers",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Postmark Dashboard"}),"."]})]}),b("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Sending emails"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`capabilityId: send-email
258
+ POSTMARK_FROM_NAME="Your App Name"`})}),N("p",{className:"text-muted-foreground text-sm",children:["Get your API token from the"," ",o("a",{href:"https://account.postmarkapp.com/servers",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Postmark Dashboard"}),"."]})]}),N("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Sending emails"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`capabilityId: send-email
239
259
  provider:
240
260
  type: postmark
241
261
  operation: sendEmail
@@ -263,7 +283,7 @@ outputs:
263
283
  messageId:
264
284
  type: string
265
285
  submittedAt:
266
- type: timestamp`})})]}),b("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Using templates"}),o("p",{className:"text-muted-foreground",children:"Postmark templates allow you to design emails in their dashboard and populate them with data:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`capabilityId: send-welcome-email
286
+ type: timestamp`})})]}),N("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Using templates"}),o("p",{className:"text-muted-foreground",children:"Postmark templates allow you to design emails in their dashboard and populate them with data:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:`capabilityId: send-welcome-email
267
287
  provider:
268
288
  type: postmark
269
289
  operation: sendEmail
@@ -278,7 +298,7 @@ config:
278
298
  templateId: "welcome-email"
279
299
  templateData:
280
300
  user_name: \${input.userName}
281
- login_url: "https://app.example.com/login"`})})]}),b("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Webhooks"}),o("p",{className:"text-muted-foreground",children:"Postmark can notify your app about delivery, bounces, and opens:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:"https://your-app.com/api/webhooks/postmark"})}),o("p",{className:"text-muted-foreground",children:"ContractSpec automatically processes these webhook events:"}),b("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[b("li",{children:[o("strong",{children:"Delivery"})," \u2013 Email was successfully delivered"]}),b("li",{children:[o("strong",{children:"Bounce"})," \u2013 Email bounced (hard or soft)"]}),b("li",{children:[o("strong",{children:"SpamComplaint"})," \u2013 Recipient marked email as spam"]}),b("li",{children:[o("strong",{children:"Open"})," \u2013 Recipient opened the email"]}),b("li",{children:[o("strong",{children:"Click"})," \u2013 Recipient clicked a link"]})]})]}),b("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Best practices"}),b("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:"Use templates for consistent branding"}),o("li",{children:"Always provide both HTML and plain text versions"}),o("li",{children:"Monitor bounce rates and remove invalid addresses"}),o("li",{children:"Use message streams to separate different email types"}),o("li",{children:"Test emails in the Postmark sandbox before going live"}),o("li",{children:"Set up DKIM and SPF records for your domain"})]})]}),b("div",{className:"flex items-center gap-4 pt-4",children:[o($,{href:"/docs/integrations/stripe",className:"btn-ghost",children:"Previous: Stripe"}),b($,{href:"/docs/integrations/resend",className:"btn-primary",children:["Next: Resend ",o(_e,{size:16})]})]})]})}import x from"@contractspec/lib.ui-link";import{ChevronRight as He}from"lucide-react";import{jsx as a,jsxs as i}from"react/jsx-runtime";function Ee(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"Powens Open Banking"}),a("p",{className:"text-muted-foreground",children:"Powens provides read-only open banking connectivity for ContractSpec applications. The reference integration powers Pocket Family Office by synchronising household bank accounts, transactions, and balances while keeping all raw PII protected."})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Setup"}),a("p",{className:"text-muted-foreground",children:"Create a Powens BYOK project, then store the credentials in your secret manager. The ContractSpec integration expects the following fields:"}),a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:a("pre",{children:`{
301
+ login_url: "https://app.example.com/login"`})})]}),N("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Webhooks"}),o("p",{className:"text-muted-foreground",children:"Postmark can notify your app about delivery, bounces, and opens:"}),o("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:o("pre",{children:"https://your-app.com/api/webhooks/postmark"})}),o("p",{className:"text-muted-foreground",children:"ContractSpec automatically processes these webhook events:"}),N("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[N("li",{children:[o("strong",{children:"Delivery"})," \u2013 Email was successfully delivered"]}),N("li",{children:[o("strong",{children:"Bounce"})," \u2013 Email bounced (hard or soft)"]}),N("li",{children:[o("strong",{children:"SpamComplaint"})," \u2013 Recipient marked email as spam"]}),N("li",{children:[o("strong",{children:"Open"})," \u2013 Recipient opened the email"]}),N("li",{children:[o("strong",{children:"Click"})," \u2013 Recipient clicked a link"]})]})]}),N("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Best practices"}),N("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:"Use templates for consistent branding"}),o("li",{children:"Always provide both HTML and plain text versions"}),o("li",{children:"Monitor bounce rates and remove invalid addresses"}),o("li",{children:"Use message streams to separate different email types"}),o("li",{children:"Test emails in the Postmark sandbox before going live"}),o("li",{children:"Set up DKIM and SPF records for your domain"})]})]}),N("div",{className:"flex items-center gap-4 pt-4",children:[o(te,{href:"/docs/integrations/stripe",className:"btn-ghost",children:"Previous: Stripe"}),N(te,{href:"/docs/integrations/resend",className:"btn-primary",children:["Next: Resend ",o(De,{size:16})]})]})]})}import ae from"@contractspec/lib.ui-link";import{ChevronRight as Ue}from"lucide-react";import{jsx as a,jsxs as i}from"react/jsx-runtime";function Le(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"Powens Open Banking"}),a("p",{className:"text-muted-foreground",children:"Powens provides read-only open banking connectivity for ContractSpec applications. The reference integration powers Pocket Family Office by synchronising household bank accounts, transactions, and balances while keeping all raw PII protected."})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Setup"}),a("p",{className:"text-muted-foreground",children:"Create a Powens BYOK project, then store the credentials in your secret manager. The ContractSpec integration expects the following fields:"}),a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:a("pre",{children:`{
282
302
  "clientId": "powens-client-id",
283
303
  "clientSecret": "powens-client-secret",
284
304
  "apiKey": "optional-api-key",
@@ -333,10 +353,10 @@ inputs:
333
353
  outputs:
334
354
  balances:
335
355
  type: AccountBalanceRecord[]
336
- description: "Current/available balances with timestamps"`})})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Primary workflows"}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Account sync"}),i("p",{className:"text-muted-foreground",children:["The workflow"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-accounts"})," ","refreshes account metadata, then surfaces canonical records to other automations."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Transaction sync"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-transactions"})," ","ingests incremental transactions for each linked account and stores them in the canonical ledger."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Balance refresh"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.refresh-openbanking-balances"})," ","retrieves current and available balances to power dashboards and anomaly detection."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Derived financial overview"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.generate-openbanking-overview"})," ","aggregates balances, category breakdowns, and cashflow trends into the ",a("code",{children:"knowledge.financial-overview"})," space. Only derived summaries are exposed to LLMs."]})]})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Telemetry & guardrails"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:["Telemetry events such as"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.accounts.synced"})," ","and"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.transactions.synced"})," ","are emitted automatically with tenant, slot, and config metadata."]}),i("li",{children:["Guard helpers ensure the"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"primaryOpenBanking"})," ","slot is bound and healthy before workflows execute."]}),i("li",{children:["PII fields (IBAN, counterparty names, descriptions) are redacted via"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"redactOpenBankingTelemetryPayload"})," ","before logging or sending telemetry."]})]})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Best practices"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Use BYOK credentials per tenant to avoid cross-tenant exposure."}),a("li",{children:"Store only canonical entities (BankAccountRecord, BankTransactionRecord). Never persist raw Powens payloads or customer PII in logs."}),a("li",{children:"Run the transaction sync on a schedule appropriate for banking SLAs (e.g. every 15 minutes for cashflow dashboards)."}),a("li",{children:"Pair ledger updates with derived summaries to feed the knowledge layer instead of exposing raw transactions to agents."}),i("li",{children:["Monitor telemetry for"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.*.sync_failed"})," ","events to detect credential issues early."]})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[a(x,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),i(x,{href:"/docs/integrations/stripe",className:"btn-primary",children:["Next: Stripe ",a(He,{size:16})]})]})]})}import j from"@contractspec/lib.ui-link";import{ChevronRight as Se}from"lucide-react";import{jsx as y,jsxs as K}from"react/jsx-runtime";function Ce(){return K("div",{className:"space-y-8",children:[K("div",{className:"space-y-4",children:[y("h1",{className:"font-bold text-4xl",children:"Qdrant"}),y("p",{className:"text-muted-foreground",children:"Qdrant is a high-performance vector database for semantic search, recommendations, and RAG (Retrieval-Augmented Generation) applications."})]}),K("div",{className:"space-y-4",children:[y("h2",{className:"font-bold text-2xl",children:"Setup"}),y("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:y("pre",{children:`# .env
356
+ description: "Current/available balances with timestamps"`})})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Primary workflows"}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Account sync"}),i("p",{className:"text-muted-foreground",children:["The workflow"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-accounts"})," ","refreshes account metadata, then surfaces canonical records to other automations."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Transaction sync"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-transactions"})," ","ingests incremental transactions for each linked account and stores them in the canonical ledger."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Balance refresh"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.refresh-openbanking-balances"})," ","retrieves current and available balances to power dashboards and anomaly detection."]})]}),i("div",{className:"space-y-3",children:[a("h3",{className:"font-semibold text-lg",children:"Derived financial overview"}),i("p",{className:"text-muted-foreground",children:[a("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.generate-openbanking-overview"})," ","aggregates balances, category breakdowns, and cashflow trends into the ",a("code",{children:"knowledge.financial-overview"})," space. Only derived summaries are exposed to LLMs."]})]})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Telemetry & guardrails"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:["Telemetry events such as"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.accounts.synced"})," ","and"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.transactions.synced"})," ","are emitted automatically with tenant, slot, and config metadata."]}),i("li",{children:["Guard helpers ensure the"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"primaryOpenBanking"})," ","slot is bound and healthy before workflows execute."]}),i("li",{children:["PII fields (IBAN, counterparty names, descriptions) are redacted via"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"redactOpenBankingTelemetryPayload"})," ","before logging or sending telemetry."]})]})]}),i("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Best practices"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Use BYOK credentials per tenant to avoid cross-tenant exposure."}),a("li",{children:"Store only canonical entities (BankAccountRecord, BankTransactionRecord). Never persist raw Powens payloads or customer PII in logs."}),a("li",{children:"Run the transaction sync on a schedule appropriate for banking SLAs (e.g. every 15 minutes for cashflow dashboards)."}),a("li",{children:"Pair ledger updates with derived summaries to feed the knowledge layer instead of exposing raw transactions to agents."}),i("li",{children:["Monitor telemetry for"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.*.sync_failed"})," ","events to detect credential issues early."]})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[a(ae,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),i(ae,{href:"/docs/integrations/stripe",className:"btn-primary",children:["Next: Stripe ",a(Ue,{size:16})]})]})]})}import oe from"@contractspec/lib.ui-link";import{ChevronRight as Oe}from"lucide-react";import{jsx as k,jsxs as B}from"react/jsx-runtime";function Re(){return B("div",{className:"space-y-8",children:[B("div",{className:"space-y-4",children:[k("h1",{className:"font-bold text-4xl",children:"Qdrant"}),k("p",{className:"text-muted-foreground",children:"Qdrant is a high-performance vector database for semantic search, recommendations, and RAG (Retrieval-Augmented Generation) applications."})]}),B("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Setup"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`# .env
337
357
  QDRANT_URL=https://...
338
358
  QDRANT_API_KEY=...
339
- QDRANT_COLLECTION=documents`})})]}),K("div",{className:"space-y-4",children:[y("h2",{className:"font-bold text-2xl",children:"Storing vectors"}),y("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:y("pre",{children:`capabilityId: qdrant-upsert
359
+ QDRANT_COLLECTION=documents`})})]}),B("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Storing vectors"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`capabilityId: qdrant-upsert
340
360
  provider:
341
361
  type: qdrant
342
362
  operation: upsert
@@ -355,7 +375,7 @@ inputs:
355
375
 
356
376
  outputs:
357
377
  status:
358
- type: string`})})]}),K("div",{className:"space-y-4",children:[y("h2",{className:"font-bold text-2xl",children:"Semantic search"}),y("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:y("pre",{children:`capabilityId: qdrant-search
378
+ type: string`})})]}),B("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Semantic search"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`capabilityId: qdrant-search
359
379
  provider:
360
380
  type: qdrant
361
381
  operation: search
@@ -379,7 +399,7 @@ outputs:
379
399
  properties:
380
400
  id: string
381
401
  score: number
382
- payload: object`})})]}),K("div",{className:"space-y-4",children:[y("h2",{className:"font-bold text-2xl",children:"RAG workflow example"}),y("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:y("pre",{children:`workflowId: rag-query
402
+ payload: object`})})]}),B("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"RAG workflow example"}),k("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:k("pre",{children:`workflowId: rag-query
383
403
  version: '1.0.0'.0.0
384
404
 
385
405
  steps:
@@ -404,9 +424,9 @@ steps:
404
424
  - role: "user"
405
425
  content: |
406
426
  Context: \${steps.search-documents.output.results}
407
- Question: \${input.query}`})})]}),K("div",{className:"flex items-center gap-4 pt-4",children:[y(j,{href:"/docs/integrations/elevenlabs",className:"btn-ghost",children:"Previous: ElevenLabs"}),K(j,{href:"/docs/integrations/s3",className:"btn-primary",children:["Next: S3 Storage ",y(Se,{size:16})]})]})]})}import ee from"@contractspec/lib.ui-link";import{ChevronRight as Ue}from"lucide-react";import{jsx as w,jsxs as R}from"react/jsx-runtime";function Oe(){return R("div",{className:"space-y-8",children:[R("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"Resend"}),w("p",{className:"text-muted-foreground",children:"Resend is a modern email API built for developers. It provides a simple, reliable way to send transactional emails with React Email templates."})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Setup"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`# .env
427
+ Question: \${input.query}`})})]}),B("div",{className:"flex items-center gap-4 pt-4",children:[k(oe,{href:"/docs/integrations/elevenlabs",className:"btn-ghost",children:"Previous: ElevenLabs"}),B(oe,{href:"/docs/integrations/s3",className:"btn-primary",children:["Next: S3 Storage ",k(Oe,{size:16})]})]})]})}import ie from"@contractspec/lib.ui-link";import{ChevronRight as Be}from"lucide-react";import{jsx as s,jsxs as G}from"react/jsx-runtime";function Ge(){return G("div",{className:"space-y-8",children:[G("div",{className:"space-y-4",children:[s("h1",{className:"font-bold text-4xl",children:"Resend"}),s("p",{className:"text-muted-foreground",children:"Resend is a modern email API built for developers. It provides a simple, reliable way to send transactional emails with React Email templates."})]}),G("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Setup"}),s("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:s("pre",{children:`# .env
408
428
  RESEND_API_KEY=re_...
409
- RESEND_FROM_EMAIL=onboarding@resend.dev`})})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Sending emails"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`capabilityId: resend-send-email
429
+ RESEND_FROM_EMAIL=onboarding@resend.dev`})})]}),G("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Sending emails"}),s("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:s("pre",{children:`capabilityId: resend-send-email
410
430
  provider:
411
431
  type: resend
412
432
  operation: sendEmail
@@ -427,12 +447,12 @@ inputs:
427
447
 
428
448
  outputs:
429
449
  id:
430
- type: string`})})]}),R("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Best practices"}),R("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[w("li",{children:"Use React Email for type-safe templates"}),w("li",{children:"Verify your domain for better deliverability"}),w("li",{children:"Monitor email analytics in the Resend dashboard"})]})]}),R("div",{className:"flex items-center gap-4 pt-4",children:[w(ee,{href:"/docs/integrations/postmark",className:"btn-ghost",children:"Previous: Postmark"}),R(ee,{href:"/docs/integrations/gmail",className:"btn-primary",children:["Next: Gmail API ",w(Ue,{size:16})]})]})]})}import te from"@contractspec/lib.ui-link";import{ChevronRight as Le}from"lucide-react";import{jsx as m,jsxs as U}from"react/jsx-runtime";function Be(){return U("div",{className:"space-y-8",children:[U("div",{className:"space-y-4",children:[m("h1",{className:"font-bold text-4xl",children:"S3-Compatible Storage"}),m("p",{className:"text-muted-foreground",children:"Store files, images, and documents using any S3-compatible object storage service including AWS S3, Scaleway Object Storage, MinIO, DigitalOcean Spaces, and more."})]}),U("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Setup"}),m("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:m("pre",{children:`# .env
450
+ type: string`})})]}),G("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Best practices"}),G("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[s("li",{children:"Use React Email for type-safe templates"}),s("li",{children:"Verify your domain for better deliverability"}),s("li",{children:"Monitor email analytics in the Resend dashboard"})]})]}),G("div",{className:"flex items-center gap-4 pt-4",children:[s(ie,{href:"/docs/integrations/postmark",className:"btn-ghost",children:"Previous: Postmark"}),G(ie,{href:"/docs/integrations/gmail",className:"btn-primary",children:["Next: Gmail API ",s(Be,{size:16})]})]})]})}import re from"@contractspec/lib.ui-link";import{ChevronRight as Ke}from"lucide-react";import{jsx as g,jsxs as L}from"react/jsx-runtime";function qe(){return L("div",{className:"space-y-8",children:[L("div",{className:"space-y-4",children:[g("h1",{className:"font-bold text-4xl",children:"S3-Compatible Storage"}),g("p",{className:"text-muted-foreground",children:"Store files, images, and documents using any S3-compatible object storage service including AWS S3, Scaleway Object Storage, MinIO, DigitalOcean Spaces, and more."})]}),L("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Setup"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`# .env
431
451
  S3_ENDPOINT=https://s3.fr-par.scw.cloud
432
452
  S3_ACCESS_KEY_ID=...
433
453
  S3_SECRET_ACCESS_KEY=...
434
454
  S3_BUCKET=my-bucket
435
- S3_REGION=fr-par`})})]}),U("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Uploading files"}),m("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:m("pre",{children:`capabilityId: s3-upload
455
+ S3_REGION=fr-par`})})]}),L("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Uploading files"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`capabilityId: s3-upload
436
456
  provider:
437
457
  type: s3
438
458
  operation: upload
@@ -454,7 +474,7 @@ outputs:
454
474
  url:
455
475
  type: string
456
476
  etag:
457
- type: string`})})]}),U("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Generating presigned URLs"}),m("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:m("pre",{children:`capabilityId: s3-presigned-url
477
+ type: string`})})]}),L("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Generating presigned URLs"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`capabilityId: s3-presigned-url
458
478
  provider:
459
479
  type: s3
460
480
  operation: getPresignedUrl
@@ -469,7 +489,7 @@ inputs:
469
489
 
470
490
  outputs:
471
491
  url:
472
- type: string`})})]}),U("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Best practices"}),U("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:"Use presigned URLs for secure, temporary access"}),m("li",{children:"Set appropriate CORS policies for browser uploads"}),m("li",{children:"Enable versioning for important files"}),m("li",{children:"Use lifecycle policies to archive old files"}),m("li",{children:"Organize files with a clear key structure"})]})]}),U("div",{className:"flex items-center gap-4 pt-4",children:[m(te,{href:"/docs/integrations/qdrant",className:"btn-ghost",children:"Previous: Qdrant"}),U(te,{href:"/docs/integrations/twilio",className:"btn-primary",children:["Next: Twilio ",m(Le,{size:16})]})]})]})}import ae from"@contractspec/lib.ui-link";import{ChevronRight as Ke}from"lucide-react";import{jsx as u,jsxs as M}from"react/jsx-runtime";function Re(){return M("div",{className:"space-y-8",children:[M("div",{className:"space-y-4",children:[u("h1",{className:"font-bold text-4xl",children:"Slack Messaging"}),u("p",{className:"text-muted-foreground",children:"ContractSpec supports signed Slack event ingestion and outbox-backed outbound replies through the channel runtime."})]}),M("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),u("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:u("pre",{children:`// secret payload
492
+ type: string`})})]}),L("div",{className:"space-y-4",children:[g("h2",{className:"font-bold text-2xl",children:"Best practices"}),L("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[g("li",{children:"Use presigned URLs for secure, temporary access"}),g("li",{children:"Set appropriate CORS policies for browser uploads"}),g("li",{children:"Enable versioning for important files"}),g("li",{children:"Use lifecycle policies to archive old files"}),g("li",{children:"Organize files with a clear key structure"})]})]}),L("div",{className:"flex items-center gap-4 pt-4",children:[g(re,{href:"/docs/integrations/qdrant",className:"btn-ghost",children:"Previous: Qdrant"}),L(re,{href:"/docs/integrations/twilio",className:"btn-primary",children:["Next: Twilio ",g(Ke,{size:16})]})]})]})}import le from"@contractspec/lib.ui-link";import{ChevronRight as ze}from"lucide-react";import{jsx as u,jsxs as M}from"react/jsx-runtime";function Fe(){return M("div",{className:"space-y-8",children:[M("div",{className:"space-y-4",children:[u("h1",{className:"font-bold text-4xl",children:"Slack Messaging"}),u("p",{className:"text-muted-foreground",children:"ContractSpec supports signed Slack event ingestion and outbox-backed outbound replies through the channel runtime."})]}),M("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),u("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:u("pre",{children:`// secret payload
473
493
  {
474
494
  "botToken": "xoxb-...",
475
495
  "signingSecret": "..."
@@ -487,7 +507,7 @@ CHANNEL_DISPATCH_TOKEN=...
487
507
 
488
508
  # Optional scheduler
489
509
  CHANNEL_DISPATCH_INTERVAL_MS=120000
490
- CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Best practices"}),M("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[u("li",{children:"Keep bot tokens and signing secrets in a managed secret provider."}),u("li",{children:"Use workspace mapping to prevent cross-tenant event leakage."}),u("li",{children:"Keep dispatch asynchronous so webhook handlers stay fast and reliable."}),u("li",{children:"Monitor telemetry for ingest, decision, outbox, and dispatch stages."})]})]}),M("div",{className:"flex items-center gap-4 pt-4",children:[u(ae,{href:"/docs/integrations/twilio",className:"btn-ghost",children:"Previous: Twilio SMS"}),M(ae,{href:"/docs/integrations/github",className:"btn-primary",children:["Next: GitHub Messaging ",u(Ke,{size:16})]})]})]})}import oe from"@contractspec/lib.ui-link";import{ChevronRight as De}from"lucide-react";import{jsx as t,jsxs as l}from"react/jsx-runtime";function se(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Integration Spec Model"}),t("p",{className:"text-muted-foreground",children:"Integrations in ContractSpec are defined through typed specifications that declare capabilities, configuration requirements, and connection details. This page covers IntegrationSpec and IntegrationConnection."})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"IntegrationSpec"}),l("p",{className:"text-muted-foreground",children:["The ",t("strong",{children:"IntegrationSpec"})," is a global definition of an integration provider. It declares what the integration provides and what it requires."]}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`type IntegrationSpec = {
510
+ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Best practices"}),M("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[u("li",{children:"Keep bot tokens and signing secrets in a managed secret provider."}),u("li",{children:"Use workspace mapping to prevent cross-tenant event leakage."}),u("li",{children:"Keep dispatch asynchronous so webhook handlers stay fast and reliable."}),u("li",{children:"Monitor telemetry for ingest, decision, outbox, and dispatch stages."})]})]}),M("div",{className:"flex items-center gap-4 pt-4",children:[u(le,{href:"/docs/integrations/twilio",className:"btn-ghost",children:"Previous: Twilio SMS"}),M(le,{href:"/docs/integrations/github",className:"btn-primary",children:["Next: GitHub Messaging ",u(ze,{size:16})]})]})]})}import de from"@contractspec/lib.ui-link";import{ChevronRight as Ve}from"lucide-react";import{jsx as t,jsxs as d}from"react/jsx-runtime";function Qe(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Integration Spec Model"}),t("p",{className:"text-muted-foreground",children:"Integrations in ContractSpec are defined through typed specifications that declare capabilities, configuration requirements, and connection details. This page covers IntegrationSpec and IntegrationConnection."})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"IntegrationSpec"}),d("p",{className:"text-muted-foreground",children:["The ",t("strong",{children:"IntegrationSpec"})," is a global definition of an integration provider. It declares what the integration provides and what it requires."]}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`type IntegrationSpec = {
491
511
  id: string;
492
512
  label: string;
493
513
  description: string;
@@ -540,7 +560,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
540
560
  version: string;
541
561
  createdAt: string;
542
562
  updatedAt: string;
543
- };`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationSpec"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
563
+ };`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationSpec"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
544
564
  id: "stripe",
545
565
  label: "Stripe",
546
566
  description: "Payment processing and subscription management",
@@ -605,7 +625,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
605
625
  docsUrl: "https://docs.contractspec.com/integrations/stripe",
606
626
  setupGuideUrl: "https://stripe.com/docs/keys",
607
627
  version: "1.0.0"
608
- }`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"IntegrationConnection"}),l("p",{className:"text-muted-foreground",children:["An ",t("strong",{children:"IntegrationConnection"})," is a per-tenant instance of an integration with configured credentials and environment settings."]}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`type IntegrationConnection = {
628
+ }`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"IntegrationConnection"}),d("p",{className:"text-muted-foreground",children:["An ",t("strong",{children:"IntegrationConnection"})," is a per-tenant instance of an integration with configured credentials and environment settings."]}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`type IntegrationConnection = {
609
629
  id: string;
610
630
  tenantId: string;
611
631
  integrationId: string;
@@ -629,7 +649,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
629
649
  createdAt: string;
630
650
  updatedAt: string;
631
651
  createdBy: string;
632
- };`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationConnection"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`// Production connection
652
+ };`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationConnection"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`// Production connection
633
653
  {
634
654
  id: "conn_stripe_acme_prod",
635
655
  tenantId: "acme-corp",
@@ -663,7 +683,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
663
683
  createdAt: "2025-01-01T00:00:00Z",
664
684
  updatedAt: "2025-01-15T10:25:00Z",
665
685
  createdBy: "dev@acme.com"
666
- }`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Messaging IntegrationConnection"}),t("p",{className:"text-muted-foreground",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."}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
686
+ }`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example: Messaging IntegrationConnection"}),t("p",{className:"text-muted-foreground",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."}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
667
687
  id: "conn_slack_acme_prod",
668
688
  tenantId: "acme-corp",
669
689
  integrationId: "messaging.slack",
@@ -680,7 +700,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
680
700
  {
681
701
  "botToken": "xoxb-...",
682
702
  "signingSecret": "..."
683
- }`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Health transport strategy config"}),t("p",{className:"text-muted-foreground",children:"Health providers support deterministic transport routing and explicit unofficial gating in connection config."}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
703
+ }`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Health transport strategy config"}),t("p",{className:"text-muted-foreground",children:"Health providers support deterministic transport routing and explicit unofficial gating in connection config."}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`{
684
704
  "defaultTransport": "official-api",
685
705
  "strategyOrder": ["official-api", "aggregator-api", "unofficial"],
686
706
  "allowUnofficial": false,
@@ -697,7 +717,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),M("div",{className:"space-y-4",children:
697
717
  "clientSecret": "...",
698
718
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
699
719
  "mcpAccessToken": "..."
700
- }`})})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Health checks"}),t("p",{className:"text-muted-foreground",children:"IntegrationConnections are periodically health-checked to ensure they remain valid:"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:[t("strong",{children:"API key validation"})," - Test that credentials are still valid"]}),l("li",{children:[t("strong",{children:"Connectivity check"})," - Verify network access to the provider"]}),l("li",{children:[t("strong",{children:"Permission verification"})," - Ensure required scopes are granted"]}),l("li",{children:[t("strong",{children:"Webhook validation"})," - Test webhook endpoint reachability"]})]}),t("p",{className:"text-muted-foreground",children:'Failed health checks update the connection status to "error" and trigger alerts.'})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Secret management"}),t("p",{className:"text-muted-foreground",children:"Secrets (API keys, tokens) are never stored in plaintext:"}),l("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[t("li",{children:"User provides secrets through secure UI or API"}),t("li",{children:"Secrets are encrypted using tenant-specific keys"}),t("li",{children:"Encrypted secrets are stored in secure vault (e.g., AWS Secrets Manager)"}),t("li",{children:"IntegrationConnection stores only a reference (secretRef)"}),t("li",{children:"At runtime, secrets are decrypted on-demand and never logged"})]})]}),l("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Best practices"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:"Always maintain separate sandbox and production connections"}),t("li",{children:"Use descriptive connection IDs that include tenant and environment"}),t("li",{children:"Monitor health check status and set up alerts for failures"}),t("li",{children:"Rotate secrets regularly and update secretRef accordingly"}),t("li",{children:"Document the purpose and ownership of each connection"}),t("li",{children:"Test connections in sandbox before enabling in production"})]})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[t(oe,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),l(oe,{href:"/docs/architecture/integration-binding",className:"btn-primary",children:["Integration Binding ",t(De,{size:16})]})]})]})}import ie from"@contractspec/lib.ui-link";import{ChevronRight as qe}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";function ze(){return n("div",{className:"space-y-8",children:[n("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Stripe"}),e("p",{className:"text-muted-foreground",children:"The Stripe integration enables payment processing, subscription management, and invoicing in your ContractSpec applications. All Stripe operations are type-safe, policy-enforced, and automatically logged."})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Setup"}),e("p",{className:"text-muted-foreground",children:"Add your Stripe credentials to your environment variables:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`# .env
720
+ }`})})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Health checks"}),t("p",{className:"text-muted-foreground",children:"IntegrationConnections are periodically health-checked to ensure they remain valid:"}),d("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[d("li",{children:[t("strong",{children:"API key validation"})," - Test that credentials are still valid"]}),d("li",{children:[t("strong",{children:"Connectivity check"})," - Verify network access to the provider"]}),d("li",{children:[t("strong",{children:"Permission verification"})," - Ensure required scopes are granted"]}),d("li",{children:[t("strong",{children:"Webhook validation"})," - Test webhook endpoint reachability"]})]}),t("p",{className:"text-muted-foreground",children:'Failed health checks update the connection status to "error" and trigger alerts.'})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Secret management"}),t("p",{className:"text-muted-foreground",children:"Secrets (API keys, tokens) are never stored in plaintext:"}),d("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[t("li",{children:"User provides secrets through secure UI or API"}),t("li",{children:"Secrets are encrypted using tenant-specific keys"}),t("li",{children:"Encrypted secrets are stored in secure vault (e.g., AWS Secrets Manager)"}),t("li",{children:"IntegrationConnection stores only a reference (secretRef)"}),t("li",{children:"At runtime, secrets are decrypted on-demand and never logged"})]})]}),d("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Best practices"}),d("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:"Always maintain separate sandbox and production connections"}),t("li",{children:"Use descriptive connection IDs that include tenant and environment"}),t("li",{children:"Monitor health check status and set up alerts for failures"}),t("li",{children:"Rotate secrets regularly and update secretRef accordingly"}),t("li",{children:"Document the purpose and ownership of each connection"}),t("li",{children:"Test connections in sandbox before enabling in production"})]})]}),d("div",{className:"flex items-center gap-4 pt-4",children:[t(de,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),d(de,{href:"/docs/architecture/integration-binding",className:"btn-primary",children:["Integration Binding ",t(Ve,{size:16})]})]})]})}import ne from"@contractspec/lib.ui-link";import{ChevronRight as Ye}from"lucide-react";import{jsx as e,jsxs as n}from"react/jsx-runtime";function Ze(){return n("div",{className:"space-y-8",children:[n("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Stripe"}),e("p",{className:"text-muted-foreground",children:"The Stripe integration enables payment processing, subscription management, and invoicing in your ContractSpec applications. All Stripe operations are type-safe, policy-enforced, and automatically logged."})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Setup"}),e("p",{className:"text-muted-foreground",children:"Add your Stripe credentials to your environment variables:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`# .env
701
721
  STRIPE_SECRET_KEY=sk_test_...
702
722
  STRIPE_PUBLISHABLE_KEY=pk_test_...
703
723
  STRIPE_WEBHOOK_SECRET=whsec_...`})}),n("p",{className:"text-muted-foreground text-sm",children:["Get your API keys from the"," ",e("a",{href:"https://dashboard.stripe.com/apikeys",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Stripe Dashboard"}),"."]})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Available capabilities"}),n("div",{className:"space-y-3",children:[e("h3",{className:"font-semibold text-lg",children:"Payment Intents"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`capabilityId: stripe-create-payment-intent
@@ -800,10 +820,10 @@ steps:
800
820
  to: "admin@example.com"
801
821
  template: "payment-error"
802
822
  data:
803
- error: \${error.message}`})})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Testing"}),e("p",{className:"text-muted-foreground",children:"Use Stripe's test cards for development:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:n("table",{className:"w-full text-left text-sm",children:[e("thead",{className:"bg-card/50",children:n("tr",{className:"border-border/50 border-b",children:[e("th",{className:"px-4 py-3 font-semibold",children:"Card Number"}),e("th",{className:"px-4 py-3 font-semibold",children:"Scenario"})]})}),n("tbody",{className:"divide-y divide-border/50",children:[n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4242 4242 4242 4242"}),e("td",{className:"px-4 py-3",children:"Successful payment"})]}),n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 9995"}),e("td",{className:"px-4 py-3",children:"Insufficient funds"})]}),n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 0002"}),e("td",{className:"px-4 py-3",children:"Card declined"})]})]})]})})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),n("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Always use test mode during development"}),e("li",{children:"Verify webhook signatures to prevent fraud"}),e("li",{children:"Handle idempotency for payment operations"}),e("li",{children:"Store customer IDs for recurring payments"}),e("li",{children:"Use metadata to link Stripe objects to your application records"}),e("li",{children:"Monitor failed payments and retry logic"})]})]}),n("div",{className:"flex items-center gap-4 pt-4",children:[e(ie,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),n(ie,{href:"/docs/integrations/postmark",className:"btn-primary",children:["Next: Postmark ",e(qe,{size:16})]})]})]})}import re from"@contractspec/lib.ui-link";import{jsx as c,jsxs as O}from"react/jsx-runtime";function Ge(){return O("div",{className:"space-y-8",children:[O("div",{className:"space-y-4",children:[c("h1",{className:"font-bold text-4xl",children:"Twilio"}),c("p",{className:"text-muted-foreground",children:"Send SMS notifications, alerts, and two-factor authentication codes using Twilio's reliable messaging platform."})]}),O("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Setup"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`# .env
823
+ error: \${error.message}`})})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Testing"}),e("p",{className:"text-muted-foreground",children:"Use Stripe's test cards for development:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:n("table",{className:"w-full text-left text-sm",children:[e("thead",{className:"bg-card/50",children:n("tr",{className:"border-border/50 border-b",children:[e("th",{className:"px-4 py-3 font-semibold",children:"Card Number"}),e("th",{className:"px-4 py-3 font-semibold",children:"Scenario"})]})}),n("tbody",{className:"divide-y divide-border/50",children:[n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4242 4242 4242 4242"}),e("td",{className:"px-4 py-3",children:"Successful payment"})]}),n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 9995"}),e("td",{className:"px-4 py-3",children:"Insufficient funds"})]}),n("tr",{children:[e("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 0002"}),e("td",{className:"px-4 py-3",children:"Card declined"})]})]})]})})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),n("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Always use test mode during development"}),e("li",{children:"Verify webhook signatures to prevent fraud"}),e("li",{children:"Handle idempotency for payment operations"}),e("li",{children:"Store customer IDs for recurring payments"}),e("li",{children:"Use metadata to link Stripe objects to your application records"}),e("li",{children:"Monitor failed payments and retry logic"})]})]}),n("div",{className:"flex items-center gap-4 pt-4",children:[e(ne,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),n(ne,{href:"/docs/integrations/postmark",className:"btn-primary",children:["Next: Postmark ",e(Ye,{size:16})]})]})]})}import ce from"@contractspec/lib.ui-link";import{jsx as p,jsxs as O}from"react/jsx-runtime";function Je(){return O("div",{className:"space-y-8",children:[O("div",{className:"space-y-4",children:[p("h1",{className:"font-bold text-4xl",children:"Twilio"}),p("p",{className:"text-muted-foreground",children:"Send SMS notifications, alerts, and two-factor authentication codes using Twilio's reliable messaging platform."})]}),O("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Setup"}),p("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:p("pre",{children:`# .env
804
824
  TWILIO_ACCOUNT_SID=...
805
825
  TWILIO_AUTH_TOKEN=...
806
- TWILIO_PHONE_NUMBER=+1234567890`})})]}),O("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Sending SMS"}),c("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:c("pre",{children:`capabilityId: twilio-send-sms
826
+ TWILIO_PHONE_NUMBER=+1234567890`})})]}),O("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Sending SMS"}),p("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:p("pre",{children:`capabilityId: twilio-send-sms
807
827
  provider:
808
828
  type: twilio
809
829
  operation: sendSMS
@@ -820,7 +840,7 @@ outputs:
820
840
  messageSid:
821
841
  type: string
822
842
  status:
823
- type: string`})})]}),O("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Use cases"}),O("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[c("li",{children:"Order confirmations and shipping updates"}),c("li",{children:"Two-factor authentication codes"}),c("li",{children:"Appointment reminders"}),c("li",{children:"Alert notifications"})]})]}),O("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Best practices"}),O("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[c("li",{children:"Always use E.164 format for phone numbers (+1234567890)"}),c("li",{children:"Keep messages under 160 characters to avoid splitting"}),c("li",{children:"Implement rate limiting to prevent spam"}),c("li",{children:"Handle delivery failures gracefully"}),c("li",{children:"Respect opt-out requests"})]})]}),O("div",{className:"flex items-center gap-4 pt-4",children:[c(re,{href:"/docs/integrations/s3",className:"btn-ghost",children:"Previous: S3 Storage"}),c(re,{href:"/docs/integrations/slack",className:"btn-primary",children:"Next: Slack Messaging"})]})]})}import de from"@contractspec/lib.ui-link";import{ChevronRight as Ve}from"lucide-react";import{jsx as f,jsxs as I}from"react/jsx-runtime";function Fe(){return I("div",{className:"space-y-8",children:[I("div",{className:"space-y-4",children:[f("h1",{className:"font-bold text-4xl",children:"WhatsApp Meta"}),f("p",{className:"text-muted-foreground",children:"Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."})]}),I("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:`// secret payload
843
+ type: string`})})]}),O("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Use cases"}),O("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[p("li",{children:"Order confirmations and shipping updates"}),p("li",{children:"Two-factor authentication codes"}),p("li",{children:"Appointment reminders"}),p("li",{children:"Alert notifications"})]})]}),O("div",{className:"space-y-4",children:[p("h2",{className:"font-bold text-2xl",children:"Best practices"}),O("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[p("li",{children:"Always use E.164 format for phone numbers (+1234567890)"}),p("li",{children:"Keep messages under 160 characters to avoid splitting"}),p("li",{children:"Implement rate limiting to prevent spam"}),p("li",{children:"Handle delivery failures gracefully"}),p("li",{children:"Respect opt-out requests"})]})]}),O("div",{className:"flex items-center gap-4 pt-4",children:[p(ce,{href:"/docs/integrations/s3",className:"btn-ghost",children:"Previous: S3 Storage"}),p(ce,{href:"/docs/integrations/slack",className:"btn-primary",children:"Next: Slack Messaging"})]})]})}import pe from"@contractspec/lib.ui-link";import{ChevronRight as Xe}from"lucide-react";import{jsx as h,jsxs as I}from"react/jsx-runtime";function $e(){return I("div",{className:"space-y-8",children:[I("div",{className:"space-y-4",children:[h("h1",{className:"font-bold text-4xl",children:"WhatsApp Meta"}),h("p",{className:"text-muted-foreground",children:"Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."})]}),I("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),h("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:h("pre",{children:`// secret payload
824
844
  {
825
845
  "accessToken": "...",
826
846
  "appSecret": "...",
@@ -831,7 +851,7 @@ outputs:
831
851
  {
832
852
  "phoneNumberId": "120000000001",
833
853
  "apiVersion": "v22.0"
834
- }`})})]}),I("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Webhook endpoints"}),I("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[I("li",{children:["Verification challenge:"," ",f("code",{className:"rounded bg-background/50 px-2 py-1",children:"GET /webhooks/whatsapp/meta"})]}),I("li",{children:["Inbound messages:"," ",f("code",{className:"rounded bg-background/50 px-2 py-1",children:"POST /webhooks/whatsapp/meta"})]}),I("li",{children:["Signatures are validated with"," ",f("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-hub-signature-256"}),"."]})]})]}),I("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),f("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:f("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_META={"120000000001":"workspace-acme"}'})})]}),I("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Best practices"}),I("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[f("li",{children:"Keep verify and app secrets separate from access tokens."}),f("li",{children:"Map each phone number ID to a workspace for strict tenant routing."}),f("li",{children:"Use Twilio WhatsApp only as fallback when you need active-passive routing."})]})]}),I("div",{className:"flex items-center gap-4 pt-4",children:[f(de,{href:"/docs/integrations/github",className:"btn-ghost",children:"Previous: GitHub Messaging"}),I(de,{href:"/docs/integrations/whatsapp-twilio",className:"btn-primary",children:["Next: WhatsApp Twilio ",f(Ve,{size:16})]})]})]})}import le from"@contractspec/lib.ui-link";import{ChevronRight as Ye}from"lucide-react";import{jsx as h,jsxs as A}from"react/jsx-runtime";function Ze(){return A("div",{className:"space-y-8",children:[A("div",{className:"space-y-4",children:[h("h1",{className:"font-bold text-4xl",children:"WhatsApp Twilio"}),h("p",{className:"text-muted-foreground",children:"Twilio WhatsApp support provides a durable fallback channel with signature verification and outbox-backed outbound dispatch."})]}),A("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),h("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:h("pre",{children:`// secret payload
854
+ }`})})]}),I("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Webhook endpoints"}),I("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[I("li",{children:["Verification challenge:"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"GET /webhooks/whatsapp/meta"})]}),I("li",{children:["Inbound messages:"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"POST /webhooks/whatsapp/meta"})]}),I("li",{children:["Signatures are validated with"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-hub-signature-256"}),"."]})]})]}),I("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),h("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:h("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_META={"120000000001":"workspace-acme"}'})})]}),I("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Best practices"}),I("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[h("li",{children:"Keep verify and app secrets separate from access tokens."}),h("li",{children:"Map each phone number ID to a workspace for strict tenant routing."}),h("li",{children:"Use Twilio WhatsApp only as fallback when you need active-passive routing."})]})]}),I("div",{className:"flex items-center gap-4 pt-4",children:[h(pe,{href:"/docs/integrations/github",className:"btn-ghost",children:"Previous: GitHub Messaging"}),I(pe,{href:"/docs/integrations/whatsapp-twilio",className:"btn-primary",children:["Next: WhatsApp Twilio ",h(Xe,{size:16})]})]})]})}import me from"@contractspec/lib.ui-link";import{ChevronRight as xe}from"lucide-react";import{jsx as v,jsxs as A}from"react/jsx-runtime";function je(){return A("div",{className:"space-y-8",children:[A("div",{className:"space-y-4",children:[v("h1",{className:"font-bold text-4xl",children:"WhatsApp Twilio"}),v("p",{className:"text-muted-foreground",children:"Twilio WhatsApp support provides a durable fallback channel with signature verification and outbox-backed outbound dispatch."})]}),A("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),v("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:v("pre",{children:`// secret payload
835
855
  {
836
856
  "accountSid": "AC123",
837
857
  "authToken": "..."
@@ -840,4 +860,4 @@ outputs:
840
860
  // optional connection config
841
861
  {
842
862
  "fromNumber": "whatsapp:+15550002"
843
- }`})})]}),A("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),A("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[A("li",{children:["Inbound Twilio form payloads are accepted on"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/whatsapp/twilio"}),"."]}),A("li",{children:["Signatures are validated with"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-twilio-signature"})," ","and the configured auth token."]}),A("li",{children:["For deterministic verification, set the exact public webhook URL in"," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"WHATSAPP_TWILIO_WEBHOOK_URL"}),"."]})]})]}),A("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),h("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:h("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}'})})]}),A("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Best practices"}),A("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[h("li",{children:"Use Twilio as fallback when Meta WhatsApp is your primary route."}),h("li",{children:"Keep account SID mapping explicit to avoid tenant misrouting."}),A("li",{children:["Protect internal dispatch endpoints with",h("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"CHANNEL_DISPATCH_TOKEN"}),"."]})]})]}),A("div",{className:"flex items-center gap-4 pt-4",children:[h(le,{href:"/docs/integrations/whatsapp-meta",className:"btn-ghost",children:"Previous: WhatsApp Meta"}),A(le,{href:"/docs/integrations/health-routing",className:"btn-primary",children:["Next: Health Routing ",h(Ye,{size:16})]})]})]})}export{Ze as IntegrationsWhatsappTwilioPage,Fe as IntegrationsWhatsappMetaPage,Ge as IntegrationsTwilioPage,ze as IntegrationsStripePage,se as IntegrationsSpecModelPage,Re as IntegrationsSlackPage,Be as IntegrationsS3Page,Oe as IntegrationsResendPage,Ce as IntegrationsQdrantPage,Ee as IntegrationsPowensPage,Me as IntegrationsPostmarkPage,We as IntegrationsOverviewPage,Ie as IntegrationsOpenAIPage,Ae as IntegrationsMistralPage,ke as IntegrationsHealthRoutingPage,ye as IntegrationsGoogleCalendarPage,ve as IntegrationsGmailPage,he as IntegrationsGithubPage,ge as IntegrationsElevenLabsPage,me as IntegrationsCircuitBreakersPage};
863
+ }`})})]}),A("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),A("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[A("li",{children:["Inbound Twilio form payloads are accepted on"," ",v("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/whatsapp/twilio"}),"."]}),A("li",{children:["Signatures are validated with"," ",v("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-twilio-signature"})," ","and the configured auth token."]}),A("li",{children:["For deterministic verification, set the exact public webhook URL in"," ",v("code",{className:"rounded bg-background/50 px-2 py-1",children:"WHATSAPP_TWILIO_WEBHOOK_URL"}),"."]})]})]}),A("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),v("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:v("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}'})})]}),A("div",{className:"space-y-4",children:[v("h2",{className:"font-bold text-2xl",children:"Best practices"}),A("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[v("li",{children:"Use Twilio as fallback when Meta WhatsApp is your primary route."}),v("li",{children:"Keep account SID mapping explicit to avoid tenant misrouting."}),A("li",{children:["Protect internal dispatch endpoints with",v("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"CHANNEL_DISPATCH_TOKEN"}),"."]})]})]}),A("div",{className:"flex items-center gap-4 pt-4",children:[v(me,{href:"/docs/integrations/whatsapp-meta",className:"btn-ghost",children:"Previous: WhatsApp Meta"}),A(me,{href:"/docs/integrations/health-routing",className:"btn-primary",children:["Next: Health Routing ",v(xe,{size:16})]})]})]})}export{je as IntegrationsWhatsappTwilioPage,$e as IntegrationsWhatsappMetaPage,Je as IntegrationsTwilioPage,Ze as IntegrationsStripePage,Qe as IntegrationsSpecModelPage,Fe as IntegrationsSlackPage,qe as IntegrationsS3Page,Ge as IntegrationsResendPage,Re as IntegrationsQdrantPage,Le as IntegrationsPowensPage,Ee as IntegrationsPostmarkPage,He as IntegrationsOverviewPage,Se as IntegrationsOpenAIPage,We as IntegrationsMistralPage,Te as IntegrationsHealthRoutingPage,Ie as IntegrationsGoogleDrivePage,Ae as IntegrationsGoogleCalendarPage,we as IntegrationsGmailPage,ye as IntegrationsGithubPage,be as IntegrationsElevenLabsPage,he as IntegrationsCircuitBreakersPage};