@contractspec/example.integration-supabase 1.57.0 → 1.59.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 +27 -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
@@ -1,40 +1,41 @@
1
- $ bun build:types && bun build:bundle
2
- $ tsc --noEmit
3
- $ tsdown
4
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
5
- ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/integration-supabase/tsdown.config.js
6
- ℹ entry: src/blueprint.ts, src/connection.sample.ts, src/example.ts, src/index.ts, src/runtime.sample.ts, src/tenant.ts, src/docs/index.ts, src/docs/integration-supabase.docblock.ts
7
- ℹ target: esnext
8
- ℹ tsconfig: tsconfig.json
9
- ℹ Build start
10
- ℹ dist/docs/integration-supabase.docblock.js 2.34 kB │ gzip: 1.09 kB
11
- ℹ dist/blueprint.js 1.84 kB │ gzip: 0.72 kB
12
- ℹ dist/connection.sample.js 1.43 kB │ gzip: 0.50 kB
13
- ℹ dist/tenant.js 1.11 kB │ gzip: 0.53 kB
14
- ℹ dist/runtime.sample.js 1.07 kB │ gzip: 0.54 kB
15
- ℹ dist/example.js 1.04 kB │ gzip: 0.54 kB
16
- ℹ dist/index.js 0.56 kB │ gzip: 0.20 kB
17
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.07 kB
18
- ℹ dist/docs/integration-supabase.docblock.js.map 2.92 kB │ gzip: 1.30 kB
19
- ℹ dist/blueprint.js.map 2.90 kB │ gzip: 1.05 kB
20
- ℹ dist/runtime.sample.js.map 2.22 kB │ gzip: 0.94 kB
21
- ℹ dist/connection.sample.js.map 2.19 kB │ gzip: 0.72 kB
22
- ℹ dist/tenant.js.map 1.80 kB │ gzip: 0.81 kB
23
- ℹ dist/example.js.map 1.51 kB │ gzip: 0.73 kB
24
- ℹ dist/runtime.sample.d.ts.map 0.28 kB │ gzip: 0.19 kB
25
- ℹ dist/connection.sample.d.ts.map 0.20 kB │ gzip: 0.15 kB
26
- ℹ dist/example.d.ts.map 0.13 kB │ gzip: 0.13 kB
27
- ℹ dist/blueprint.d.ts.map 0.12 kB │ gzip: 0.12 kB
28
- ℹ dist/tenant.d.ts.map 0.11 kB │ gzip: 0.12 kB
29
- ℹ dist/runtime.sample.d.ts 0.73 kB │ gzip: 0.32 kB
30
- ℹ dist/index.d.ts 0.66 kB │ gzip: 0.21 kB
31
- ℹ dist/connection.sample.d.ts 0.48 kB │ gzip: 0.21 kB
32
- ℹ dist/blueprint.d.ts 0.26 kB │ gzip: 0.18 kB
33
- ℹ dist/tenant.d.ts 0.26 kB │ gzip: 0.18 kB
34
- ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
35
- ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
36
- ℹ dist/docs/integration-supabase.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
37
- ℹ 27 files, total: 26.47 kB
38
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
1
+ $ contractspec-bun-build prebuild
2
+ $ bun run prebuild && bun run build:bundle && bun run build:types
3
+ $ contractspec-bun-build prebuild
4
+ $ contractspec-bun-build transpile
5
+ [contractspec-bun-build] transpile target=bun root=src entries=8
6
+ Bundled 8 modules in 11ms
39
7
 
40
- ✔ Build complete in 21963ms
8
+ ./blueprint.js 1.92 KB (entry point)
9
+ ./index.js 8.81 KB (entry point)
10
+ ./connection.sample.js 1.45 KB (entry point)
11
+ docs/index.js 2.33 KB (entry point)
12
+ docs/integration-supabase.docblock.js 2.33 KB (entry point)
13
+ ./example.js 1.0 KB (entry point)
14
+ ./runtime.sample.js 1.0 KB (entry point)
15
+ ./tenant.js 1.12 KB (entry point)
16
+
17
+ [contractspec-bun-build] transpile target=node root=src entries=8
18
+ Bundled 8 modules in 25ms
19
+
20
+ ./blueprint.js 1.91 KB (entry point)
21
+ ./index.js 8.80 KB (entry point)
22
+ ./connection.sample.js 1.44 KB (entry point)
23
+ docs/index.js 2.32 KB (entry point)
24
+ docs/integration-supabase.docblock.js 2.32 KB (entry point)
25
+ ./example.js 1.0 KB (entry point)
26
+ ./runtime.sample.js 1.0 KB (entry point)
27
+ ./tenant.js 1.12 KB (entry point)
28
+
29
+ [contractspec-bun-build] transpile target=browser root=src entries=8
30
+ Bundled 8 modules in 15ms
31
+
32
+ ./blueprint.js 1.91 KB (entry point)
33
+ ./index.js 8.80 KB (entry point)
34
+ ./connection.sample.js 1.44 KB (entry point)
35
+ docs/index.js 2.32 KB (entry point)
36
+ docs/integration-supabase.docblock.js 2.32 KB (entry point)
37
+ ./example.js 1.0 KB (entry point)
38
+ ./runtime.sample.js 1.0 KB (entry point)
39
+ ./tenant.js 1.12 KB (entry point)
40
+
41
+ $ contractspec-bun-build types
@@ -0,0 +1 @@
1
+ $ contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @contractspec/example.integration-supabase
2
2
 
