@contractspec/example.integration-supabase 1.57.0 → 1.58.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 (53) hide show
  1. package/.turbo/turbo-build.log +40 -39
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +14 -0
  4. package/dist/blueprint.d.ts +2 -6
  5. package/dist/blueprint.d.ts.map +1 -1
  6. package/dist/blueprint.js +67 -74
  7. package/dist/browser/blueprint.js +67 -0
  8. package/dist/browser/connection.sample.js +54 -0
  9. package/dist/browser/docs/index.js +54 -0
  10. package/dist/browser/docs/integration-supabase.docblock.js +54 -0
  11. package/dist/browser/example.js +33 -0
  12. package/dist/browser/index.js +278 -0
  13. package/dist/browser/runtime.sample.js +32 -0
  14. package/dist/browser/tenant.js +42 -0
  15. package/dist/connection.sample.d.ts +4 -8
  16. package/dist/connection.sample.d.ts.map +1 -1
  17. package/dist/connection.sample.js +53 -48
  18. package/dist/docs/index.d.ts +2 -1
  19. package/dist/docs/index.d.ts.map +1 -0
  20. package/dist/docs/index.js +55 -1
  21. package/dist/docs/integration-supabase.docblock.d.ts +2 -1
  22. package/dist/docs/integration-supabase.docblock.d.ts.map +1 -0
  23. package/dist/docs/integration-supabase.docblock.js +25 -30
  24. package/dist/example.d.ts +2 -6
  25. package/dist/example.d.ts.map +1 -1
  26. package/dist/example.js +32 -44
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +279 -8
  30. package/dist/node/blueprint.js +67 -0
  31. package/dist/node/connection.sample.js +54 -0
  32. package/dist/node/docs/index.js +54 -0
  33. package/dist/node/docs/integration-supabase.docblock.js +54 -0
  34. package/dist/node/example.js +33 -0
  35. package/dist/node/index.js +278 -0
  36. package/dist/node/runtime.sample.js +32 -0
  37. package/dist/node/tenant.js +42 -0
  38. package/dist/runtime.sample.d.ts +9 -13
  39. package/dist/runtime.sample.d.ts.map +1 -1
  40. package/dist/runtime.sample.js +30 -40
  41. package/dist/tenant.d.ts +2 -6
  42. package/dist/tenant.d.ts.map +1 -1
  43. package/dist/tenant.js +42 -39
  44. package/package.json +86 -31
  45. package/tsdown.config.js +1 -2
  46. package/.turbo/turbo-build$colon$bundle.log +0 -42
  47. package/dist/blueprint.js.map +0 -1
  48. package/dist/connection.sample.js.map +0 -1
  49. package/dist/docs/integration-supabase.docblock.js.map +0 -1
  50. package/dist/example.js.map +0 -1
  51. package/dist/runtime.sample.js.map +0 -1
  52. package/dist/tenant.js.map +0 -1
  53. package/tsconfig.tsbuildinfo +0 -1
package/dist/example.js CHANGED
@@ -1,46 +1,34 @@
1
+ // @bun
2
+ // src/example.ts
1
3
  import { defineExample } from "@contractspec/lib.contracts";
