@buildpad/mcp 0.1.10 → 0.1.12
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.
- package/dist/index.js +267 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5338,6 +5338,9 @@ function loadRegistry() {
|
|
|
5338
5338
|
"supabase": [
|
|
5339
5339
|
"@supabase/ssr@^0.5",
|
|
5340
5340
|
"@supabase/supabase-js@^2"
|
|
5341
|
+
],
|
|
5342
|
+
"oauth": [
|
|
5343
|
+
"jose"
|
|
5341
5344
|
]
|
|
5342
5345
|
},
|
|
5343
5346
|
"lib": {
|
|
@@ -5577,12 +5580,8 @@ function loadRegistry() {
|
|
|
5577
5580
|
},
|
|
5578
5581
|
"api-routes": {
|
|
5579
5582
|
"name": "api-routes",
|
|
5580
|
-
"description": "
|
|
5583
|
+
"description": "Server-side Supabase auth routes for Next.js (login, logout, callback, user)",
|
|
5581
5584
|
"files": [
|
|
5582
|
-
{
|
|
5583
|
-
"source": "cli/templates/api/auth-headers.ts",
|
|
5584
|
-
"target": "lib/api/auth-headers.ts"
|
|
5585
|
-
},
|
|
5586
5585
|
{
|
|
5587
5586
|
"source": "cli/templates/api/auth-login-route.ts",
|
|
5588
5587
|
"target": "app/api/auth/login/route.ts"
|
|
@@ -5602,38 +5601,6 @@ function loadRegistry() {
|
|
|
5602
5601
|
{
|
|
5603
5602
|
"source": "cli/templates/api/login-page.tsx",
|
|
5604
5603
|
"target": "app/login/page.tsx"
|
|
5605
|
-
},
|
|
5606
|
-
{
|
|
5607
|
-
"source": "cli/templates/api/fields-route.ts",
|
|
5608
|
-
"target": "app/api/fields/[collection]/route.ts"
|
|
5609
|
-
},
|
|
5610
|
-
{
|
|
5611
|
-
"source": "cli/templates/api/items-route.ts",
|
|
5612
|
-
"target": "app/api/items/[collection]/route.ts"
|
|
5613
|
-
},
|
|
5614
|
-
{
|
|
5615
|
-
"source": "cli/templates/api/items-id-route.ts",
|
|
5616
|
-
"target": "app/api/items/[collection]/[id]/route.ts"
|
|
5617
|
-
},
|
|
5618
|
-
{
|
|
5619
|
-
"source": "cli/templates/api/relations-route.ts",
|
|
5620
|
-
"target": "app/api/relations/route.ts"
|
|
5621
|
-
},
|
|
5622
|
-
{
|
|
5623
|
-
"source": "cli/templates/api/files-route.ts",
|
|
5624
|
-
"target": "app/api/files/route.ts"
|
|
5625
|
-
},
|
|
5626
|
-
{
|
|
5627
|
-
"source": "cli/templates/api/files-id-route.ts",
|
|
5628
|
-
"target": "app/api/files/[id]/route.ts"
|
|
5629
|
-
},
|
|
5630
|
-
{
|
|
5631
|
-
"source": "cli/templates/api/collections-route.ts",
|
|
5632
|
-
"target": "app/api/collections/route.ts"
|
|
5633
|
-
},
|
|
5634
|
-
{
|
|
5635
|
-
"source": "cli/templates/api/permissions-me-route.ts",
|
|
5636
|
-
"target": "app/api/permissions/me/route.ts"
|
|
5637
5604
|
}
|
|
5638
5605
|
],
|
|
5639
5606
|
"internalDependencies": [
|
|
@@ -5686,11 +5653,85 @@ function loadRegistry() {
|
|
|
5686
5653
|
"source": "cli/templates/supabase/middleware.ts",
|
|
5687
5654
|
"target": "lib/supabase/middleware.ts"
|
|
5688
5655
|
},
|
|
5656
|
+
{
|
|
5657
|
+
"source": "cli/templates/supabase/admin.ts",
|
|
5658
|
+
"target": "lib/supabase/admin.ts"
|
|
5659
|
+
},
|
|
5689
5660
|
{
|
|
5690
5661
|
"source": "cli/templates/middleware/middleware.ts",
|
|
5691
5662
|
"target": "middleware.ts"
|
|
5692
5663
|
}
|
|
5693
5664
|
]
|
|
5665
|
+
},
|
|
5666
|
+
"external-oauth": {
|
|
5667
|
+
"name": "external-oauth",
|
|
5668
|
+
"description": "External OAuth2/OIDC integration where Next.js acts as the OAuth client. Supports Azure AD, Google, Okta, Auth0, and generic OIDC providers. Includes PKCE, AES-256-GCM state encryption, JIT user provisioning, and multi-source claim extraction.",
|
|
5669
|
+
"dependencies": [
|
|
5670
|
+
"jose"
|
|
5671
|
+
],
|
|
5672
|
+
"internalDependencies": [
|
|
5673
|
+
"supabase-auth",
|
|
5674
|
+
"api-routes"
|
|
5675
|
+
],
|
|
5676
|
+
"files": [
|
|
5677
|
+
{
|
|
5678
|
+
"source": "cli/templates/lib/oauth/config.ts",
|
|
5679
|
+
"target": "lib/oauth/config.ts"
|
|
5680
|
+
},
|
|
5681
|
+
{
|
|
5682
|
+
"source": "cli/templates/lib/oauth/pkce.ts",
|
|
5683
|
+
"target": "lib/oauth/pkce.ts"
|
|
5684
|
+
},
|
|
5685
|
+
{
|
|
5686
|
+
"source": "cli/templates/lib/oauth/validate.ts",
|
|
5687
|
+
"target": "lib/oauth/validate.ts"
|
|
5688
|
+
},
|
|
5689
|
+
{
|
|
5690
|
+
"source": "cli/templates/lib/oauth/index.ts",
|
|
5691
|
+
"target": "lib/oauth/index.ts"
|
|
5692
|
+
},
|
|
5693
|
+
{
|
|
5694
|
+
"source": "cli/templates/api/auth-callback-oauth-route.ts",
|
|
5695
|
+
"target": "app/api/auth/callback/route.ts"
|
|
5696
|
+
},
|
|
5697
|
+
{
|
|
5698
|
+
"source": "cli/templates/api/auth-oauth-provider-route.ts",
|
|
5699
|
+
"target": "app/api/auth/oauth/[provider]/route.ts"
|
|
5700
|
+
},
|
|
5701
|
+
{
|
|
5702
|
+
"source": "cli/templates/components/auth/OAuthLoginButtons.tsx",
|
|
5703
|
+
"target": "components/auth/OAuthLoginButtons.tsx"
|
|
5704
|
+
}
|
|
5705
|
+
]
|
|
5706
|
+
},
|
|
5707
|
+
"scope-routes": {
|
|
5708
|
+
"name": "scope-routes",
|
|
5709
|
+
"description": "DaaS multi-tenant scope system \u2014 ScopeProvider context, ScopeSwitcher, error handling, and onboarding page. Calls DaaS directly; no proxy routes needed.",
|
|
5710
|
+
"internalDependencies": [
|
|
5711
|
+
"supabase-auth"
|
|
5712
|
+
],
|
|
5713
|
+
"files": [
|
|
5714
|
+
{
|
|
5715
|
+
"source": "cli/templates/lib/scope/context.tsx",
|
|
5716
|
+
"target": "lib/scope/context.tsx"
|
|
5717
|
+
},
|
|
5718
|
+
{
|
|
5719
|
+
"source": "cli/templates/lib/scope/use-scope-error.ts",
|
|
5720
|
+
"target": "lib/scope/use-scope-error.ts"
|
|
5721
|
+
},
|
|
5722
|
+
{
|
|
5723
|
+
"source": "cli/templates/lib/scope/index.ts",
|
|
5724
|
+
"target": "lib/scope/index.ts"
|
|
5725
|
+
},
|
|
5726
|
+
{
|
|
5727
|
+
"source": "cli/templates/components/scope-switcher.tsx",
|
|
5728
|
+
"target": "components/ScopeSwitcher.tsx"
|
|
5729
|
+
},
|
|
5730
|
+
{
|
|
5731
|
+
"source": "cli/templates/app/select-scope/page.tsx",
|
|
5732
|
+
"target": "app/select-scope/page.tsx"
|
|
5733
|
+
}
|
|
5734
|
+
]
|
|
5694
5735
|
}
|
|
5695
5736
|
},
|
|
5696
5737
|
"components": [
|
|
@@ -5799,6 +5840,73 @@ function loadRegistry() {
|
|
|
5799
5840
|
"hasOptions": true
|
|
5800
5841
|
}
|
|
5801
5842
|
},
|
|
5843
|
+
{
|
|
5844
|
+
"name": "input-hash",
|
|
5845
|
+
"title": "InputHash",
|
|
5846
|
+
"description": "Hashed input interface for securely storing values like passwords. Shows lock icon indicator for existing hashed values.",
|
|
5847
|
+
"category": "input",
|
|
5848
|
+
"files": [
|
|
5849
|
+
{
|
|
5850
|
+
"source": "ui-interfaces/src/input-hash/InputHash.tsx",
|
|
5851
|
+
"target": "components/ui/input-hash.tsx"
|
|
5852
|
+
}
|
|
5853
|
+
],
|
|
5854
|
+
"dependencies": [
|
|
5855
|
+
"@mantine/core",
|
|
5856
|
+
"@tabler/icons-react"
|
|
5857
|
+
],
|
|
5858
|
+
"internalDependencies": [],
|
|
5859
|
+
"interface": {
|
|
5860
|
+
"id": "input-hash",
|
|
5861
|
+
"name": "Hash",
|
|
5862
|
+
"icon": "IconFingerprint",
|
|
5863
|
+
"types": [
|
|
5864
|
+
"hash"
|
|
5865
|
+
],
|
|
5866
|
+
"localTypes": [
|
|
5867
|
+
"standard"
|
|
5868
|
+
],
|
|
5869
|
+
"group": "other",
|
|
5870
|
+
"order": 4,
|
|
5871
|
+
"supported": true,
|
|
5872
|
+
"hasOptions": true
|
|
5873
|
+
}
|
|
5874
|
+
},
|
|
5875
|
+
{
|
|
5876
|
+
"name": "system-token",
|
|
5877
|
+
"title": "SystemToken",
|
|
5878
|
+
"description": "Token generator interface with generate, copy, and remove actions. Used for API tokens and system authentication keys.",
|
|
5879
|
+
"category": "input",
|
|
5880
|
+
"files": [
|
|
5881
|
+
{
|
|
5882
|
+
"source": "ui-interfaces/src/system-token/SystemToken.tsx",
|
|
5883
|
+
"target": "components/ui/system-token.tsx"
|
|
5884
|
+
}
|
|
5885
|
+
],
|
|
5886
|
+
"dependencies": [
|
|
5887
|
+
"@mantine/core",
|
|
5888
|
+
"@tabler/icons-react"
|
|
5889
|
+
],
|
|
5890
|
+
"internalDependencies": [
|
|
5891
|
+
"services",
|
|
5892
|
+
"hooks"
|
|
5893
|
+
],
|
|
5894
|
+
"interface": {
|
|
5895
|
+
"id": "system-token",
|
|
5896
|
+
"name": "Token",
|
|
5897
|
+
"icon": "IconKey",
|
|
5898
|
+
"types": [
|
|
5899
|
+
"hash"
|
|
5900
|
+
],
|
|
5901
|
+
"localTypes": [
|
|
5902
|
+
"standard"
|
|
5903
|
+
],
|
|
5904
|
+
"group": "other",
|
|
5905
|
+
"order": 5,
|
|
5906
|
+
"supported": true,
|
|
5907
|
+
"hasOptions": false
|
|
5908
|
+
}
|
|
5909
|
+
},
|
|
5802
5910
|
{
|
|
5803
5911
|
"name": "input-block-editor",
|
|
5804
5912
|
"title": "InputBlockEditor",
|
|
@@ -7120,6 +7228,26 @@ function loadRegistry() {
|
|
|
7120
7228
|
{
|
|
7121
7229
|
"source": "ui-collections/src/CollectionList.tsx",
|
|
7122
7230
|
"target": "components/ui/collection-list.tsx"
|
|
7231
|
+
},
|
|
7232
|
+
{
|
|
7233
|
+
"source": "ui-collections/src/CollectionList.css",
|
|
7234
|
+
"target": "components/ui/collection-list.css"
|
|
7235
|
+
},
|
|
7236
|
+
{
|
|
7237
|
+
"source": "ui-collections/src/CollectionListToolbar.tsx",
|
|
7238
|
+
"target": "components/ui/collection-list-toolbar.tsx"
|
|
7239
|
+
},
|
|
7240
|
+
{
|
|
7241
|
+
"source": "ui-collections/src/CollectionListFooter.tsx",
|
|
7242
|
+
"target": "components/ui/collection-list-footer.tsx"
|
|
7243
|
+
},
|
|
7244
|
+
{
|
|
7245
|
+
"source": "ui-collections/src/DeleteConfirmModal.tsx",
|
|
7246
|
+
"target": "components/ui/delete-confirm-modal.tsx"
|
|
7247
|
+
},
|
|
7248
|
+
{
|
|
7249
|
+
"source": "ui-collections/src/BulkActionsBar.tsx",
|
|
7250
|
+
"target": "components/ui/bulk-actions-bar.tsx"
|
|
7123
7251
|
}
|
|
7124
7252
|
],
|
|
7125
7253
|
"dependencies": [
|
|
@@ -7405,6 +7533,9 @@ function getComponentsByCategory(category) {
|
|
|
7405
7533
|
function getCategories() {
|
|
7406
7534
|
return getRegistry().categories;
|
|
7407
7535
|
}
|
|
7536
|
+
function getLibModule(name) {
|
|
7537
|
+
return getRegistry().lib[name];
|
|
7538
|
+
}
|
|
7408
7539
|
var PACKAGES = [
|
|
7409
7540
|
{
|
|
7410
7541
|
name: "@buildpad/types",
|
|
@@ -7657,10 +7788,12 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
|
7657
7788
|
if (uri.startsWith("buildpad://components/")) {
|
|
7658
7789
|
const componentName = uri.replace("buildpad://components/", "");
|
|
7659
7790
|
const component = getComponent(componentName);
|
|
7660
|
-
|
|
7791
|
+
const libModule = !component ? getLibModule(componentName) : void 0;
|
|
7792
|
+
if (!component && !libModule) {
|
|
7661
7793
|
throw new Error(`Component not found: ${componentName}`);
|
|
7662
7794
|
}
|
|
7663
|
-
const
|
|
7795
|
+
const files = component ? component.files : libModule.files ?? [];
|
|
7796
|
+
const sourcePath = files[0]?.source;
|
|
7664
7797
|
const source = sourcePath ? readSourceFile(sourcePath) : null;
|
|
7665
7798
|
if (!source) {
|
|
7666
7799
|
throw new Error(`Source file not found for component: ${componentName}`);
|
|
@@ -7873,9 +8006,32 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
7873
8006
|
throw new Error("Component name is required");
|
|
7874
8007
|
}
|
|
7875
8008
|
const component = getComponent(componentName);
|
|
7876
|
-
|
|
8009
|
+
const libModule = !component ? getLibModule(componentName) : void 0;
|
|
8010
|
+
if (!component && !libModule) {
|
|
7877
8011
|
throw new Error(`Component not found: ${componentName}`);
|
|
7878
8012
|
}
|
|
8013
|
+
if (libModule) {
|
|
8014
|
+
const libFiles = {};
|
|
8015
|
+
for (const file of libModule.files ?? []) {
|
|
8016
|
+
const content = readSourceFile(file.source);
|
|
8017
|
+
if (content) libFiles[file.target] = content;
|
|
8018
|
+
}
|
|
8019
|
+
return {
|
|
8020
|
+
content: [{
|
|
8021
|
+
type: "text",
|
|
8022
|
+
text: JSON.stringify({
|
|
8023
|
+
name: libModule.name,
|
|
8024
|
+
description: libModule.description,
|
|
8025
|
+
type: "lib-module",
|
|
8026
|
+
files: libModule.files,
|
|
8027
|
+
dependencies: libModule.dependencies ?? [],
|
|
8028
|
+
internalDependencies: libModule.internalDependencies ?? [],
|
|
8029
|
+
allSources: libFiles,
|
|
8030
|
+
installCommand: `npx @buildpad/cli add ${libModule.name}`
|
|
8031
|
+
}, null, 2)
|
|
8032
|
+
}]
|
|
8033
|
+
};
|
|
8034
|
+
}
|
|
7879
8035
|
const sources = {};
|
|
7880
8036
|
for (const file of component.files) {
|
|
7881
8037
|
const content = readSourceFile(file.source);
|
|
@@ -7915,9 +8071,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
7915
8071
|
throw new Error("Component name is required");
|
|
7916
8072
|
}
|
|
7917
8073
|
const component = getComponent(componentName);
|
|
7918
|
-
|
|
8074
|
+
const libModule = !component ? getLibModule(componentName) : void 0;
|
|
8075
|
+
if (!component && !libModule) {
|
|
7919
8076
|
throw new Error(`Component not found: ${componentName}`);
|
|
7920
8077
|
}
|
|
8078
|
+
if (libModule) {
|
|
8079
|
+
return {
|
|
8080
|
+
content: [{
|
|
8081
|
+
type: "text",
|
|
8082
|
+
text: `// Lib module: ${libModule.name}
|
|
8083
|
+
// Install via CLI:
|
|
8084
|
+
// npx @buildpad/cli add ${libModule.name}
|
|
8085
|
+
|
|
8086
|
+
// ${libModule.description}`
|
|
8087
|
+
}]
|
|
8088
|
+
};
|
|
8089
|
+
}
|
|
7921
8090
|
const example = generateUsageExample(component);
|
|
7922
8091
|
return {
|
|
7923
8092
|
content: [
|
|
@@ -8153,9 +8322,58 @@ your-project/
|
|
|
8153
8322
|
throw new Error("Component name is required");
|
|
8154
8323
|
}
|
|
8155
8324
|
const component = getComponent(componentName);
|
|
8156
|
-
|
|
8325
|
+
const libModule = !component ? getLibModule(componentName) : void 0;
|
|
8326
|
+
if (!component && !libModule) {
|
|
8157
8327
|
throw new Error(`Component not found: ${componentName}`);
|
|
8158
8328
|
}
|
|
8329
|
+
if (libModule) {
|
|
8330
|
+
const registry = getRegistry();
|
|
8331
|
+
const allLibFiles = [];
|
|
8332
|
+
const visited = /* @__PURE__ */ new Set();
|
|
8333
|
+
const resolveLib = (name2) => {
|
|
8334
|
+
if (visited.has(name2)) return;
|
|
8335
|
+
visited.add(name2);
|
|
8336
|
+
const mod = registry.lib[name2];
|
|
8337
|
+
if (!mod) return;
|
|
8338
|
+
for (const dep of mod.internalDependencies ?? []) resolveLib(dep);
|
|
8339
|
+
for (const file of mod.files ?? []) {
|
|
8340
|
+
const content = readSourceFile(file.source);
|
|
8341
|
+
if (content) allLibFiles.push({ path: file.target, content, module: name2 });
|
|
8342
|
+
}
|
|
8343
|
+
};
|
|
8344
|
+
resolveLib(componentName);
|
|
8345
|
+
const allDeps = [...new Set(
|
|
8346
|
+
[...visited].flatMap((n) => (registry.lib[n]?.dependencies ?? []).map((d) => d.replace(/@[^@/]*$/, "")))
|
|
8347
|
+
)];
|
|
8348
|
+
return {
|
|
8349
|
+
content: [{
|
|
8350
|
+
type: "text",
|
|
8351
|
+
text: JSON.stringify({
|
|
8352
|
+
name: libModule.name,
|
|
8353
|
+
description: libModule.description,
|
|
8354
|
+
type: "lib-module",
|
|
8355
|
+
files: allLibFiles,
|
|
8356
|
+
peerDependencies: allDeps,
|
|
8357
|
+
installCommand: `npx @buildpad/cli add ${libModule.name}`,
|
|
8358
|
+
instructions: `## Install lib module: ${libModule.name}
|
|
8359
|
+
|
|
8360
|
+
\`\`\`bash
|
|
8361
|
+
npx @buildpad/cli add ${libModule.name}
|
|
8362
|
+
\`\`\`
|
|
8363
|
+
|
|
8364
|
+
${libModule.description}
|
|
8365
|
+
|
|
8366
|
+
Files installed:
|
|
8367
|
+
${allLibFiles.map((f) => `- \`${f.path}\` (${f.module})`).join("\n")}${allDeps.length ? `
|
|
8368
|
+
|
|
8369
|
+
### npm dependencies
|
|
8370
|
+
\`\`\`bash
|
|
8371
|
+
pnpm add ${allDeps.join(" ")}
|
|
8372
|
+
\`\`\`` : ""}`
|
|
8373
|
+
}, null, 2)
|
|
8374
|
+
}]
|
|
8375
|
+
};
|
|
8376
|
+
}
|
|
8159
8377
|
const files = [];
|
|
8160
8378
|
for (const file of component.files) {
|
|
8161
8379
|
const content = readSourceFile(file.source);
|
|
@@ -8170,10 +8388,10 @@ your-project/
|
|
|
8170
8388
|
if (includeLib && component.internalDependencies?.length > 0) {
|
|
8171
8389
|
const registry = getRegistry();
|
|
8172
8390
|
for (const dep of component.internalDependencies) {
|
|
8173
|
-
const
|
|
8174
|
-
if (
|
|
8175
|
-
if (
|
|
8176
|
-
for (const file of
|
|
8391
|
+
const libModule2 = registry.lib[dep];
|
|
8392
|
+
if (libModule2) {
|
|
8393
|
+
if (libModule2.files) {
|
|
8394
|
+
for (const file of libModule2.files) {
|
|
8177
8395
|
const content = readSourceFile(file.source);
|
|
8178
8396
|
if (content) {
|
|
8179
8397
|
libFiles.push({
|
|
@@ -8183,11 +8401,11 @@ your-project/
|
|
|
8183
8401
|
});
|
|
8184
8402
|
}
|
|
8185
8403
|
}
|
|
8186
|
-
} else if (
|
|
8187
|
-
const content = readSourceFile(
|
|
8404
|
+
} else if (libModule2.path && libModule2.target) {
|
|
8405
|
+
const content = readSourceFile(libModule2.path);
|
|
8188
8406
|
if (content) {
|
|
8189
8407
|
libFiles.push({
|
|
8190
|
-
path:
|
|
8408
|
+
path: libModule2.target,
|
|
8191
8409
|
content,
|
|
8192
8410
|
module: dep
|
|
8193
8411
|
});
|