@contractspec/lib.contracts-integrations 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/README.md +3 -0
  2. package/dist/index.d.ts +11 -0
  3. package/dist/index.js +3676 -0
  4. package/dist/integrations/binding.d.ts +14 -0
  5. package/dist/integrations/binding.js +1 -0
  6. package/dist/integrations/connection.d.ts +47 -0
  7. package/dist/integrations/connection.js +1 -0
  8. package/dist/integrations/docs/integrations.docblock.d.ts +2 -0
  9. package/dist/integrations/docs/integrations.docblock.js +110 -0
  10. package/dist/integrations/health.d.ts +17 -0
  11. package/dist/integrations/health.js +73 -0
  12. package/dist/integrations/health.test.d.ts +1 -0
  13. package/dist/integrations/index.d.ts +11 -0
  14. package/dist/integrations/index.js +3264 -0
  15. package/dist/integrations/integrations.capability.d.ts +1 -0
  16. package/dist/integrations/integrations.capability.js +18 -0
  17. package/dist/integrations/integrations.feature.d.ts +5 -0
  18. package/dist/integrations/integrations.feature.js +33 -0
  19. package/dist/integrations/meeting-recorder/contracts/index.d.ts +7 -0
  20. package/dist/integrations/meeting-recorder/contracts/index.js +474 -0
  21. package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +451 -0
  22. package/dist/integrations/meeting-recorder/contracts/meetings.js +219 -0
  23. package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +166 -0
  24. package/dist/integrations/meeting-recorder/contracts/transcripts.js +287 -0
  25. package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +85 -0
  26. package/dist/integrations/meeting-recorder/contracts/webhooks.js +172 -0
  27. package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +1 -0
  28. package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +18 -0
  29. package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +5 -0
  30. package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +33 -0
  31. package/dist/integrations/meeting-recorder/models.d.ts +402 -0
  32. package/dist/integrations/meeting-recorder/models.js +122 -0
  33. package/dist/integrations/meeting-recorder/telemetry.d.ts +13 -0
  34. package/dist/integrations/meeting-recorder/telemetry.js +54 -0
  35. package/dist/integrations/openbanking/contracts/accounts.d.ts +282 -0
  36. package/dist/integrations/openbanking/contracts/accounts.js +328 -0
  37. package/dist/integrations/openbanking/contracts/balances.d.ts +158 -0
  38. package/dist/integrations/openbanking/contracts/balances.js +292 -0
  39. package/dist/integrations/openbanking/contracts/index.d.ts +7 -0
  40. package/dist/integrations/openbanking/contracts/index.js +644 -0
  41. package/dist/integrations/openbanking/contracts/transactions.d.ts +206 -0
  42. package/dist/integrations/openbanking/contracts/transactions.js +298 -0
  43. package/dist/integrations/openbanking/guards.d.ts +8 -0
  44. package/dist/integrations/openbanking/guards.js +42 -0
  45. package/dist/integrations/openbanking/guards.test.d.ts +1 -0
  46. package/dist/integrations/openbanking/models.d.ts +223 -0
  47. package/dist/integrations/openbanking/models.js +110 -0
  48. package/dist/integrations/openbanking/openbanking.capability.d.ts +1 -0
  49. package/dist/integrations/openbanking/openbanking.capability.js +18 -0
  50. package/dist/integrations/openbanking/openbanking.feature.d.ts +5 -0
  51. package/dist/integrations/openbanking/openbanking.feature.js +35 -0
  52. package/dist/integrations/openbanking/telemetry.d.ts +12 -0
  53. package/dist/integrations/openbanking/telemetry.js +51 -0
  54. package/dist/integrations/operations.d.ts +430 -0
  55. package/dist/integrations/operations.js +297 -0
  56. package/dist/integrations/operations.test.d.ts +1 -0
  57. package/dist/integrations/providers/analytics-reader.d.ts +103 -0
  58. package/dist/integrations/providers/analytics-reader.js +1 -0
  59. package/dist/integrations/providers/analytics-writer.d.ts +6 -0
  60. package/dist/integrations/providers/analytics-writer.js +1 -0
  61. package/dist/integrations/providers/analytics.d.ts +47 -0
  62. package/dist/integrations/providers/analytics.js +1 -0
  63. package/dist/integrations/providers/calendar.d.ts +75 -0
  64. package/dist/integrations/providers/calendar.js +1 -0
  65. package/dist/integrations/providers/database.d.ts +12 -0
  66. package/dist/integrations/providers/database.js +1 -0
  67. package/dist/integrations/providers/elevenlabs.d.ts +3 -0
  68. package/dist/integrations/providers/elevenlabs.js +86 -0
  69. package/dist/integrations/providers/email.d.ts +83 -0
  70. package/dist/integrations/providers/email.js +1 -0
  71. package/dist/integrations/providers/embedding.d.ts +21 -0
  72. package/dist/integrations/providers/embedding.js +1 -0
  73. package/dist/integrations/providers/fal.d.ts +3 -0
  74. package/dist/integrations/providers/fal.js +112 -0
  75. package/dist/integrations/providers/fathom.d.ts +3 -0
  76. package/dist/integrations/providers/fathom.js +126 -0
  77. package/dist/integrations/providers/fireflies.d.ts +3 -0
  78. package/dist/integrations/providers/fireflies.js +106 -0
  79. package/dist/integrations/providers/gcs-storage.d.ts +3 -0
  80. package/dist/integrations/providers/gcs-storage.js +97 -0
  81. package/dist/integrations/providers/gmail.d.ts +3 -0
  82. package/dist/integrations/providers/gmail.js +109 -0
  83. package/dist/integrations/providers/google-calendar.d.ts +3 -0
  84. package/dist/integrations/providers/google-calendar.js +92 -0
  85. package/dist/integrations/providers/gradium.d.ts +3 -0
  86. package/dist/integrations/providers/gradium.js +110 -0
  87. package/dist/integrations/providers/granola.d.ts +3 -0
  88. package/dist/integrations/providers/granola.js +107 -0
  89. package/dist/integrations/providers/index.d.ts +38 -0
  90. package/dist/integrations/providers/index.js +2094 -0
  91. package/dist/integrations/providers/jira.d.ts +3 -0
  92. package/dist/integrations/providers/jira.js +108 -0
  93. package/dist/integrations/providers/linear.d.ts +3 -0
  94. package/dist/integrations/providers/linear.js +107 -0
  95. package/dist/integrations/providers/llm.d.ts +79 -0
  96. package/dist/integrations/providers/llm.js +1 -0
  97. package/dist/integrations/providers/meeting-recorder.d.ts +129 -0
  98. package/dist/integrations/providers/meeting-recorder.js +1 -0
  99. package/dist/integrations/providers/mistral.d.ts +3 -0
  100. package/dist/integrations/providers/mistral.js +94 -0
  101. package/dist/integrations/providers/notion.d.ts +3 -0
  102. package/dist/integrations/providers/notion.js +113 -0
  103. package/dist/integrations/providers/openbanking.d.ts +125 -0
  104. package/dist/integrations/providers/openbanking.js +1 -0
  105. package/dist/integrations/providers/payments.d.ts +106 -0
  106. package/dist/integrations/providers/payments.js +1 -0
  107. package/dist/integrations/providers/posthog-llm-telemetry.d.ts +51 -0
  108. package/dist/integrations/providers/posthog-llm-telemetry.js +176 -0
  109. package/dist/integrations/providers/posthog.d.ts +3 -0
  110. package/dist/integrations/providers/posthog.js +106 -0
  111. package/dist/integrations/providers/postmark.d.ts +3 -0
  112. package/dist/integrations/providers/postmark.js +98 -0
  113. package/dist/integrations/providers/powens.d.ts +3 -0
  114. package/dist/integrations/providers/powens.js +124 -0
  115. package/dist/integrations/providers/project-management.d.ts +32 -0
  116. package/dist/integrations/providers/project-management.js +1 -0
  117. package/dist/integrations/providers/providers.test.d.ts +1 -0
  118. package/dist/integrations/providers/qdrant.d.ts +3 -0
  119. package/dist/integrations/providers/qdrant.js +101 -0
  120. package/dist/integrations/providers/registry.d.ts +6 -0
  121. package/dist/integrations/providers/registry.js +1878 -0
  122. package/dist/integrations/providers/sms.d.ts +31 -0
  123. package/dist/integrations/providers/sms.js +1 -0
  124. package/dist/integrations/providers/storage.d.ts +57 -0
  125. package/dist/integrations/providers/storage.js +1 -0
  126. package/dist/integrations/providers/stripe.d.ts +3 -0
  127. package/dist/integrations/providers/stripe.js +105 -0
  128. package/dist/integrations/providers/supabase-postgres.d.ts +3 -0
  129. package/dist/integrations/providers/supabase-postgres.js +87 -0
  130. package/dist/integrations/providers/supabase-vector.d.ts +3 -0
  131. package/dist/integrations/providers/supabase-vector.js +107 -0
  132. package/dist/integrations/providers/tldv.d.ts +3 -0
  133. package/dist/integrations/providers/tldv.js +106 -0
  134. package/dist/integrations/providers/twilio-sms.d.ts +3 -0
  135. package/dist/integrations/providers/twilio-sms.js +91 -0
  136. package/dist/integrations/providers/vector-store.d.ts +39 -0
  137. package/dist/integrations/providers/vector-store.js +1 -0
  138. package/dist/integrations/providers/voice.d.ts +31 -0
  139. package/dist/integrations/providers/voice.js +1 -0
  140. package/dist/integrations/runtime.d.ts +95 -0
  141. package/dist/integrations/runtime.js +209 -0
  142. package/dist/integrations/runtime.test.d.ts +1 -0
  143. package/dist/integrations/secrets/aws-secret-manager.d.ts +28 -0
  144. package/dist/integrations/secrets/aws-secret-manager.js +346 -0
  145. package/dist/integrations/secrets/env-secret-provider.d.ts +28 -0
  146. package/dist/integrations/secrets/env-secret-provider.js +159 -0
  147. package/dist/integrations/secrets/gcp-secret-manager.d.ts +29 -0
  148. package/dist/integrations/secrets/gcp-secret-manager.js +347 -0
  149. package/dist/integrations/secrets/index.d.ts +6 -0
  150. package/dist/integrations/secrets/index.js +1129 -0
  151. package/dist/integrations/secrets/manager.d.ts +44 -0
  152. package/dist/integrations/secrets/manager.js +183 -0
  153. package/dist/integrations/secrets/provider.d.ts +49 -0
  154. package/dist/integrations/secrets/provider.js +74 -0
  155. package/dist/integrations/secrets/provider.test.d.ts +1 -0
  156. package/dist/integrations/secrets/scaleway-secret-manager.d.ts +35 -0
  157. package/dist/integrations/secrets/scaleway-secret-manager.js +375 -0
  158. package/dist/integrations/secrets-types.d.ts +14 -0
  159. package/dist/integrations/secrets-types.js +1 -0
  160. package/dist/integrations/spec.d.ts +72 -0
  161. package/dist/integrations/spec.js +22 -0
  162. package/dist/integrations/spec.test.d.ts +1 -0
  163. package/dist/node/index.js +3675 -0
  164. package/dist/node/integrations/binding.js +0 -0
  165. package/dist/node/integrations/connection.js +0 -0
  166. package/dist/node/integrations/docs/integrations.docblock.js +109 -0
  167. package/dist/node/integrations/health.js +72 -0
  168. package/dist/node/integrations/index.js +3263 -0
  169. package/dist/node/integrations/integrations.capability.js +17 -0
  170. package/dist/node/integrations/integrations.feature.js +32 -0
  171. package/dist/node/integrations/meeting-recorder/contracts/index.js +473 -0
  172. package/dist/node/integrations/meeting-recorder/contracts/meetings.js +218 -0
  173. package/dist/node/integrations/meeting-recorder/contracts/transcripts.js +286 -0
  174. package/dist/node/integrations/meeting-recorder/contracts/webhooks.js +171 -0
  175. package/dist/node/integrations/meeting-recorder/meeting-recorder.capability.js +17 -0
  176. package/dist/node/integrations/meeting-recorder/meeting-recorder.feature.js +32 -0
  177. package/dist/node/integrations/meeting-recorder/models.js +121 -0
  178. package/dist/node/integrations/meeting-recorder/telemetry.js +53 -0
  179. package/dist/node/integrations/openbanking/contracts/accounts.js +327 -0
  180. package/dist/node/integrations/openbanking/contracts/balances.js +291 -0
  181. package/dist/node/integrations/openbanking/contracts/index.js +643 -0
  182. package/dist/node/integrations/openbanking/contracts/transactions.js +297 -0
  183. package/dist/node/integrations/openbanking/guards.js +41 -0
  184. package/dist/node/integrations/openbanking/models.js +109 -0
  185. package/dist/node/integrations/openbanking/openbanking.capability.js +17 -0
  186. package/dist/node/integrations/openbanking/openbanking.feature.js +34 -0
  187. package/dist/node/integrations/openbanking/telemetry.js +50 -0
  188. package/dist/node/integrations/operations.js +296 -0
  189. package/dist/node/integrations/providers/analytics-reader.js +0 -0
  190. package/dist/node/integrations/providers/analytics-writer.js +0 -0
  191. package/dist/node/integrations/providers/analytics.js +0 -0
  192. package/dist/node/integrations/providers/calendar.js +0 -0
  193. package/dist/node/integrations/providers/database.js +0 -0
  194. package/dist/node/integrations/providers/elevenlabs.js +85 -0
  195. package/dist/node/integrations/providers/email.js +0 -0
  196. package/dist/node/integrations/providers/embedding.js +0 -0
  197. package/dist/node/integrations/providers/fal.js +111 -0
  198. package/dist/node/integrations/providers/fathom.js +125 -0
  199. package/dist/node/integrations/providers/fireflies.js +105 -0
  200. package/dist/node/integrations/providers/gcs-storage.js +96 -0
  201. package/dist/node/integrations/providers/gmail.js +108 -0
  202. package/dist/node/integrations/providers/google-calendar.js +91 -0
  203. package/dist/node/integrations/providers/gradium.js +109 -0
  204. package/dist/node/integrations/providers/granola.js +106 -0
  205. package/dist/node/integrations/providers/index.js +2093 -0
  206. package/dist/node/integrations/providers/jira.js +107 -0
  207. package/dist/node/integrations/providers/linear.js +106 -0
  208. package/dist/node/integrations/providers/llm.js +0 -0
  209. package/dist/node/integrations/providers/meeting-recorder.js +0 -0
  210. package/dist/node/integrations/providers/mistral.js +93 -0
  211. package/dist/node/integrations/providers/notion.js +112 -0
  212. package/dist/node/integrations/providers/openbanking.js +0 -0
  213. package/dist/node/integrations/providers/payments.js +0 -0
  214. package/dist/node/integrations/providers/posthog-llm-telemetry.js +175 -0
  215. package/dist/node/integrations/providers/posthog.js +105 -0
  216. package/dist/node/integrations/providers/postmark.js +97 -0
  217. package/dist/node/integrations/providers/powens.js +123 -0
  218. package/dist/node/integrations/providers/project-management.js +0 -0
  219. package/dist/node/integrations/providers/qdrant.js +100 -0
  220. package/dist/node/integrations/providers/registry.js +1877 -0
  221. package/dist/node/integrations/providers/sms.js +0 -0
  222. package/dist/node/integrations/providers/storage.js +0 -0
  223. package/dist/node/integrations/providers/stripe.js +104 -0
  224. package/dist/node/integrations/providers/supabase-postgres.js +86 -0
  225. package/dist/node/integrations/providers/supabase-vector.js +106 -0
  226. package/dist/node/integrations/providers/tldv.js +105 -0
  227. package/dist/node/integrations/providers/twilio-sms.js +90 -0
  228. package/dist/node/integrations/providers/vector-store.js +0 -0
  229. package/dist/node/integrations/providers/voice.js +0 -0
  230. package/dist/node/integrations/runtime.js +208 -0
  231. package/dist/node/integrations/secrets/aws-secret-manager.js +345 -0
  232. package/dist/node/integrations/secrets/env-secret-provider.js +158 -0
  233. package/dist/node/integrations/secrets/gcp-secret-manager.js +346 -0
  234. package/dist/node/integrations/secrets/index.js +1128 -0
  235. package/dist/node/integrations/secrets/manager.js +182 -0
  236. package/dist/node/integrations/secrets/provider.js +73 -0
  237. package/dist/node/integrations/secrets/scaleway-secret-manager.js +374 -0
  238. package/dist/node/integrations/secrets-types.js +0 -0
  239. package/dist/node/integrations/spec.js +21 -0
  240. package/package.json +1029 -0