2
-
3
- //#region src/example.ts
4
- const example = defineExample({
5
- meta: {
6
- key: "integration-supabase",
7
- version: "1.0.0",
8
- title: "Integration - Supabase Vector + Postgres",
9
- description: "Wire AppBlueprint and TenantAppConfig to use Supabase for both vector retrieval and SQL workloads.",
10
- kind: "integration",
11
- visibility: "public",
12
- stability: "experimental",
13
- owners: ["@platform.core"],
14
- tags: [
15
- "supabase",
16
- "pgvector",
17
- "postgres",
18
- "integration",
19
- "knowledge"
20
- ]
21
- },
22
- docs: {
23
- rootDocId: "docs.examples.integration-supabase",
24
- usageDocId: "docs.examples.integration-supabase.usage"
25
- },
26
- entrypoints: {
27
- packageName: "@contractspec/example.integration-supabase",
28
- docs: "./docs"
29
- },
30
- surfaces: {
31
- templates: true,
32
- sandbox: {
33
- enabled: true,
34
- modes: ["markdown", "specs"]
35
- },
36
- studio: {
37
- enabled: true,
38
- installable: true
39
- },
40
- mcp: { enabled: true }
41
- }
4
+ var example = defineExample({
5
+ meta: {
6
+ key: "integration-supabase",
7
+ version: "1.0.0",
8
+ title: "Integration - Supabase Vector + Postgres",
9
+ description: "Wire AppBlueprint and TenantAppConfig to use Supabase for both vector retrieval and SQL workloads.",
10
+ kind: "integration",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: ["supabase", "pgvector", "postgres", "integration", "knowledge"]
15
+ },
16
+ docs: {
17
+ rootDocId: "docs.examples.integration-supabase",
18
+ usageDocId: "docs.examples.integration-supabase.usage"
19
+ },
20
+ entrypoints: {
21
+ packageName: "@contractspec/example.integration-supabase",
22
+ docs: "./docs"
23
+ },
24
+ surfaces: {
25
+ templates: true,
26
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
27
+ studio: { enabled: true, installable: true },
28
+ mcp: { enabled: true }
29
+ }
42
30
  });
43
-
44
- //#endregion
45
- export { example as default };
46
- //# sourceMappingURL=example.js.map
31
+ var example_default = example;
32
+ export {
33
+ example_default as default
34
+ };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { supabaseKnowledgeBlueprint } from "./blueprint.js";
2
- import { supabaseConnectionSamples, supabaseDatabaseConnection, supabaseVectorConnection } from "./connection.sample.js";
3
- import example from "./example.js";
4
- import { supabaseKnowledgeTenantConfig } from "./tenant.js";
5
- import { SupabaseKnowledgeRuntimeParams, SupabaseKnowledgeRuntimeResult, runSupabaseKnowledgeRuntime } from "./runtime.sample.js";
6
- export { SupabaseKnowledgeRuntimeParams, SupabaseKnowledgeRuntimeResult, example, runSupabaseKnowledgeRuntime, supabaseConnectionSamples, supabaseDatabaseConnection, supabaseKnowledgeBlueprint, supabaseKnowledgeTenantConfig, supabaseVectorConnection };
1
+ export * from './blueprint';
2
+ export * from './tenant';
3
+ export * from './connection.sample';
4
+ export * from './runtime.sample';
5
+ export { default as example } from './example';
6
+ import './docs';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,279 @@
1
- import { supabaseKnowledgeBlueprint } from "./blueprint.js";
2
- import { supabaseConnectionSamples, supabaseDatabaseConnection, supabaseVectorConnection } from "./connection.sample.js";
3
- import example from "./example.js";
4
- import { supabaseKnowledgeTenantConfig } from "./tenant.js";
5
- import { runSupabaseKnowledgeRuntime } from "./runtime.sample.js";
6
- import "./docs/index.js";
7
-
8
- export { example, runSupabaseKnowledgeRuntime, supabaseConnectionSamples, supabaseDatabaseConnection, supabaseKnowledgeBlueprint, supabaseKnowledgeTenantConfig, supabaseVectorConnection };
1
+ // @bun
2
+ // src/blueprint.ts
3
+ import {
4
+ OwnersEnum,
5
+ StabilityEnum,
6
+ TagsEnum
7
+ } from "@contractspec/lib.contracts/ownership";
8
+ var supabaseKnowledgeBlueprint = {
9
+ meta: {
10
+ key: "knowledge.supabase.dual-store",
11
+ version: "1.0.0",
12
+ appId: "knowledge-assistant",
13
+ title: "Knowledge Assistant - Supabase Dual Store",
14
+ description: "Blueprint that uses Supabase for both vector retrieval and SQL-backed analytics.",
15
+ domain: "knowledge",
16
+ owners: [OwnersEnum.PlatformCore],
17
+ tags: [
18
+ TagsEnum.Automation,
19
+ "knowledge",
20
+ "supabase",
21
+ "vector-db",
22
+ "database"
23
+ ],
24
+ stability: StabilityEnum.Experimental
25
+ },
26
+ capabilities: {
27
+ enabled: [
28
+ { key: "vector-db.search", version: "1.0.0" },
29
+ { key: "vector-db.storage", version: "1.0.0" },
30
+ { key: "database.sql", version: "1.0.0" }
31
+ ]
32
+ },
33
+ integrationSlots: [
34
+ {
35
+ slotId: "primary-vector-db",
36
+ requiredCategory: "vector-db",
37
+ allowedModes: ["managed", "byok"],
38
+ requiredCapabilities: [
39
+ { key: "vector-db.search", version: "1.0.0" },
40
+ { key: "vector-db.storage", version: "1.0.0" }
41
+ ],
42
+ required: true,
43
+ description: "Primary semantic retrieval store for knowledge chunks."
44
+ },
45
+ {
46
+ slotId: "primary-database",
47
+ requiredCategory: "database",
48
+ allowedModes: ["managed", "byok"],
49
+ requiredCapabilities: [{ key: "database.sql", version: "1.0.0" }],
50
+ required: true,
51
+ description: "Primary SQL database for analytics and transactional reads."
52
+ }
53
+ ],
54
+ workflows: {
55
+ ingestKnowledge: {
56
+ key: "knowledge.ingest.supabase",
57
+ version: "1.0.0"
58
+ },
59
+ refreshMetrics: {
60
+ key: "knowledge.metrics.supabase",
61
+ version: "1.0.0"
62
+ }
63
+ },
64
+ notes: "Bind both slots to Supabase connections when you want shared infra for embeddings and SQL operations."
65
+ };
66
+
67
+ // src/connection.sample.ts
68
+ var supabaseVectorConnection = {
69
+ meta: {
70
+ id: "conn-supabase-vector",
71
+ tenantId: "acme-knowledge",
72
+ integrationKey: "vectordb.supabase",
73
+ integrationVersion: "1.0.0",
74
+ label: "Supabase Vector Store",
75
+ environment: "production",
76
+ createdAt: "2026-02-06T00:00:00.000Z",
77
+ updatedAt: "2026-02-06T00:00:00.000Z"
78
+ },
79
+ ownershipMode: "managed",
80
+ config: {
81
+ schema: "public",
82
+ table: "contractspec_vectors",
83
+ createTableIfMissing: true,
84
+ distanceMetric: "cosine",
85
+ maxConnections: 5,
86
+ sslMode: "require"
87
+ },
88
+ secretProvider: "vault",
89
+ secretRef: "vault://integrations/acme-knowledge/conn-supabase-vector",
90
+ status: "connected"
91
+ };
92
+ var supabaseDatabaseConnection = {
93
+ meta: {
94
+ id: "conn-supabase-db",
95
+ tenantId: "acme-knowledge",
96
+ integrationKey: "database.supabase",
97
+ integrationVersion: "1.0.0",
98
+ label: "Supabase Postgres",
99
+ environment: "production",
100
+ createdAt: "2026-02-06T00:00:00.000Z",
101
+ updatedAt: "2026-02-06T00:00:00.000Z"
102
+ },
103
+ ownershipMode: "managed",
104
+ config: {
105
+ maxConnections: 10,
106
+ sslMode: "require"
107
+ },
108
+ secretProvider: "vault",
109
+ secretRef: "vault://integrations/acme-knowledge/conn-supabase-db",
110
+ status: "connected"
111
+ };
112
+ var supabaseConnectionSamples = [
113
+ supabaseVectorConnection,
114
+ supabaseDatabaseConnection
115
+ ];
116
+
117
+ // src/docs/integration-supabase.docblock.ts
118
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
119
+ var blocks = [
120
+ {
121
+ id: "docs.examples.integration-supabase",
122
+ title: "Integration Example - Supabase Vector + Postgres",
123
+ summary: "Reference example wiring Supabase vector and SQL integrations in one tenant configuration.",
124
+ kind: "reference",
125
+ visibility: "public",
126
+ route: "/docs/examples/integration-supabase",
127
+ tags: ["supabase", "vector-db", "database", "integration", "example"],
128
+ body: `## What this example includes
129
+ - A blueprint declaring two required integration slots:
130
+ - \`primary-vector-db\` bound to \`vectordb.supabase\`
131
+ - \`primary-database\` bound to \`database.supabase\`
132
+ - A tenant config binding both slots.
133
+ - Connection samples with clear \`config\` vs \`secretRef\` separation.
134
+ - A runtime sample that upserts/searches vectors and executes SQL queries.
135
+
136
+ ## Why this pattern
137
+ - Keeps integration concerns explicit and auditable in app-config.
138
+ - Enables shared Supabase infrastructure for retrieval + analytics.
139
+ - Preserves secret management boundaries (no credentials in config/spec).`
140
+ },
141
+ {
142
+ id: "docs.examples.integration-supabase.usage",
143
+ title: "Supabase Integration Example - Usage",
144
+ summary: "Step-by-step usage of the Supabase dual-store integration example.",
145
+ kind: "usage",
146
+ visibility: "public",
147
+ route: "/docs/examples/integration-supabase/usage",
148
+ tags: ["supabase", "usage"],
149
+ body: `## Usage
150
+ 1) Register integration specs from \`createDefaultIntegrationSpecRegistry()\`.
151
+ 2) Persist both sample connections from \`connection.sample.ts\`.
152
+ 3) Publish the tenant config from \`tenant.ts\` with matching \`connectionId\` values.
153
+ 4) Use \`runSupabaseKnowledgeRuntime(...)\` to execute vector and SQL calls through \`IntegrationProviderFactory\`.
154
+
155
+ ## Secret payload
156
+ Store the following payload in your secret provider target for each connection:
157
+
158
+ \`\`\`json
159
+ {
160
+ "databaseUrl": "postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres"
161
+ }
162
+ \`\`\`
163
+
164
+ ## Guardrails
165
+ - Never place credentials in \`config\` or source control.
166
+ - Keep operational SQL behind explicit workflows/operations.
167
+ - Restrict DB credentials to least-privilege roles whenever possible.`
168
+ }
169
+ ];
170
+ registerDocBlocks(blocks);
171
+ // src/example.ts
172
+ import { defineExample } from "@contractspec/lib.contracts";
173
+ var example = defineExample({
174
+ meta: {
175
+ key: "integration-supabase",
176
+ version: "1.0.0",
177
+ title: "Integration - Supabase Vector + Postgres",
178
+ description: "Wire AppBlueprint and TenantAppConfig to use Supabase for both vector retrieval and SQL workloads.",
179
+ kind: "integration",
180
+ visibility: "public",
181
+ stability: "experimental",
182
+ owners: ["@platform.core"],
183
+ tags: ["supabase", "pgvector", "postgres", "integration", "knowledge"]
184
+ },
185
+ docs: {
186
+ rootDocId: "docs.examples.integration-supabase",
187
+ usageDocId: "docs.examples.integration-supabase.usage"
188
+ },
189
+ entrypoints: {
190
+ packageName: "@contractspec/example.integration-supabase",
191
+ docs: "./docs"
192
+ },
193
+ surfaces: {
194
+ templates: true,
195
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
196
+ studio: { enabled: true, installable: true },
197
+ mcp: { enabled: true }
198
+ }
199
+ });
200
+ var example_default = example;
201
+
202
+ // src/tenant.ts
203
+ var supabaseKnowledgeTenantConfig = {
204
+ meta: {
205
+ id: "tenant-config-knowledge-supabase",
206
+ tenantId: "acme-knowledge",
207
+ appId: "knowledge-assistant",
208
+ blueprintName: "knowledge.supabase.dual-store",
209
+ blueprintVersion: "1.0.0",
210
+ environment: "production",
211
+ version: "1.0.0",
212
+ status: "published",
213
+ createdAt: new Date().toISOString(),
214
+ updatedAt: new Date().toISOString()
215
+ },
216
+ integrations: [
217
+ {
218
+ slotId: "primary-vector-db",
219
+ connectionId: "conn-supabase-vector",
220
+ scope: {
221
+ workflows: ["ingestKnowledge"],
222
+ operations: ["knowledge.indexChunks", "knowledge.semanticSearch"]
223
+ }
224
+ },
225
+ {
226
+ slotId: "primary-database",
227
+ connectionId: "conn-supabase-db",
228
+ scope: {
229
+ workflows: ["refreshMetrics"],
230
+ operations: ["knowledge.metrics.refresh", "knowledge.metrics.query"]
231
+ }
232
+ }
233
+ ],
234
+ knowledge: [],
235
+ locales: {
236
+ defaultLocale: "en",
237
+ enabledLocales: ["en"]
238
+ },
239
+ notes: "Supabase vector + SQL connections bound for production knowledge flows."
240
+ };
241
+
242
+ // src/runtime.sample.ts
243
+ import { IntegrationProviderFactory } from "@contractspec/integration.providers-impls/impls/provider-factory";
244
+ async function runSupabaseKnowledgeRuntime(params) {
245
+ const factory = new IntegrationProviderFactory;
246
+ const vectorStore = await factory.createVectorStoreProvider(params.vectorContext);
247
+ const database = await factory.createDatabaseProvider(params.databaseContext);
248
+ await vectorStore.upsert({
249
+ collection: "knowledge_chunks",
250
+ documents: [
251
+ {
252
+ id: "chunk-1",
253
+ vector: [0.11, 0.23, 0.45],
254
+ payload: { source: "faq", locale: "en" }
255
+ }
256
+ ]
257
+ });
258
+ const matches = await vectorStore.search({
259
+ collection: "knowledge_chunks",
260
+ vector: [0.12, 0.22, 0.44],
261
+ topK: 5,
262
+ filter: { source: "faq" }
263
+ });
264
+ const count = await database.query("SELECT COUNT(*)::int AS total FROM knowledge_chunks;");
265
+ await database.close();
266
+ return {
267
+ matches,
268
+ indexedDocumentCount: count.rows[0]?.total ?? 0
269
+ };
270
+ }
271
+ export {
272
+ supabaseVectorConnection,
273
+ supabaseKnowledgeTenantConfig,
274
+ supabaseKnowledgeBlueprint,
275
+ supabaseDatabaseConnection,
276
+ supabaseConnectionSamples,
277
+ runSupabaseKnowledgeRuntime,
278
+ example_default as example
279
+ };
@@ -0,0 +1,67 @@
1
+ // src/blueprint.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum,
5
+ TagsEnum
6
+ } from "@contractspec/lib.contracts/ownership";
7
+ var supabaseKnowledgeBlueprint = {
8
+ meta: {
9
+ key: "knowledge.supabase.dual-store",
10
+ version: "1.0.0",
11
+ appId: "knowledge-assistant",
12
+ title: "Knowledge Assistant - Supabase Dual Store",
13
+ description: "Blueprint that uses Supabase for both vector retrieval and SQL-backed analytics.",
14
+ domain: "knowledge",
15
+ owners: [OwnersEnum.PlatformCore],
16
+ tags: [
17
+ TagsEnum.Automation,
18
+ "knowledge",
19
+ "supabase",
20
+ "vector-db",
21
+ "database"
22
+ ],
23
+ stability: StabilityEnum.Experimental
24
+ },
25
+ capabilities: {
26
+ enabled: [
27
+ { key: "vector-db.search", version: "1.0.0" },
28
+ { key: "vector-db.storage", version: "1.0.0" },
29
+ { key: "database.sql", version: "1.0.0" }
30
+ ]
31
+ },
32
+ integrationSlots: [
33
+ {
34
+ slotId: "primary-vector-db",
35
+ requiredCategory: "vector-db",
36
+ allowedModes: ["managed", "byok"],
37
+ requiredCapabilities: [
38
+ { key: "vector-db.search", version: "1.0.0" },
39
+ { key: "vector-db.storage", version: "1.0.0" }
40
+ ],
41
+ required: true,
42
+ description: "Primary semantic retrieval store for knowledge chunks."
43
+ },
44
+ {
45
+ slotId: "primary-database",
46
+ requiredCategory: "database",
47
+ allowedModes: ["managed", "byok"],
48
+ requiredCapabilities: [{ key: "database.sql", version: "1.0.0" }],
49
+ required: true,
50
+ description: "Primary SQL database for analytics and transactional reads."
51
+ }
52
+ ],
53
+ workflows: {
54
+ ingestKnowledge: {
55
+ key: "knowledge.ingest.supabase",
56
+ version: "1.0.0"
57
+ },
58
+ refreshMetrics: {
59
+ key: "knowledge.metrics.supabase",
60
+ version: "1.0.0"
61
+ }
62
+ },
63
+ notes: "Bind both slots to Supabase connections when you want shared infra for embeddings and SQL operations."
64
+ };
65
+ export {
66
+ supabaseKnowledgeBlueprint
67
+ };
@@ -0,0 +1,54 @@
1
+ // src/connection.sample.ts
2
+ var supabaseVectorConnection = {
3
+ meta: {
4
+ id: "conn-supabase-vector",
5
+ tenantId: "acme-knowledge",
6
+ integrationKey: "vectordb.supabase",
7
+ integrationVersion: "1.0.0",
8
+ label: "Supabase Vector Store",
9
+ environment: "production",
10
+ createdAt: "2026-02-06T00:00:00.000Z",
11
+ updatedAt: "2026-02-06T00:00:00.000Z"
12
+ },
13
+ ownershipMode: "managed",
14
+ config: {
15
+ schema: "public",
16
+ table: "contractspec_vectors",
17
+ createTableIfMissing: true,
18
+ distanceMetric: "cosine",
19
+ maxConnections: 5,
20
+ sslMode: "require"
21
+ },
22
+ secretProvider: "vault",
23
+ secretRef: "vault://integrations/acme-knowledge/conn-supabase-vector",
24
+ status: "connected"
25
+ };
26
+ var supabaseDatabaseConnection = {
27
+ meta: {
28
+ id: "conn-supabase-db",
29
+ tenantId: "acme-knowledge",
30
+ integrationKey: "database.supabase",
31
+ integrationVersion: "1.0.0",
32
+ label: "Supabase Postgres",
33
+ environment: "production",
34
+ createdAt: "2026-02-06T00:00:00.000Z",
35
+ updatedAt: "2026-02-06T00:00:00.000Z"
36
+ },
37
+ ownershipMode: "managed",
38
+ config: {
39
+ maxConnections: 10,
40
+ sslMode: "require"
41
+ },
42
+ secretProvider: "vault",
43
+ secretRef: "vault://integrations/acme-knowledge/conn-supabase-db",
44
+ status: "connected"
45
+ };
46
+ var supabaseConnectionSamples = [
47
+ supabaseVectorConnection,
48
+ supabaseDatabaseConnection
49
+ ];
50
+ export {
51
+ supabaseVectorConnection,
52
+ supabaseDatabaseConnection,
53
+ supabaseConnectionSamples
54
+ };
@@ -0,0 +1,54 @@
1
+ // src/docs/integration-supabase.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.integration-supabase",
6
+ title: "Integration Example - Supabase Vector + Postgres",
7
+ summary: "Reference example wiring Supabase vector and SQL integrations in one tenant configuration.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/integration-supabase",
11
+ tags: ["supabase", "vector-db", "database", "integration", "example"],
12
+ body: `## What this example includes
13
+ - A blueprint declaring two required integration slots:
14
+ - \`primary-vector-db\` bound to \`vectordb.supabase\`
15
+ - \`primary-database\` bound to \`database.supabase\`
16
+ - A tenant config binding both slots.
17
+ - Connection samples with clear \`config\` vs \`secretRef\` separation.
18
+ - A runtime sample that upserts/searches vectors and executes SQL queries.
19
+
20
+ ## Why this pattern
21
+ - Keeps integration concerns explicit and auditable in app-config.
22
+ - Enables shared Supabase infrastructure for retrieval + analytics.
23
+ - Preserves secret management boundaries (no credentials in config/spec).`
24
+ },
25
+ {
26
+ id: "docs.examples.integration-supabase.usage",
27
+ title: "Supabase Integration Example - Usage",
28
+ summary: "Step-by-step usage of the Supabase dual-store integration example.",
29
+ kind: "usage",
30
+ visibility: "public",
31
+ route: "/docs/examples/integration-supabase/usage",
32
+ tags: ["supabase", "usage"],
33
+ body: `## Usage
34
+ 1) Register integration specs from \`createDefaultIntegrationSpecRegistry()\`.
35
+ 2) Persist both sample connections from \`connection.sample.ts\`.
36
+ 3) Publish the tenant config from \`tenant.ts\` with matching \`connectionId\` values.
37
+ 4) Use \`runSupabaseKnowledgeRuntime(...)\` to execute vector and SQL calls through \`IntegrationProviderFactory\`.
38
+
39
+ ## Secret payload
40
+ Store the following payload in your secret provider target for each connection:
41
+
42
+ \`\`\`json
43
+ {
44
+ "databaseUrl": "postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres"
45
+ }
46
+ \`\`\`
47
+
48
+ ## Guardrails
49
+ - Never place credentials in \`config\` or source control.
50
+ - Keep operational SQL behind explicit workflows/operations.
51
+ - Restrict DB credentials to least-privilege roles whenever possible.`
52
+ }
53
+ ];
54
+ registerDocBlocks(blocks);
@@ -0,0 +1,54 @@
1
+ // src/docs/integration-supabase.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.integration-supabase",
6
+ title: "Integration Example - Supabase Vector + Postgres",
7
+ summary: "Reference example wiring Supabase vector and SQL integrations in one tenant configuration.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/integration-supabase",
11
+ tags: ["supabase", "vector-db", "database", "integration", "example"],
12
+ body: `## What this example includes
13
+ - A blueprint declaring two required integration slots:
14
+ - \`primary-vector-db\` bound to \`vectordb.supabase\`
15
+ - \`primary-database\` bound to \`database.supabase\`
16
+ - A tenant config binding both slots.
17
+ - Connection samples with clear \`config\` vs \`secretRef\` separation.
18
+ - A runtime sample that upserts/searches vectors and executes SQL queries.
19
+
20
+ ## Why this pattern
21
+ - Keeps integration concerns explicit and auditable in app-config.
22
+ - Enables shared Supabase infrastructure for retrieval + analytics.
23
+ - Preserves secret management boundaries (no credentials in config/spec).`
24
+ },
25
+ {
26
+ id: "docs.examples.integration-supabase.usage",
27
+ title: "Supabase Integration Example - Usage",
28
+ summary: "Step-by-step usage of the Supabase dual-store integration example.",
29
+ kind: "usage",
30
+ visibility: "public",
31
+ route: "/docs/examples/integration-supabase/usage",
32
+ tags: ["supabase", "usage"],
33
+ body: `## Usage
34
+ 1) Register integration specs from \`createDefaultIntegrationSpecRegistry()\`.
35
+ 2) Persist both sample connections from \`connection.sample.ts\`.
36
+ 3) Publish the tenant config from \`tenant.ts\` with matching \`connectionId\` values.
37
+ 4) Use \`runSupabaseKnowledgeRuntime(...)\` to execute vector and SQL calls through \`IntegrationProviderFactory\`.
38
+
39
+ ## Secret payload
40
+ Store the following payload in your secret provider target for each connection:
41
+
42
+ \`\`\`json
43
+ {
44
+ "databaseUrl": "postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres"
45
+ }
46
+ \`\`\`
47
+
48
+ ## Guardrails
49
+ - Never place credentials in \`config\` or source control.
50
+ - Keep operational SQL behind explicit workflows/operations.
51
+ - Restrict DB credentials to least-privilege roles whenever possible.`
52
+ }
53
+ ];
54
+ registerDocBlocks(blocks);
@@ -0,0 +1,33 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "integration-supabase",
6
+ version: "1.0.0",
7
+ title: "Integration - Supabase Vector + Postgres",
8
+ description: "Wire AppBlueprint and TenantAppConfig to use Supabase for both vector retrieval and SQL workloads.",
9
+ kind: "integration",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["supabase", "pgvector", "postgres", "integration", "knowledge"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.integration-supabase",
17
+ usageDocId: "docs.examples.integration-supabase.usage"
18
+ },
19
+ entrypoints: {
20
+ packageName: "@contractspec/example.integration-supabase",
21
+ docs: "./docs"
22
+ },
23
+ surfaces: {
24
+ templates: true,
25
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
26
+ studio: { enabled: true, installable: true },
27
+ mcp: { enabled: true }
28
+ }
29
+ });
30
+ var example_default = example;
31
+ export {
32
+ example_default as default
33
+ };