3
+ ## 1.59.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1a0cf44: fix: publishConfig not supported by bun
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [1a0cf44]
12
+ - @contractspec/integration.providers-impls@1.59.0
13
+ - @contractspec/integration.runtime@1.59.0
14
+ - @contractspec/lib.contracts@1.59.0
15
+
16
+ ## 1.58.0
17
+
18
+ ### Minor Changes
19
+
20
+ - d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [d1f0fd0]
25
+ - Updated dependencies [4355a9e]
26
+ - @contractspec/integration.providers-impls@1.58.0
27
+ - @contractspec/integration.runtime@1.58.0
28
+ - @contractspec/lib.contracts@1.58.0
29
+
3
30
  ## 1.57.0
4
31
 
5
32
  ### Minor Changes
@@ -1,7 +1,3 @@
1
- import { AppBlueprintSpec } from "@contractspec/lib.contracts/app-config/spec";
2
-
3
- //#region src/blueprint.d.ts
4
- declare const supabaseKnowledgeBlueprint: AppBlueprintSpec;
5
- //#endregion
6
- export { supabaseKnowledgeBlueprint };
1
+ import type { AppBlueprintSpec } from '@contractspec/lib.contracts/app-config/spec';
2
+ export declare const supabaseKnowledgeBlueprint: AppBlueprintSpec;
7
3
  //# sourceMappingURL=blueprint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint.d.ts","names":[],"sources":["../src/blueprint.ts"],"mappings":";;;cAOa,0BAAA,EAA4B,gBAAA"}
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../src/blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAOpF,eAAO,MAAM,0BAA0B,EAAE,gBA4DxC,CAAC"}
package/dist/blueprint.js CHANGED
@@ -1,75 +1,68 @@
1
- import { OwnersEnum, StabilityEnum, TagsEnum } from "@contractspec/lib.contracts/ownership";
2
-
3
- //#region src/blueprint.ts
4
- const supabaseKnowledgeBlueprint = {
5
- meta: {
6
- key: "knowledge.supabase.dual-store",
7
- version: "1.0.0",
8
- appId: "knowledge-assistant",
9
- title: "Knowledge Assistant - Supabase Dual Store",
10
- description: "Blueprint that uses Supabase for both vector retrieval and SQL-backed analytics.",
11
- domain: "knowledge",
12
- owners: [OwnersEnum.PlatformCore],
13
- tags: [
14
- TagsEnum.Automation,
15
- "knowledge",
16
- "supabase",
17
- "vector-db",
18
- "database"
19
- ],
20
- stability: StabilityEnum.Experimental
21
- },
22
- capabilities: { enabled: [
23
- {
24
- key: "vector-db.search",
25
- version: "1.0.0"
26
- },
27
- {
28
- key: "vector-db.storage",
29
- version: "1.0.0"
30
- },
31
- {
32
- key: "database.sql",
33
- version: "1.0.0"
34
- }
35
- ] },
36
- integrationSlots: [{
37
- slotId: "primary-vector-db",
38
- requiredCategory: "vector-db",
39
- allowedModes: ["managed", "byok"],
40
- requiredCapabilities: [{
41
- key: "vector-db.search",
42
- version: "1.0.0"
43
- }, {
44
- key: "vector-db.storage",
45
- version: "1.0.0"
46
- }],
47
- required: true,
48
- description: "Primary semantic retrieval store for knowledge chunks."
49
- }, {
50
- slotId: "primary-database",
51
- requiredCategory: "database",
52
- allowedModes: ["managed", "byok"],
53
- requiredCapabilities: [{
54
- key: "database.sql",
55
- version: "1.0.0"
56
- }],
57
- required: true,
58
- description: "Primary SQL database for analytics and transactional reads."
59
- }],
60
- workflows: {
61
- ingestKnowledge: {
62
- key: "knowledge.ingest.supabase",
63
- version: "1.0.0"
64
- },
65
- refreshMetrics: {
66
- key: "knowledge.metrics.supabase",
67
- version: "1.0.0"
68
- }
69
- },
70
- notes: "Bind both slots to Supabase connections when you want shared infra for embeddings and SQL operations."
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
+ export {
67
+ supabaseKnowledgeBlueprint
71
68
  };
72
-
73
- //#endregion
74
- export { supabaseKnowledgeBlueprint };
75
- //# sourceMappingURL=blueprint.js.map
@@ -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
+ };