@@ -0,0 +1,31 @@
1
+ export interface SmsMessage {
2
+ id: string;
3
+ to: string;
4
+ from: string;
5
+ body: string;
6
+ status: 'queued' | 'sending' | 'sent' | 'delivered' | 'undelivered' | 'failed';
7
+ providerMessageId?: string;
8
+ carrier?: string;
9
+ price?: number;
10
+ priceCurrency?: string;
11
+ sentAt?: Date;
12
+ deliveredAt?: Date;
13
+ errorCode?: string;
14
+ errorMessage?: string;
15
+ }
16
+ export interface SendSmsInput {
17
+ to: string;
18
+ from?: string;
19
+ body: string;
20
+ metadata?: Record<string, string>;
21
+ }
22
+ export interface SmsDeliveryStatus {
23
+ status: SmsMessage['status'];
24
+ errorCode?: string;
25
+ errorMessage?: string;
26
+ updatedAt: Date;
27
+ }
28
+ export interface SmsProvider {
29
+ sendSms(input: SendSmsInput): Promise<SmsMessage>;
30
+ getDeliveryStatus(messageId: string): Promise<SmsDeliveryStatus>;
31
+ }
@@ -0,0 +1 @@
1
+ // @bun
@@ -0,0 +1,57 @@
1
+ export interface StorageObjectMetadata {
2
+ bucket: string;
3
+ key: string;
4
+ sizeBytes?: number;
5
+ contentType?: string;
6
+ etag?: string;
7
+ checksum?: string;
8
+ lastModified?: Date;
9
+ metadata?: Record<string, string>;
10
+ }
11
+ export type StorageObjectBody = {
12
+ data: Uint8Array;
13
+ stream?: never;
14
+ } | {
15
+ data?: never;
16
+ stream: AsyncIterable<Uint8Array>;
17
+ };
18
+ export type GetObjectResult = StorageObjectMetadata & StorageObjectBody;
19
+ export interface PutObjectInput {
20
+ bucket: string;
21
+ key: string;
22
+ data: Uint8Array | ArrayBuffer;
23
+ contentType?: string;
24
+ metadata?: Record<string, string>;
25
+ makePublic?: boolean;
26
+ }
27
+ export interface DeleteObjectInput {
28
+ bucket: string;
29
+ key: string;
30
+ }
31
+ export interface SignedUrlOptions {
32
+ bucket: string;
33
+ key: string;
34
+ expiresInSeconds: number;
35
+ method?: 'GET' | 'PUT';
36
+ contentType?: string;
37
+ }
38
+ export interface ListObjectsQuery {
39
+ bucket: string;
40
+ prefix?: string;
41
+ maxResults?: number;
42
+ pageToken?: string;
43
+ }
44
+ export interface ListObjectsResult {
45
+ objects: StorageObjectMetadata[];
46
+ nextPageToken?: string;
47
+ }
48
+ export interface ObjectStorageProvider {
49
+ putObject(input: PutObjectInput): Promise<StorageObjectMetadata>;
50
+ getObject(input: DeleteObjectInput): Promise<GetObjectResult | null>;
51
+ deleteObject(input: DeleteObjectInput): Promise<void>;
52
+ generateSignedUrl(options: SignedUrlOptions): Promise<{
53
+ url: string;
54
+ expiresAt: Date;
55
+ }>;
56
+ listObjects(query: ListObjectsQuery): Promise<ListObjectsResult>;
57
+ }
@@ -0,0 +1 @@
1
+ // @bun
@@ -0,0 +1,3 @@
1
+ import { IntegrationSpecRegistry } from '../spec';
2
+ export declare const stripeIntegrationSpec: import("..").IntegrationSpec;
3
+ export declare function registerStripeIntegration(registry: IntegrationSpecRegistry): IntegrationSpecRegistry;
@@ -0,0 +1,105 @@
1
+ // @bun
2
+ // src/integrations/spec.ts
3
+ import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
4
+ var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
5
+
6
+ class IntegrationSpecRegistry extends SpecContractRegistry {
7
+ constructor(items) {
8
+ super("integration", items);
9
+ }
10
+ getByCategory(category) {
11
+ return this.list().filter((spec) => spec.meta.category === category);
12
+ }
13
+ }
14
+ function makeIntegrationSpecKey(meta) {
15
+ return integrationKey(meta);
16
+ }
17
+ var defineIntegration = (spec) => spec;
18
+
19
+ // src/integrations/providers/stripe.ts
20
+ import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
21
+ var stripeIntegrationSpec = defineIntegration({
22
+ meta: {
23
+ key: "payments.stripe",
24
+ version: "1.0.0",
25
+ category: "payments",
26
+ title: "Stripe Payments",
27
+ description: "Stripe integration for payment processing, charges, and payouts.",
28
+ domain: "payments",
29
+ owners: ["platform.payments"],
30
+ tags: ["payments", "psp"],
31
+ stability: StabilityEnum.Stable
32
+ },
33
+ supportedModes: ["managed", "byok"],
34
+ capabilities: {
35
+ provides: [{ key: "payments.psp", version: "1.0.0" }],
36
+ requires: [
37
+ {
38
+ key: "platform.webhooks",
39
+ optional: true,
40
+ reason: "Recommended for reliable event ingestion"
41
+ }
42
+ ]
43
+ },
44
+ configSchema: {
45
+ schema: {
46
+ type: "object",
47
+ properties: {
48
+ accountId: {
49
+ type: "string",
50
+ description: "Connected account ID when using Stripe Connect (BYOK)."
51
+ },
52
+ region: {
53
+ type: "string",
54
+ description: "Optional Stripe region or data residency hint."
55
+ }
56
+ }
57
+ },
58
+ example: {
59
+ accountId: "acct_123",
60
+ region: "us-east-1"
61
+ }
62
+ },
63
+ secretSchema: {
64
+ schema: {
65
+ type: "object",
66
+ required: ["apiKey", "webhookSecret"],
67
+ properties: {
68
+ apiKey: {
69
+ type: "string",
70
+ description: "Stripe secret API key (sk_live_... or sk_test_...)."
71
+ },
72
+ webhookSecret: {
73
+ type: "string",
74
+ description: "Signing secret for webhook verification."
75
+ }
76
+ }
77
+ },
78
+ example: {
79
+ apiKey: "sk_live_***",
80
+ webhookSecret: "whsec_***"
81
+ }
82
+ },
83
+ healthCheck: {
84
+ method: "ping",
85
+ timeoutMs: 5000
86
+ },
87
+ docsUrl: "https://stripe.com/docs/api",
88
+ constraints: {
89
+ rateLimit: {
90
+ rpm: 1000,
91
+ rph: 20000
92
+ }
93
+ },
94
+ byokSetup: {
95
+ setupInstructions: "Create a restricted Stripe API key with write access to Charges and provide a webhook signing secret.",
96
+ requiredScopes: ["charges:write", "customers:read"]
97
+ }
98
+ });
99
+ function registerStripeIntegration(registry) {
100
+ return registry.register(stripeIntegrationSpec);
101
+ }
102
+ export {
103
+ stripeIntegrationSpec,
104
+ registerStripeIntegration
105
+ };
@@ -0,0 +1,3 @@
1
+ import { IntegrationSpecRegistry } from '../spec';
2
+ export declare const supabasePostgresIntegrationSpec: import("..").IntegrationSpec;
3
+ export declare function registerSupabasePostgresIntegration(registry: IntegrationSpecRegistry): IntegrationSpecRegistry;
@@ -0,0 +1,87 @@
1
+ // @bun
2
+ // src/integrations/spec.ts
3
+ import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
4
+ var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
5
+
6
+ class IntegrationSpecRegistry extends SpecContractRegistry {
7
+ constructor(items) {
8
+ super("integration", items);
9
+ }
10
+ getByCategory(category) {
11
+ return this.list().filter((spec) => spec.meta.category === category);
12
+ }
13
+ }
14
+ function makeIntegrationSpecKey(meta) {
15
+ return integrationKey(meta);
16
+ }
17
+ var defineIntegration = (spec) => spec;
18
+
19
+ // src/integrations/providers/supabase-postgres.ts
20
+ import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
21
+ var supabasePostgresIntegrationSpec = defineIntegration({
22
+ meta: {
23
+ key: "database.supabase",
24
+ version: "1.0.0",
25
+ category: "database",
26
+ title: "Supabase Postgres",
27
+ description: "Supabase Postgres integration for SQL query execution and transactional workloads.",
28
+ domain: "infrastructure",
29
+ owners: ["platform.infrastructure"],
30
+ tags: ["database", "postgres", "supabase"],
31
+ stability: StabilityEnum.Beta
32
+ },
33
+ supportedModes: ["managed", "byok"],
34
+ capabilities: {
35
+ provides: [{ key: "database.sql", version: "1.0.0" }]
36
+ },
37
+ configSchema: {
38
+ schema: {
39
+ type: "object",
40
+ properties: {
41
+ maxConnections: {
42
+ type: "number",
43
+ description: "Optional connection pool size when opening a Postgres client to Supabase."
44
+ },
45
+ sslMode: {
46
+ type: "string",
47
+ enum: ["require", "allow", "prefer"],
48
+ description: "TLS mode used by the Postgres client."
49
+ }
50
+ }
51
+ },
52
+ example: {
53
+ maxConnections: 10,
54
+ sslMode: "require"
55
+ }
56
+ },
57
+ secretSchema: {
58
+ schema: {
59
+ type: "object",
60
+ required: ["databaseUrl"],
61
+ properties: {
62
+ databaseUrl: {
63
+ type: "string",
64
+ description: "Supabase Postgres connection string (transaction or session pooler endpoint)."
65
+ }
66
+ }
67
+ },
68
+ example: {
69
+ databaseUrl: "postgresql://postgres.[project-ref]:password@aws-0-region.pooler.supabase.com:6543/postgres"
70
+ }
71
+ },
72
+ healthCheck: {
73
+ method: "ping",
74
+ timeoutMs: 5000
75
+ },
76
+ docsUrl: "https://supabase.com/docs/guides/database/connecting-to-postgres",
77
+ byokSetup: {
78
+ setupInstructions: "Create or reuse a Supabase project and provide a Postgres connection string with permissions aligned to your workload."
79
+ }
80
+ });
81
+ function registerSupabasePostgresIntegration(registry) {
82
+ return registry.register(supabasePostgresIntegrationSpec);
83
+ }
84
+ export {
85
+ supabasePostgresIntegrationSpec,
86
+ registerSupabasePostgresIntegration
87
+ };
@@ -0,0 +1,3 @@
1
+ import { IntegrationSpecRegistry } from '../spec';
2
+ export declare const supabaseVectorIntegrationSpec: import("..").IntegrationSpec;
3
+ export declare function registerSupabaseVectorIntegration(registry: IntegrationSpecRegistry): IntegrationSpecRegistry;
@@ -0,0 +1,107 @@
1
+ // @bun
2
+ // src/integrations/spec.ts
3
+ import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
4
+ var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
5
+
6
+ class IntegrationSpecRegistry extends SpecContractRegistry {
7
+ constructor(items) {
8
+ super("integration", items);
9
+ }
10
+ getByCategory(category) {
11
+ return this.list().filter((spec) => spec.meta.category === category);
12
+ }
13
+ }
14
+ function makeIntegrationSpecKey(meta) {
15
+ return integrationKey(meta);
16
+ }
17
+ var defineIntegration = (spec) => spec;
18
+
19
+ // src/integrations/providers/supabase-vector.ts
20
+ import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
21
+ var supabaseVectorIntegrationSpec = defineIntegration({
22
+ meta: {
23
+ key: "vectordb.supabase",
24
+ version: "1.0.0",
25
+ category: "vector-db",
26
+ title: "Supabase Vector Database (pgvector)",
27
+ description: "Supabase integration for embedding storage and vector similarity search using pgvector.",
28
+ domain: "ai",
29
+ owners: ["platform.ai"],
30
+ tags: ["vector-db", "supabase", "pgvector"],
31
+ stability: StabilityEnum.Beta
32
+ },
33
+ supportedModes: ["managed", "byok"],
34
+ capabilities: {
35
+ provides: [
36
+ { key: "vector-db.search", version: "1.0.0" },
37
+ { key: "vector-db.storage", version: "1.0.0" }
38
+ ],
39
+ requires: [
40
+ {
41
+ key: "ai.embeddings",
42
+ optional: true,
43
+ reason: "Required when vectors are generated by a hosted embedding provider."
44
+ }
45
+ ]
46
+ },
47
+ configSchema: {
48
+ schema: {
49
+ type: "object",
50
+ properties: {
51
+ schema: {
52
+ type: "string",
53
+ description: "Schema name containing the pgvector table (default: public)."
54
+ },
55
+ table: {
56
+ type: "string",
57
+ description: "Table used to store vectors and metadata (default: contractspec_vectors)."
58
+ },
59
+ createTableIfMissing: {
60
+ type: "boolean",
61
+ description: "Automatically create pgvector extension and table when first writing vectors."
62
+ },
63
+ distanceMetric: {
64
+ type: "string",
65
+ enum: ["cosine", "l2", "inner_product"],
66
+ description: "Distance metric used for nearest-neighbor search."
67
+ }
68
+ }
69
+ },
70
+ example: {
71
+ schema: "public",
72
+ table: "contractspec_vectors",
73
+ createTableIfMissing: true,
74
+ distanceMetric: "cosine"
75
+ }
76
+ },
77
+ secretSchema: {
78
+ schema: {
79
+ type: "object",
80
+ required: ["databaseUrl"],
81
+ properties: {
82
+ databaseUrl: {
83
+ type: "string",
84
+ description: "Supabase Postgres connection string with privileges to read/write vector rows."
85
+ }
86
+ }
87
+ },
88
+ example: {
89
+ databaseUrl: "postgresql://postgres.[project-ref]:password@aws-0-region.pooler.supabase.com:6543/postgres"
90
+ }
91
+ },
92
+ healthCheck: {
93
+ method: "ping",
94
+ timeoutMs: 5000
95
+ },
96
+ docsUrl: "https://supabase.com/docs/guides/ai/vector-columns",
97
+ byokSetup: {
98
+ setupInstructions: "Create or reuse a Supabase project, enable pgvector, and provide a Postgres connection string with read/write access to the target vector table."
99
+ }
100
+ });
101
+ function registerSupabaseVectorIntegration(registry) {
102
+ return registry.register(supabaseVectorIntegrationSpec);
103
+ }
104
+ export {
105
+ supabaseVectorIntegrationSpec,
106
+ registerSupabaseVectorIntegration
107
+ };
@@ -0,0 +1,3 @@
1
+ import { IntegrationSpecRegistry } from '../spec';
2
+ export declare const tldvIntegrationSpec: import("..").IntegrationSpec;
3
+ export declare function registerTldvIntegration(registry: IntegrationSpecRegistry): IntegrationSpecRegistry;
@@ -0,0 +1,106 @@
1
+ // @bun
2
+ // src/integrations/spec.ts
3
+ import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
4
+ var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
5
+
6
+ class IntegrationSpecRegistry extends SpecContractRegistry {
7
+ constructor(items) {
8
+ super("integration", items);
9
+ }
10
+ getByCategory(category) {
11
+ return this.list().filter((spec) => spec.meta.category === category);
12
+ }
13
+ }
14
+ function makeIntegrationSpecKey(meta) {
15
+ return integrationKey(meta);
16
+ }
17
+ var defineIntegration = (spec) => spec;
18
+
19
+ // src/integrations/providers/tldv.ts
20
+ import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
21
+ var tldvIntegrationSpec = defineIntegration({
22
+ meta: {
23
+ key: "meeting-recorder.tldv",
24
+ version: "1.0.0",
25
+ category: "meeting-recorder",
26
+ title: "tl;dv Meeting Recorder",
27
+ description: "tl;dv Public API for meeting recordings, transcripts, and webhook events.",
28
+ domain: "productivity",
29
+ owners: ["platform.integrations"],
30
+ tags: ["meeting-recorder", "tldv", "transcripts"],
31
+ stability: StabilityEnum.Experimental
32
+ },
33
+ supportedModes: ["byok"],
34
+ capabilities: {
35
+ provides: [
36
+ { key: "meeting-recorder.meetings.read", version: "1.0.0" },
37
+ { key: "meeting-recorder.transcripts.read", version: "1.0.0" },
38
+ { key: "meeting-recorder.webhooks", version: "1.0.0" }
39
+ ]
40
+ },
41
+ configSchema: {
42
+ schema: {
43
+ type: "object",
44
+ properties: {
45
+ baseUrl: {
46
+ type: "string",
47
+ description: "Optional override for the tl;dv API base URL. Defaults to https://pasta.tldv.io/v1alpha1."
48
+ },
49
+ webhookUrl: {
50
+ type: "string",
51
+ description: "Webhook destination URL configured in tl;dv settings (MeetingReady/TranscriptReady)."
52
+ },
53
+ webhookEvents: {
54
+ type: "array",
55
+ items: { type: "string" },
56
+ description: "Webhook triggers to enable (MeetingReady, TranscriptReady)."
57
+ },
58
+ webhookScope: {
59
+ type: "string",
60
+ description: "Webhook scope to configure (user, team, or organization)."
61
+ }
62
+ }
63
+ },
64
+ example: {
65
+ baseUrl: "https://pasta.tldv.io/v1alpha1",
66
+ webhookUrl: "https://example.com/webhooks/tldv",
67
+ webhookEvents: ["MeetingReady", "TranscriptReady"],
68
+ webhookScope: "team"
69
+ }
70
+ },
71
+ secretSchema: {
72
+ schema: {
73
+ type: "object",
74
+ required: ["apiKey"],
75
+ properties: {
76
+ apiKey: {
77
+ type: "string",
78
+ description: "tl;dv API key used in the x-api-key header for API requests."
79
+ },
80
+ webhookSecret: {
81
+ type: "string",
82
+ description: "Optional shared secret for webhook verification if configured in your environment."
83
+ }
84
+ }
85
+ },
86
+ example: {
87
+ apiKey: "tldv-***",
88
+ webhookSecret: "tldv-webhook-secret"
89
+ }
90
+ },
91
+ healthCheck: {
92
+ method: "ping",
93
+ timeoutMs: 6000
94
+ },
95
+ docsUrl: "https://doc.tldv.io/index.html",
96
+ byokSetup: {
97
+ setupInstructions: "Generate a tl;dv API key and optionally configure MeetingReady/TranscriptReady webhooks."
98
+ }
99
+ });
100
+ function registerTldvIntegration(registry) {
101
+ return registry.register(tldvIntegrationSpec);
102
+ }
103
+ export {
104
+ tldvIntegrationSpec,
105
+ registerTldvIntegration
106
+ };
@@ -0,0 +1,3 @@
1
+ import { IntegrationSpecRegistry } from '../spec';
2
+ export declare const twilioSmsIntegrationSpec: import("..").IntegrationSpec;
3
+ export declare function registerTwilioSmsIntegration(registry: IntegrationSpecRegistry): IntegrationSpecRegistry;
@@ -0,0 +1,91 @@
1
+ // @bun
2
+ // src/integrations/spec.ts
3
+ import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
4
+ var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
5
+
6
+ class IntegrationSpecRegistry extends SpecContractRegistry {
7
+ constructor(items) {
8
+ super("integration", items);
9
+ }
10
+ getByCategory(category) {
11
+ return this.list().filter((spec) => spec.meta.category === category);
12
+ }
13
+ }
14
+ function makeIntegrationSpecKey(meta) {
15
+ return integrationKey(meta);
16
+ }
17
+ var defineIntegration = (spec) => spec;
18
+
19
+ // src/integrations/providers/twilio-sms.ts
20
+ import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
21
+ var twilioSmsIntegrationSpec = defineIntegration({
22
+ meta: {
23
+ key: "sms.twilio",
24
+ version: "1.0.0",
25
+ category: "sms",
26
+ title: "Twilio Messaging",
27
+ description: "Twilio SMS integration for transactional and notification messaging.",
28
+ domain: "communications",
29
+ owners: ["platform.messaging"],
30
+ tags: ["sms", "messaging"],
31
+ stability: StabilityEnum.Stable
32
+ },
33
+ supportedModes: ["managed", "byok"],
34
+ capabilities: {
35
+ provides: [{ key: "sms.outbound", version: "1.0.0" }]
36
+ },
37
+ configSchema: {
38
+ schema: {
39
+ type: "object",
40
+ properties: {
41
+ fromNumber: {
42
+ type: "string",
43
+ description: "Default Twilio phone number used as sender."
44
+ }
45
+ }
46
+ },
47
+ example: {
48
+ fromNumber: "+15551234567"
49
+ }
50
+ },
51
+ secretSchema: {
52
+ schema: {
53
+ type: "object",
54
+ required: ["accountSid", "authToken"],
55
+ properties: {
56
+ accountSid: {
57
+ type: "string",
58
+ description: "Twilio Account SID."
59
+ },
60
+ authToken: {
61
+ type: "string",
62
+ description: "Twilio Auth Token."
63
+ }
64
+ }
65
+ },
66
+ example: {
67
+ accountSid: "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
68
+ authToken: "auth-token"
69
+ }
70
+ },
71
+ healthCheck: {
72
+ method: "custom",
73
+ timeoutMs: 3000
74
+ },
75
+ docsUrl: "https://www.twilio.com/docs/sms/api",
76
+ constraints: {
77
+ rateLimit: {
78
+ rpm: 200
79
+ }
80
+ },
81
+ byokSetup: {
82
+ setupInstructions: "Provide a Twilio account SID, auth token, and verify the outbound sending numbers used by the integration."
83
+ }
84
+ });
85
+ function registerTwilioSmsIntegration(registry) {
86
+ return registry.register(twilioSmsIntegrationSpec);
87
+ }
88
+ export {
89
+ twilioSmsIntegrationSpec,
90
+ registerTwilioSmsIntegration
91
+ };
@@ -0,0 +1,39 @@
1
+ import type { EmbeddingVector } from './embedding';
2
+ export interface VectorDocument {
3
+ id: string;
4
+ vector: EmbeddingVector;
5
+ payload?: Record<string, unknown>;
6
+ namespace?: string;
7
+ expiresAt?: Date;
8
+ }
9
+ export interface VectorUpsertRequest {
10
+ collection: string;
11
+ documents: VectorDocument[];
12
+ waitForSync?: boolean;
13
+ }
14
+ export interface VectorDeleteRequest {
15
+ collection: string;
16
+ ids: string[];
17
+ namespace?: string;
18
+ }
19
+ export interface VectorSearchQuery {
20
+ collection: string;
21
+ vector: EmbeddingVector;
22
+ topK: number;
23
+ namespace?: string;
24
+ filter?: Record<string, unknown>;
25
+ scoreThreshold?: number;
26
+ consistent?: boolean;
27
+ }
28
+ export interface VectorSearchResult {
29
+ id: string;
30
+ score: number;
31
+ payload?: Record<string, unknown>;
32
+ vector?: EmbeddingVector;
33
+ namespace?: string;
34
+ }
35
+ export interface VectorStoreProvider {
36
+ upsert(request: VectorUpsertRequest): Promise<void>;
37
+ search(query: VectorSearchQuery): Promise<VectorSearchResult[]>;
38
+ delete(request: VectorDeleteRequest): Promise<void>;
39
+ }
@@ -0,0 +1 @@
1
+ // @bun
@@ -0,0 +1,31 @@
1
+ export interface Voice {
2
+ id: string;
3
+ name: string;
4
+ description?: string;
5
+ language?: string;
6
+ gender?: 'male' | 'female' | 'neutral';
7
+ previewUrl?: string;
8
+ metadata?: Record<string, string>;
9
+ }
10
+ export interface VoiceSynthesisInput {
11
+ text: string;
12
+ voiceId?: string;
13
+ language?: string;
14
+ style?: number;
15
+ stability?: number;
16
+ similarityBoost?: number;
17
+ format?: 'mp3' | 'wav' | 'ogg' | 'pcm';
18
+ sampleRateHz?: number;
19
+ metadata?: Record<string, string>;
20
+ }
21
+ export interface VoiceSynthesisResult {
22
+ audio: Uint8Array;
23
+ format: string;
24
+ sampleRateHz: number;
25
+ durationSeconds?: number;
26
+ url?: string;
27
+ }
28
+ export interface VoiceProvider {
29
+ listVoices(): Promise<Voice[]>;
30
+ synthesize(input: VoiceSynthesisInput): Promise<VoiceSynthesisResult>;
31
+ }