├── apps ├── docs │ ├── client │ │ ├── src │ │ │ ├── pages │ │ │ │ ├── index.astro │ │ │ │ └── [locale] │ │ │ │ │ └── [...slug].astro │ │ │ ├── components │ │ │ │ ├── ui │ │ │ │ │ ├── Footer.astro │ │ │ │ │ ├── BaseHead.astro │ │ │ │ │ ├── AccordionGroup.tsx │ │ │ │ │ ├── StepGroup.tsx │ │ │ │ │ ├── Step.tsx │ │ │ │ │ ├── LanguageSelector.tsx │ │ │ │ │ ├── PageTitle.tsx │ │ │ │ │ ├── Accordion.tsx │ │ │ │ │ └── Card.astro │ │ │ │ ├── markdown │ │ │ │ │ ├── Tbody.astro │ │ │ │ │ ├── Pre.astro │ │ │ │ │ ├── Thead.astro │ │ │ │ │ ├── Tr.astro │ │ │ │ │ ├── Td.astro │ │ │ │ │ ├── Th.astro │ │ │ │ │ ├── Blockquote.astro │ │ │ │ │ ├── Table.astro │ │ │ │ │ ├── Code.astro │ │ │ │ │ └── Img.astro │ │ │ │ └── atoms │ │ │ │ │ └── Icon.tsx │ │ │ ├── i18n │ │ │ │ ├── utils.ts │ │ │ │ └── ui.ts │ │ │ ├── content.config.ts │ │ │ └── config │ │ │ │ └── site.ts │ │ └── public │ │ │ └── favicon.ico │ ├── tsconfig.json │ ├── .gitignore │ ├── wrangler.toml │ ├── server │ │ └── main.ts │ ├── astro.config.mjs │ └── package.json └── mesh │ ├── public │ ├── empty-state-home.png │ ├── empty-state-cards.png │ ├── logos │ │ ├── cursor.svg │ │ ├── Windsurf.svg │ │ └── deco logo.svg │ └── favicon.svg │ ├── src │ ├── web │ │ ├── components │ │ │ ├── tools │ │ │ │ └── index.ts │ │ │ ├── splash-screen.tsx │ │ │ ├── store │ │ │ │ ├── app-detail │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── app-detail-header.tsx │ │ │ │ │ └── types.ts │ │ │ │ └── index.ts │ │ │ ├── collections │ │ │ │ ├── collection-page.tsx │ │ │ │ ├── collection-header.tsx │ │ │ │ ├── collection-search.tsx │ │ │ │ └── collection-table-wrapper.tsx │ │ │ ├── details │ │ │ │ └── connection │ │ │ │ │ ├── readme-tab.tsx │ │ │ │ │ ├── tools-tab.tsx │ │ │ │ │ └── settings-tab │ │ │ │ │ └── schema.ts │ │ │ ├── mesh-sidebar.tsx │ │ │ ├── integration-icon.tsx │ │ │ └── error-boundary.tsx │ │ ├── routes │ │ │ ├── orgs │ │ │ │ ├── gateway-detail.tsx │ │ │ │ ├── connection-detail.tsx │ │ │ │ └── home │ │ │ │ │ ├── monitoring-types.ts │ │ │ │ │ └── home-grid-cell.tsx │ │ │ ├── home.tsx │ │ │ └── auth-catchall.tsx │ │ ├── utils │ │ │ ├── slugify.ts │ │ │ ├── normalize-url.ts │ │ │ ├── date-range.ts │ │ │ ├── constants.ts │ │ │ ├── github-icon.ts │ │ │ └── app-name.ts │ │ ├── hooks │ │ │ ├── use-deco-chat-open.ts │ │ │ ├── use-oauth-token-validation.ts │ │ │ ├── use-members.ts │ │ │ ├── use-publisher-connection.ts │ │ │ └── collections │ │ │ │ ├── use-llm.ts │ │ │ │ └── use-agent.ts │ │ ├── lib │ │ │ ├── auth-client.ts │ │ │ ├── localstorage-keys.ts │ │ │ └── locator.ts │ │ ├── layouts │ │ │ └── required-auth-layout.tsx │ │ ├── providers │ │ │ ├── providers.tsx │ │ │ ├── better-auth-ui-provider.tsx │ │ │ ├── project-context-provider.tsx │ │ │ └── auth-config-provider.tsx │ │ └── types │ │ │ └── chat-threads.ts │ ├── api │ │ ├── env.ts │ │ ├── index.ts │ │ ├── routes │ │ │ └── management.ts │ │ ├── http-server-transport.ts │ │ └── utils │ │ │ └── compose.ts │ ├── tools │ │ ├── monitoring │ │ │ ├── index.ts │ │ │ └── stats.ts │ │ ├── apiKeys │ │ │ ├── index.ts │ │ │ └── create.ts │ │ ├── eventbus │ │ │ ├── index.ts │ │ │ ├── list.ts │ │ │ ├── ack.ts │ │ │ ├── subscribe.ts │ │ │ └── unsubscribe.ts │ │ ├── organization │ │ │ ├── schema.ts │ │ │ ├── index.ts │ │ │ ├── delete.ts │ │ │ ├── settings-get.ts │ │ │ ├── settings-update.ts │ │ │ ├── get.ts │ │ │ ├── list.ts │ │ │ ├── member-remove.ts │ │ │ ├── update.ts │ │ │ └── member-list.ts │ │ ├── connection │ │ │ ├── index.ts │ │ │ ├── json-path.ts │ │ │ ├── test.ts │ │ │ ├── get.ts │ │ │ └── delete.ts │ │ ├── gateway │ │ │ └── index.ts │ │ ├── database │ │ │ └── index.ts │ │ └── registry.test.ts │ ├── shared │ │ └── utils │ │ │ └── generate-id.ts │ ├── auth │ │ ├── roles.ts │ │ ├── oauth-providers.ts │ │ ├── index.test.ts │ │ └── magic-link.ts │ ├── common.ts │ ├── index.ts │ ├── observability │ │ └── index.ts │ └── monitoring │ │ └── types.ts │ ├── index.css │ ├── index.html │ ├── .gitignore │ ├── migrations │ ├── 011-gateway-icon.ts │ ├── 006-add-views-to-settings.ts │ ├── 002-organization-settings.ts │ ├── 005-connection-configuration.ts │ └── 013-monitoring-user-agent-gateway.ts │ ├── .dockerignore │ ├── auth-config.example.json │ ├── tsconfig.json │ └── vite.config.ts ├── .npmrc ├── packages ├── runtime │ ├── src │ │ ├── proxy.ts │ │ ├── connection.ts │ │ ├── mcp.ts │ │ ├── asset-server │ │ │ └── dev-server-proxy.ts │ │ ├── state.ts │ │ ├── bindings │ │ │ ├── utils.ts │ │ │ ├── index.ts │ │ │ ├── language-model │ │ │ │ └── utils.ts │ │ │ └── channels.ts │ │ └── client.ts │ ├── tsconfig.json │ ├── scripts │ │ └── generate-json-schema.ts │ └── package.json ├── cli │ ├── src │ │ ├── commands │ │ │ ├── projects │ │ │ │ └── index.ts │ │ │ ├── deconfig │ │ │ │ └── index.ts │ │ │ └── hosting │ │ │ │ └── list.ts │ │ ├── cli.ts │ │ ├── deconfig.ts │ │ └── lib │ │ │ ├── package-info.ts │ │ │ ├── runtime.ts │ │ │ ├── banner.ts │ │ │ ├── constants.ts │ │ │ ├── parse-binding-tool.ts │ │ │ ├── supabase.ts │ │ │ ├── slugify.ts │ │ │ ├── projects.ts │ │ │ └── manifest-schema.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── ui │ ├── src │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── CommitMono-VariableFont.woff2 │ │ │ │ └── README.md │ │ ├── lib │ │ │ └── utils.ts │ │ ├── components │ │ │ ├── aspect-ratio.tsx │ │ │ ├── skeleton.tsx │ │ │ ├── sonner.tsx │ │ │ ├── label.tsx │ │ │ ├── separator.tsx │ │ │ ├── textarea.tsx │ │ │ ├── progress.tsx │ │ │ ├── collapsible.tsx │ │ │ ├── sidebar-toggle-button.tsx │ │ │ ├── input.tsx │ │ │ ├── deco-chat-empty-state.tsx │ │ │ ├── sidebar-footer-shell.tsx │ │ │ ├── switch.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── deco-chat-toggle-button.tsx │ │ │ ├── icon.tsx │ │ │ ├── chat │ │ │ │ └── lazy-highlighter.tsx │ │ │ ├── radio-group.tsx │ │ │ ├── hover-card.tsx │ │ │ ├── deco-chat-header.tsx │ │ │ ├── toggle.tsx │ │ │ └── app-topbar.tsx │ │ ├── hooks │ │ │ ├── use-copy.ts │ │ │ ├── use-mobile.ts │ │ │ ├── use-persisted-filters.ts │ │ │ ├── use-sortable.ts │ │ │ └── use-view-mode.ts │ │ └── types │ │ │ └── chat-metadata.ts │ └── components.json ├── bindings │ ├── src │ │ ├── core │ │ │ ├── client │ │ │ │ ├── README.md │ │ │ │ └── index.ts │ │ │ └── connection.ts │ │ └── well-known │ │ │ └── mcp.ts │ ├── tsconfig.json │ ├── package.json │ └── test │ │ └── mcp.test.ts ├── vite-plugin-deco │ ├── package.json │ └── tsconfig.json └── create-deco │ ├── package.json │ └── README.md ├── .vscode └── settings.json ├── deploy ├── conf-examples │ ├── auth-config.json.example │ └── auth-config-sso-email.json.example └── docker-compose.yml ├── .cursorindexingignore ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── pull_request_template.md └── workflows │ ├── deploy-docs.yaml │ └── test.yml ├── .dockerignore ├── .oxlintrc.json ├── biome.json ├── knip.jsonc ├── .gitignore ├── plugins └── enforce-kebab-case-file-names.js └── package.json /apps/docs/client/src/pages/index.astro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | @jsr:registry=https://npm.jsr.io 2 | -------------------------------------------------------------------------------- /packages/runtime/src/proxy.ts: -------------------------------------------------------------------------------- 1 | export * from "@decocms/bindings/client"; 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /apps/docs/client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decocms/mesh/HEAD/apps/docs/client/public/favicon.ico -------------------------------------------------------------------------------- /apps/mesh/public/empty-state-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decocms/mesh/HEAD/apps/mesh/public/empty-state-home.png -------------------------------------------------------------------------------- /apps/mesh/src/web/components/tools/index.ts: -------------------------------------------------------------------------------- 1 | export { ToolsList, type Tool, type ToolsListProps } from "./tools-list"; 2 | -------------------------------------------------------------------------------- /deploy/conf-examples/auth-config.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "emailAndPassword": { 3 | "enabled": true 4 | } 5 | } 6 | 7 | -------------------------------------------------------------------------------- /apps/mesh/public/empty-state-cards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decocms/mesh/HEAD/apps/mesh/public/empty-state-cards.png -------------------------------------------------------------------------------- /.cursorindexingignore: -------------------------------------------------------------------------------- 1 | 2 | # Don't index SpecStory auto-save files, but allow explicit context inclusion via @ references 3 | .specstory/** 4 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/ui/Footer.astro: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | -------------------------------------------------------------------------------- /packages/cli/src/commands/projects/index.ts: -------------------------------------------------------------------------------- 1 | export { exportCommand } from "./export.js"; 2 | export { importCommand } from "./import.js"; 3 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Tbody.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Pre.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 |
6 | -------------------------------------------------------------------------------- /packages/ui/src/assets/fonts/CommitMono-VariableFont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/decocms/mesh/HEAD/packages/ui/src/assets/fonts/CommitMono-VariableFont.woff2 -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Thead.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Tr.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Td.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/mesh/src/web/routes/orgs/gateway-detail.tsx: -------------------------------------------------------------------------------- 1 | import GatewayInspectorView from "@/web/components/details/gateway"; 2 | 3 | export default function GatewayLayout() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /packages/ui/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx"; 2 | import { twMerge } from "tailwind-merge"; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Deco Discord 4 | url: https://deco.cx/discord 5 | about: You can contact us here. 6 | default_assignees: 7 | - viktormarinho 8 | -------------------------------------------------------------------------------- /apps/mesh/src/web/routes/orgs/connection-detail.tsx: -------------------------------------------------------------------------------- 1 | import ConnectionInspectorView from "@/web/components/details/connection"; 2 | 3 | export default function ConnectionLayout() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /packages/runtime/src/connection.ts: -------------------------------------------------------------------------------- 1 | export type { 2 | DecoConnection, 3 | HTTPConnection, 4 | InnateConnection, 5 | MCPConnection, 6 | SSEConnection, 7 | WebsocketConnection, 8 | } from "@decocms/bindings/connection"; 9 | -------------------------------------------------------------------------------- /apps/mesh/src/api/env.ts: -------------------------------------------------------------------------------- 1 | import type { MeshContext } from "../core/mesh-context"; 2 | 3 | // Define Hono variables type 4 | type Variables = { 5 | meshContext: MeshContext; 6 | }; 7 | 8 | export type Env = { Variables: Variables }; 9 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Th.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/monitoring/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Monitoring Tools 3 | * 4 | * MCP tools for querying monitoring logs and statistics. 5 | */ 6 | 7 | export { MONITORING_LOGS_LIST } from "./list"; 8 | export { MONITORING_STATS } from "./stats"; 9 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Blockquote.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 |
9 | 10 |
11 | -------------------------------------------------------------------------------- /apps/mesh/src/shared/utils/generate-id.ts: -------------------------------------------------------------------------------- 1 | import { nanoid } from "nanoid"; 2 | 3 | type IdPrefixes = "conn" | "audit" | "log" | "gw" | "gwc"; 4 | 5 | export function generatePrefixedId(prefix: IdPrefixes) { 6 | return `${prefix}_${nanoid()}`; 7 | } 8 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/splash-screen.tsx: -------------------------------------------------------------------------------- 1 | export function SplashScreen() { 2 | return ( 3 |
4 |
Loading...
5 |
6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /packages/bindings/src/core/client/README.md: -------------------------------------------------------------------------------- 1 | # Client Implementation 2 | 3 | This folder is basically a duplicated implementation based on runtime/binder.ts client. We should duplicate for now since we are remodeling the way applications invoke mesh. 4 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/ui/BaseHead.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const { title } = Astro.props; 3 | const formattedTitle = title ? `${title} - decoCMS` : "decoCMS"; 4 | --- 5 | 6 | {formattedTitle} 7 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Table.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 |
6 | 7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /packages/runtime/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["@cloudflare/workers-types", "@types/node"] 5 | }, 6 | "include": ["src/**/*"], 7 | "exclude": ["node_modules", "dist", "scripts/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Code.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | --- 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /apps/mesh/src/web/routes/home.tsx: -------------------------------------------------------------------------------- 1 | import { OrganizationsHome } from "@/web/components/organizations-home"; 2 | 3 | export default function App() { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /apps/mesh/index.css: -------------------------------------------------------------------------------- 1 | @import "@deco/ui/styles/global.css"; 2 | @import "@daveyplate/better-auth-ui/css"; 3 | 4 | @layer base { 5 | * { 6 | @apply border-border outline-ring/50; 7 | } 8 | body { 9 | @apply bg-background text-foreground; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/store/app-detail/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | export * from "./app-detail-states"; 3 | export * from "./app-detail-header"; 4 | export * from "./app-hero-section"; 5 | export * from "./app-sidebar"; 6 | export * from "./app-tabs-content"; 7 | -------------------------------------------------------------------------------- /packages/cli/src/cli.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { program } from "./commands.js"; 4 | 5 | (async () => { 6 | try { 7 | await program.parseAsync(); 8 | } catch (error) { 9 | console.error(error); 10 | process.exit(1); 11 | } 12 | })(); 13 | -------------------------------------------------------------------------------- /packages/cli/src/deconfig.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { deconfig } from "./commands.js"; 4 | 5 | (async () => { 6 | try { 7 | await deconfig.parseAsync(); 8 | } catch (error) { 9 | console.error(error); 10 | process.exit(1); 11 | } 12 | })(); 13 | -------------------------------------------------------------------------------- /apps/docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict", 3 | "include": ["client/.astro/types.d.ts", "client/**/*", "astro.config.mjs"], 4 | "exclude": ["dist"], 5 | "compilerOptions": { 6 | "jsx": "react-jsx", 7 | "jsxImportSource": "react" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apps/mesh/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MCP Mesh 5 | 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/bindings/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "rootDir": "./src", 6 | "moduleResolution": "node", 7 | "verbatimModuleSyntax": false 8 | }, 9 | "include": ["src/**/*"], 10 | "exclude": ["node_modules", "dist", "test/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /apps/mesh/src/web/routes/orgs/home/monitoring-types.ts: -------------------------------------------------------------------------------- 1 | export interface MonitoringStats { 2 | totalCalls: number; 3 | errorRate: number; 4 | avgDurationMs: number; 5 | errorRatePercent: string; 6 | } 7 | 8 | export function hasMonitoringActivity(stats?: MonitoringStats | null): boolean { 9 | return (stats?.totalCalls ?? 0) > 0; 10 | } 11 | -------------------------------------------------------------------------------- /apps/docs/client/src/i18n/utils.ts: -------------------------------------------------------------------------------- 1 | import { defaultLang, ui } from "./ui"; 2 | 3 | export function useTranslations(lang: keyof typeof ui) { 4 | return function t(key: keyof (typeof ui)[typeof defaultLang]) { 5 | return key in ui[lang] 6 | ? ui[lang][key as keyof (typeof ui)[typeof lang]] 7 | : ui[defaultLang][key]; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui/src/components/aspect-ratio.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"; 4 | 5 | function AspectRatio({ 6 | ...props 7 | }: React.ComponentProps) { 8 | return ; 9 | } 10 | 11 | export { AspectRatio }; 12 | -------------------------------------------------------------------------------- /packages/bindings/src/core/client/index.ts: -------------------------------------------------------------------------------- 1 | export { HTTPClientTransport } from "./http-client-transport"; 2 | export { 3 | createMCPFetchStub, 4 | isStreamableToolBinder, 5 | MCPClient, 6 | type CreateStubAPIOptions, 7 | type MCPClientFetchStub, 8 | type MCPClientStub, 9 | type ServerClient, 10 | } from "./mcp"; 11 | export { bindingClient } from "../binder"; 12 | -------------------------------------------------------------------------------- /packages/cli/src/lib/package-info.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Package information - inlined at build time by tsup 3 | * This avoids runtime file reading which breaks when bundled 4 | */ 5 | import packageJson from "../../package.json"; 6 | 7 | export const packageInfo = { 8 | name: packageJson.name, 9 | version: packageJson.version, 10 | description: packageJson.description, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/ui/src/components/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@deco/ui/lib/utils.ts"; 2 | 3 | function Skeleton({ className, ...props }: React.ComponentProps<"div">) { 4 | return ( 5 |
10 | ); 11 | } 12 | 13 | export { Skeleton }; 14 | -------------------------------------------------------------------------------- /packages/cli/src/commands/deconfig/index.ts: -------------------------------------------------------------------------------- 1 | export { getCommand } from "./get.js"; 2 | export { putCommand } from "./put.js"; 3 | export { watchCommand } from "./watch.js"; 4 | export { cloneCommand } from "./clone.js"; 5 | export { pushCommand } from "./push.js"; 6 | export { pullCommand } from "./pull.js"; 7 | export { listCommand } from "./list.js"; 8 | export { deleteCommand } from "./delete.js"; 9 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/collections/collection-page.tsx: -------------------------------------------------------------------------------- 1 | import type { ReactNode } from "react"; 2 | 3 | interface CollectionPageProps { 4 | children: ReactNode; 5 | } 6 | 7 | export function CollectionPage({ children }: CollectionPageProps) { 8 | return ( 9 |
10 | {children} 11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/store/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Store Components 3 | * 4 | * Components for store discovery and item browsing. 5 | */ 6 | 7 | // Main components 8 | export { StoreDiscovery } from "./store-discovery"; 9 | 10 | // Item components 11 | export type { 12 | MCPRegistryServer, 13 | MCPRegistryServerIcon, 14 | MCPRegistryServerMeta, 15 | } from "./registry-item-card"; 16 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/ui/AccordionGroup.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | interface AccordionGroupProps { 4 | children: React.ReactNode; 5 | } 6 | 7 | export function AccordionGroup({ children }: AccordionGroupProps) { 8 | return ( 9 |
10 | {children} 11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /packages/runtime/src/mcp.ts: -------------------------------------------------------------------------------- 1 | /* oxlint-disable no-explicit-any */ 2 | import type { ToolBinder } from "@decocms/bindings"; 3 | export { 4 | createMCPFetchStub, 5 | MCPClient, 6 | type CreateStubAPIOptions, 7 | type MCPClientFetchStub, 8 | type MCPClientStub, 9 | } from "@decocms/bindings/client"; // Default fetcher instance with API_SERVER_URL and API_HEADERS 10 | 11 | export type { ToolBinder }; 12 | -------------------------------------------------------------------------------- /apps/mesh/src/web/utils/slugify.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Convert a string to a URL-friendly slug 3 | * Removes special characters, converts to lowercase, and replaces spaces with hyphens 4 | */ 5 | export function slugify(input: string): string { 6 | return input 7 | .toLowerCase() 8 | .trim() 9 | .replace(/[^a-z0-9\s_-]+/g, "") 10 | .replace(/[\s_-]+/g, "-") 11 | .replace(/^-+|-+$/g, ""); 12 | } 13 | -------------------------------------------------------------------------------- /packages/vite-plugin-deco/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@decocms/vite-plugin", 3 | "version": "1.0.0-alpha.1", 4 | "type": "module", 5 | "exports": { 6 | ".": "./index.ts" 7 | }, 8 | "scripts": { 9 | "check": "tsc --noEmit" 10 | }, 11 | "dependencies": { 12 | "vite": "^7.2.1", 13 | "@cloudflare/vite-plugin": "^1.13.4" 14 | }, 15 | "publishConfig": { 16 | "access": "public" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /apps/docs/client/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection, z } from "astro:content"; 2 | import { glob } from "astro/loaders"; 3 | 4 | export const collections = { 5 | docs: defineCollection({ 6 | loader: glob({ pattern: "**/*.mdx", base: "./src/content" }), 7 | schema: z.object({ 8 | title: z.string(), 9 | description: z.string(), 10 | icon: z.string().optional(), 11 | }), 12 | }), 13 | }; 14 | -------------------------------------------------------------------------------- /apps/mesh/src/web/hooks/use-deco-chat-open.ts: -------------------------------------------------------------------------------- 1 | import { useLocalStorage } from "@/web/hooks/use-local-storage"; 2 | import { LOCALSTORAGE_KEYS } from "@/web/lib/localstorage-keys"; 3 | 4 | export function useDecoChatOpen() { 5 | const [open, setOpenStorage] = useLocalStorage( 6 | LOCALSTORAGE_KEYS.decoChatOpen(), 7 | (existing) => Boolean(existing ?? false), 8 | ); 9 | 10 | return [open, setOpenStorage] as const; 11 | } 12 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## What is this contribution about? 4 | > Describe your changes and why they're needed. 5 | 6 | ## Screenshots/Demonstration 7 | > Add screenshots or a Loom video if your changes affect the UI. 8 | 9 | ## Review Checklist 10 | - [ ] PR title is clear and descriptive 11 | - [ ] Changes are tested and working 12 | - [ ] Documentation is updated (if needed) 13 | - [ ] No breaking changes -------------------------------------------------------------------------------- /apps/docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Environment files 2 | .env 3 | .env.production 4 | .dev.vars 5 | 6 | # Build files 7 | view-build/ 8 | dist 9 | dist-ssr 10 | dist/ 11 | .nitro 12 | .tanstack 13 | 14 | # Node modules 15 | node_modules 16 | node_modules/ 17 | 18 | # Generated types 19 | .astro/ 20 | 21 | # Logs 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | pnpm-debug.log* 26 | 27 | # macOS-specific files 28 | .DS_Store 29 | 30 | # Other 31 | *.local 32 | count.txt 33 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/apiKeys/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * API Key Tools 3 | * 4 | * MCP tools for managing API keys via Better Auth's API Key plugin. 5 | * Note: API key values are only returned at creation time. 6 | */ 7 | 8 | export { API_KEY_CREATE } from "./create"; 9 | export { API_KEY_DELETE } from "./delete"; 10 | export { API_KEY_LIST } from "./list"; 11 | export { API_KEY_UPDATE } from "./update"; 12 | 13 | // Export schemas for external use 14 | export * from "./schema"; 15 | -------------------------------------------------------------------------------- /apps/mesh/src/web/routes/auth-catchall.tsx: -------------------------------------------------------------------------------- 1 | import { useParams } from "@tanstack/react-router"; 2 | import { AuthView } from "@daveyplate/better-auth-ui"; 3 | 4 | export default function AuthPage() { 5 | const { pathname } = useParams({ from: "/auth/$pathname" }); 6 | 7 | return ( 8 |
9 | 10 |
11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /apps/mesh/src/web/utils/normalize-url.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Normalizes MCP connection URLs by removing the `/i:` prefix from UUIDs 3 | * @param url - The URL to normalize 4 | * @returns The normalized URL string 5 | */ 6 | export function normalizeUrl(url: string): string { 7 | try { 8 | const parsed = new URL(url); 9 | parsed.pathname = parsed.pathname.replace(/\/i:([a-f0-9-]+)/gi, "/$1"); 10 | return parsed.toString(); 11 | } catch { 12 | return url; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/cli/src/lib/runtime.ts: -------------------------------------------------------------------------------- 1 | import process from "node:process"; 2 | 3 | /** 4 | * Detects which runtime is currently executing the CLI 5 | */ 6 | export function detectRuntime(): "node" | "bun" | "deno" | "unknown" { 7 | // oxlint-disable-next-line no-explicit-any 8 | if (typeof (globalThis as any).Deno !== "undefined") return "deno"; 9 | 10 | if (process.versions.bun) return "bun"; 11 | if (process.versions.node) return "node"; 12 | 13 | return "unknown"; 14 | } 15 | -------------------------------------------------------------------------------- /packages/ui/src/hooks/use-copy.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable ban-memoization/ban-memoization */ 2 | import { useCallback, useState } from "react"; 3 | 4 | export function useCopy() { 5 | const [copied, setCopied] = useState(false); 6 | 7 | const handleCopy = useCallback(async (text: string) => { 8 | await navigator.clipboard.writeText(text); 9 | setCopied(true); 10 | setTimeout(() => setCopied(false), 2000); 11 | }, []); 12 | 13 | return { handleCopy, copied }; 14 | } 15 | -------------------------------------------------------------------------------- /apps/mesh/src/api/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * MCP Mesh API Server - Main Entry Point 3 | * 4 | * Re-exports createApp and provides a default app instance for production. 5 | * Tests should import { createApp } from "./app" to avoid side effects. 6 | */ 7 | 8 | export { createApp, type CreateAppOptions } from "./app"; 9 | 10 | // Default app instance for production use 11 | // This runs createApp() immediately on module load 12 | import { createApp } from "./app"; 13 | export default createApp(); 14 | -------------------------------------------------------------------------------- /apps/docs/wrangler.toml: -------------------------------------------------------------------------------- 1 | #:schema node_modules/@deco/workers-runtime/config-schema.json 2 | name = "docs" 3 | main = "server/main.ts" 4 | compatibility_date = "2025-06-17" 5 | compatibility_flags = [ "nodejs_compat" ] 6 | scope = "deco.cx" 7 | 8 | [[routes]] 9 | pattern = "docs.decocms.com" 10 | custom_domain = true 11 | 12 | [assets] 13 | directory = "./dist/client" 14 | binding = "ASSETS" 15 | 16 | [deco] 17 | workspace = "deco.cx" 18 | bindings = [] 19 | enable_workflows = true 20 | local = false -------------------------------------------------------------------------------- /apps/mesh/src/web/components/details/connection/readme-tab.tsx: -------------------------------------------------------------------------------- 1 | import { ReadmeViewer } from "@/web/components/store/readme-viewer"; 2 | 3 | interface ReadmeTabProps { 4 | repository: { 5 | url?: string; 6 | source?: string; 7 | subfolder?: string; 8 | }; 9 | } 10 | 11 | export function ReadmeTab({ repository }: ReadmeTabProps) { 12 | return ( 13 |
14 | 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/runtime/src/asset-server/dev-server-proxy.ts: -------------------------------------------------------------------------------- 1 | import { proxy } from "hono/proxy"; 2 | import { Context } from "hono"; 3 | 4 | export const devServerProxy = (url: string | URL) => (c: Context) => { 5 | const incomingUrl = new URL(c.req.raw.url); 6 | const target = new URL(url); 7 | target.pathname = incomingUrl.pathname; 8 | target.search = incomingUrl.search; 9 | 10 | return proxy(target, { 11 | raw: c.req.raw, 12 | headers: { 13 | ...c.req.raw.headers, 14 | }, 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /apps/docs/client/src/config/site.ts: -------------------------------------------------------------------------------- 1 | export const siteConfig = { 2 | name: "Deco MCP Documentation", 3 | description: "Documentation for Deco MCP server with tools and workflows", 4 | url: "https://your-domain.com", 5 | ogImage: "https://your-domain.com/og.jpg", 6 | links: { 7 | github: "https://github.com/deco-cx/chat", 8 | }, 9 | // GitHub repository URL for edit links 10 | githubRepo: "https://github.com/deco-cx/chat", 11 | // GitHub branch name (usually 'main' or 'master') 12 | githubBranch: "main", 13 | } as const; 14 | -------------------------------------------------------------------------------- /apps/mesh/.gitignore: -------------------------------------------------------------------------------- 1 | # Auth configuration (contains secrets) 2 | auth-config.json 3 | 4 | # Database files 5 | data/ 6 | *.db 7 | *.sqlite 8 | *.db-shm 9 | *.db-wal 10 | 11 | # Dependencies 12 | node_modules/ 13 | 14 | # Build outputs 15 | dist/ 16 | build/ 17 | 18 | # Environment 19 | .env 20 | .env.local 21 | .env.*.local 22 | 23 | # IDE 24 | .vscode/ 25 | .idea/ 26 | 27 | # OS 28 | .DS_Store 29 | Thumbs.db 30 | 31 | # Logs 32 | *.log 33 | logs/ 34 | 35 | # Test coverage 36 | coverage/ 37 | 38 | # Temporary files 39 | /tmp/ 40 | 41 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/details/connection/tools-tab.tsx: -------------------------------------------------------------------------------- 1 | import { ToolsList } from "@/web/components/tools"; 2 | 3 | interface ToolsTabProps { 4 | tools: 5 | | Array<{ 6 | name: string; 7 | description?: string; 8 | inputSchema?: Record; 9 | }> 10 | | undefined; 11 | connectionId: string; 12 | org: string; 13 | } 14 | 15 | export function ToolsTab({ tools, connectionId, org }: ToolsTabProps) { 16 | return ; 17 | } 18 | -------------------------------------------------------------------------------- /apps/mesh/src/web/lib/auth-client.ts: -------------------------------------------------------------------------------- 1 | import { createAuthClient } from "better-auth/react"; 2 | import { 3 | organizationClient, 4 | adminClient, 5 | magicLinkClient, 6 | } from "better-auth/client/plugins"; 7 | import { ssoClient } from "@better-auth/sso/client"; 8 | 9 | export const authClient = createAuthClient({ 10 | plugins: [ 11 | organizationClient({ 12 | dynamicAccessControl: { 13 | enabled: true, 14 | }, 15 | }), 16 | adminClient(), 17 | ssoClient(), 18 | magicLinkClient(), 19 | ], 20 | }); 21 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/ui/StepGroup.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | interface StepGroupProps { 4 | children: React.ReactNode; 5 | className?: string; 6 | } 7 | 8 | export function StepGroup({ children, className = "" }: StepGroupProps) { 9 | return ( 10 |
11 | {/* Connecting line */} 12 |
13 | 14 | {/* Steps container */} 15 |
{children}
16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /apps/mesh/src/auth/roles.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Built-in Role Definitions 3 | * 4 | * Separated to avoid circular dependencies between auth and context-factory modules. 5 | */ 6 | 7 | /** 8 | * Built-in roles that have full access (owner, admin, user) 9 | * These bypass custom permission checks 10 | */ 11 | export const BUILTIN_ROLES = ["owner", "admin", "user"] as const; 12 | 13 | export type BuiltinRole = (typeof BUILTIN_ROLES)[number]; 14 | 15 | /** 16 | * Roles that have admin privileges 17 | */ 18 | export const ADMIN_ROLES: BuiltinRole[] = ["owner", "admin"]; 19 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/eventbus/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Event Bus Tools 3 | * 4 | * MCP tools for publishing events and managing subscriptions. 5 | */ 6 | 7 | export { EVENT_PUBLISH } from "./publish"; 8 | export { EVENT_SUBSCRIBE } from "./subscribe"; 9 | export { EVENT_UNSUBSCRIBE } from "./unsubscribe"; 10 | export { EVENT_CANCEL } from "./cancel"; 11 | export { EVENT_ACK } from "./ack"; 12 | export { EVENT_SUBSCRIPTION_LIST } from "./list"; 13 | export { EVENT_SYNC_SUBSCRIPTIONS } from "./sync-subscriptions"; 14 | 15 | // Re-export schemas 16 | export * from "./schema"; 17 | -------------------------------------------------------------------------------- /packages/runtime/src/state.ts: -------------------------------------------------------------------------------- 1 | import { AsyncLocalStorage } from "node:async_hooks"; 2 | import { DefaultEnv } from "./index.ts"; 3 | import type { AppContext } from "./tools.ts"; 4 | 5 | const asyncLocalStorage = new AsyncLocalStorage(); 6 | 7 | export const State = { 8 | getStore: () => { 9 | return asyncLocalStorage.getStore(); 10 | }, 11 | run: ( 12 | ctx: AppContext, 13 | f: (...args: TArgs) => R, 14 | ...args: TArgs 15 | ): R => asyncLocalStorage.run(ctx, f, ...args), 16 | }; 17 | -------------------------------------------------------------------------------- /packages/ui/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "", 8 | "css": "src/styles/global.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "ui": "@deco/ui/components", 15 | "components": "@deco/ui/components", 16 | "utils": "@deco/ui/lib/utils.ts", 17 | "lib": "@deco/ui/lib", 18 | "hooks": "@deco/ui/hooks" 19 | }, 20 | "iconLibrary": "material-symbols" 21 | } 22 | -------------------------------------------------------------------------------- /packages/cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "rootDir": "./src", 6 | "noEmit": false, 7 | "allowImportingTsExtensions": false, 8 | "declaration": true, 9 | "declarationMap": true, 10 | "sourceMap": true 11 | }, 12 | "include": ["src/**/*"], 13 | "exclude": [ 14 | "node_modules", 15 | "dist", 16 | "../../apps/**/*", 17 | "../../packages/sdk/**/*", 18 | "../../packages/ai/**/*", 19 | "../../packages/runtime/**/*", 20 | "../../packages/ui/**/*" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /apps/docs/client/src/components/markdown/Img.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const props = Astro.props; 3 | const { src, alt, title } = props; 4 | --- 5 | 6 |
7 |
8 | {alt} 15 | { 16 | title && ( 17 |
18 |

{title}

19 |
20 | ) 21 | } 22 |
23 |
24 | -------------------------------------------------------------------------------- /apps/mesh/migrations/011-gateway-icon.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Add icon field to gateways table 3 | * 4 | * Allows gateways to have a custom icon, typically inherited from the connection 5 | * when created via "Expose via Gateway" feature. 6 | */ 7 | 8 | import type { Kysely } from "kysely"; 9 | 10 | export async function up(db: Kysely): Promise { 11 | await db.schema.alterTable("gateways").addColumn("icon", "text").execute(); 12 | } 13 | 14 | export async function down(db: Kysely): Promise { 15 | await db.schema.alterTable("gateways").dropColumn("icon").execute(); 16 | } 17 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/details/connection/settings-tab/schema.ts: -------------------------------------------------------------------------------- 1 | import { ConnectionEntitySchema } from "@/tools/connection/schema"; 2 | import { z } from "zod"; 3 | 4 | export const connectionFormSchema = ConnectionEntitySchema.pick({ 5 | title: true, 6 | description: true, 7 | connection_type: true, 8 | connection_url: true, 9 | connection_token: true, 10 | configuration_scopes: true, 11 | configuration_state: true, 12 | }).partial({ 13 | description: true, 14 | connection_token: true, 15 | }); 16 | 17 | export type ConnectionFormData = z.infer; 18 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/organization/schema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Organization Settings Schema 3 | * 4 | * Shared zod schemas for organization settings tools. 5 | * These schemas match the TypeScript interfaces defined in storage/types.ts 6 | */ 7 | 8 | import { z } from "zod"; 9 | 10 | /** 11 | * Sidebar item schema - matches SidebarItem interface from storage/types.ts 12 | */ 13 | export const SidebarItemSchema = z.object({ 14 | title: z.string(), 15 | url: z.string(), 16 | connectionId: z.string(), 17 | icon: z.string(), 18 | }); 19 | 20 | export type SidebarItem = z.infer; 21 | -------------------------------------------------------------------------------- /packages/create-deco/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-deco", 3 | "version": "1.1.4", 4 | "description": "Create a new deco app", 5 | "main": "index.js", 6 | "bin": { 7 | "create-deco": "./index.js" 8 | }, 9 | "keywords": [ 10 | "create", 11 | "deco", 12 | "app", 13 | "template", 14 | "scaffolding", 15 | "cli" 16 | ], 17 | "author": "Deco team", 18 | "license": "MIT", 19 | "dependencies": { 20 | "deco-cli": "^0.26.0" 21 | }, 22 | "engines": { 23 | "node": ">=22.0.0" 24 | }, 25 | "publishConfig": { 26 | "access": "public" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /apps/mesh/src/auth/oauth-providers.ts: -------------------------------------------------------------------------------- 1 | export const KNOWN_OAUTH_PROVIDERS = { 2 | google: { 3 | name: "Google", 4 | icon: "https://assets.decocache.com/webdraw/eb7480aa-a68b-4ce4-98ff-36aa121762a7/google.svg", 5 | }, 6 | github: { 7 | name: "GitHub", 8 | icon: "https://assets.decocache.com/webdraw/5f999dcb-c8a6-4572-948c-9996ef1d502f/github.svg", 9 | }, 10 | microsoft: { 11 | name: "Microsoft", 12 | icon: "https://assets.decocache.com/mcp/aa6f6e1a-6526-4bca-99cc-82e2ec38b0e4/microsoft.png", 13 | }, 14 | }; 15 | 16 | export type OAuthProvider = keyof typeof KNOWN_OAUTH_PROVIDERS; 17 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/connection/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Connection Management Tools 3 | * 4 | * Export all connection-related tools with collection binding compliance. 5 | */ 6 | 7 | // Collection-compliant CRUD tools 8 | export { COLLECTION_CONNECTIONS_CREATE } from "./create"; 9 | export { COLLECTION_CONNECTIONS_LIST } from "./list"; 10 | export { COLLECTION_CONNECTIONS_GET } from "./get"; 11 | export { COLLECTION_CONNECTIONS_UPDATE } from "./update"; 12 | export { COLLECTION_CONNECTIONS_DELETE } from "./delete"; 13 | 14 | // Connection test tool 15 | export { CONNECTION_TEST } from "./test"; 16 | 17 | // Utility exports 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | ## Describe the problem you want to solve 10 | 11 | > Write a description of the problem you found and how it impacts the software. 12 | 13 | ## Propose your solution 14 | 15 | > Describe the solution for the problem you found. 16 | 17 | ## Improvement prototype (optional) 18 | 19 | > If it is a visual feature , you can show a sketch with the expected design. If 20 | > it is an architecture / logic future, you can show a pseudo-code with the 21 | > desired updates. 22 | -------------------------------------------------------------------------------- /apps/mesh/src/web/layouts/required-auth-layout.tsx: -------------------------------------------------------------------------------- 1 | import { Navigate } from "@tanstack/react-router"; 2 | import { AuthLoading, SignedIn, SignedOut } from "@daveyplate/better-auth-ui"; 3 | import { SplashScreen } from "@/web/components/splash-screen"; 4 | 5 | export default function RequiredAuthLayout({ 6 | children, 7 | }: { 8 | children: React.ReactNode; 9 | }) { 10 | return ( 11 | <> 12 | 13 | 14 | 15 | 16 | {children} 17 | 18 | 19 | 20 | 21 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /packages/ui/src/types/chat-metadata.ts: -------------------------------------------------------------------------------- 1 | export interface ChatModelConfig { 2 | id: string; 3 | connectionId: string; 4 | provider?: string | null; 5 | } 6 | 7 | export interface ChatAgentConfig { 8 | id?: string; 9 | title?: string; 10 | avatar?: string; 11 | description?: string; 12 | instructions?: string; 13 | tool_set?: Record; 14 | } 15 | 16 | export interface ChatUserConfig { 17 | name?: string; 18 | avatar?: string; 19 | } 20 | 21 | export interface Metadata { 22 | model?: ChatModelConfig; 23 | agent?: ChatAgentConfig; 24 | user?: ChatUserConfig; 25 | created_at?: string | Date; 26 | thread_id?: string; 27 | } 28 | -------------------------------------------------------------------------------- /apps/mesh/src/common.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a function that executes the factory only once. 3 | * - Concurrent calls share the same in-flight promise (prevents race conditions) 4 | * - On success: caches the result, subsequent calls return cached promise 5 | * - On failure: clears cache, next call will retry 6 | */ 7 | export function once(factory: () => Promise): () => Promise { 8 | let promise: Promise | null = null; 9 | 10 | return () => { 11 | if (promise) { 12 | return promise; 13 | } 14 | 15 | promise = factory().catch((error) => { 16 | promise = null; 17 | throw error; 18 | }); 19 | 20 | return promise; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Git 2 | .git 3 | .gitignore 4 | .github 5 | 6 | # Dependencies (will be installed fresh) 7 | node_modules 8 | **/node_modules 9 | 10 | # Build outputs (except mesh dist which we need) 11 | packages/*/dist 12 | 13 | # Development files 14 | .vscode 15 | .cursor 16 | .idea 17 | *.log 18 | *.swp 19 | *.swo 20 | *~ 21 | 22 | # Test files 23 | **/*.test.ts 24 | **/*.test.js 25 | **/*.spec.ts 26 | **/*.spec.js 27 | **/test 28 | **/tests 29 | **/__tests__ 30 | coverage 31 | 32 | # Documentation 33 | docs 34 | *.md 35 | !README.md 36 | 37 | # Environment files 38 | .env.local 39 | .env.*.local 40 | .env.development 41 | .env.test 42 | 43 | # Misc 44 | .DS_Store 45 | *.pem 46 | .turbo 47 | .next 48 | .cache -------------------------------------------------------------------------------- /apps/mesh/src/web/providers/providers.tsx: -------------------------------------------------------------------------------- 1 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; 2 | 3 | import { AuthConfigProvider } from "@/web/providers/auth-config-provider"; 4 | import { BetterAuthUIProvider } from "@/web/providers/better-auth-ui-provider"; 5 | import { Toaster } from "sonner"; 6 | 7 | const queryClient = new QueryClient(); 8 | 9 | export function Providers({ children }: { children: React.ReactNode }) { 10 | return ( 11 | 12 | 13 | 14 | {children} 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /.oxlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsPlugins": [ 3 | "./plugins/enforce-kebab-case-file-names.js", 4 | "./plugins/enforce-query-key-constants.js", 5 | "./plugins/ban-use-effect.js", 6 | "./plugins/ban-memoization.js" 7 | ], 8 | "ignorePatterns": ["apps/docs/*"], 9 | "rules": { 10 | "unicorn/no-useless-fallback-in-spread": "off", 11 | "no-unused-expressions": "off", 12 | "no-explicit-any": "warn", 13 | "enforce-kebab-case-file-names/kebab-case": "warn", 14 | "ban-types": "warn", 15 | "enforce-query-key-constants/enforce-query-key-constants": "warn", 16 | "ban-use-effect/ban-use-effect": "error", 17 | "ban-memoization/ban-memoization": "error" 18 | }, 19 | "plugins": ["react"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/ui/src/components/sonner.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useTheme } from "next-themes"; 4 | import { toast, Toaster as Sonner, type ToasterProps } from "sonner"; 5 | 6 | const Toaster = ({ ...props }: ToasterProps) => { 7 | const { theme = "system" } = useTheme(); 8 | 9 | return ( 10 | 22 | ); 23 | }; 24 | 25 | export { toast, Toaster }; 26 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy Docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "docs/**" 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v4 17 | 18 | - name: Set up Bun 19 | uses: oven-sh/setup-bun@v2 20 | 21 | - name: Install Deco CLI 22 | run: bun install -g deco-cli 23 | 24 | - name: Install dependencies 25 | run: bun install 26 | 27 | - name: Deploy 28 | run: bun run deploy 29 | working-directory: apps/docs 30 | env: 31 | DECO_DEPLOY_TOKEN: ${{ secrets.DECO_DEPLOY_TOKEN_DOCS }} 32 | -------------------------------------------------------------------------------- /apps/mesh/src/web/components/store/app-detail/app-detail-header.tsx: -------------------------------------------------------------------------------- 1 | import { Icon } from "@deco/ui/components/icon.tsx"; 2 | 3 | interface AppDetailHeaderProps { 4 | onBack: () => void; 5 | } 6 | 7 | export function AppDetailHeader({ onBack }: AppDetailHeaderProps) { 8 | return ( 9 |
10 |
11 | 18 |
19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/runtime/src/bindings/utils.ts: -------------------------------------------------------------------------------- 1 | import type { ToolBinder } from "../mcp.ts"; 2 | 3 | export const Binding = ( 4 | binderTools: TDefinition, 5 | ) => { 6 | return { 7 | isImplementedBy: (tools: Pick[]) => { 8 | const requiredTools = binderTools 9 | .filter((tool) => !tool.opt) 10 | .map( 11 | (tool) => 12 | typeof tool.name === "string" 13 | ? new RegExp(`^${tool.name}$`) // exact match 14 | : (tool.name as RegExp), // regex match 15 | ); 16 | 17 | return requiredTools.every((regexp) => 18 | tools.some((t) => regexp.test(t.name)), 19 | ); 20 | }, 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/gateway/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Gateway Management Tools 3 | * 4 | * Export all gateway-related tools with collection binding compliance. 5 | */ 6 | 7 | // Collection-compliant CRUD tools 8 | export { COLLECTION_GATEWAY_CREATE } from "./create"; 9 | export { COLLECTION_GATEWAY_LIST } from "./list"; 10 | export { COLLECTION_GATEWAY_GET } from "./get"; 11 | export { COLLECTION_GATEWAY_UPDATE } from "./update"; 12 | export { COLLECTION_GATEWAY_DELETE } from "./delete"; 13 | 14 | // Re-export schema types (only types, not runtime schemas) 15 | export type { 16 | ToolSelectionMode, 17 | GatewayToolSelectionStrategy, 18 | GatewayConnection, 19 | GatewayEntity, 20 | GatewayCreateData, 21 | GatewayUpdateData, 22 | } from "./schema"; 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help improve our software 4 | title: "[Bug]: " 5 | labels: ["Bug 🐛", "needs triage"] 6 | --- 7 | 8 | ## Describe the bug 9 | 10 | > A clear and concise description of what the bug is. 11 | 12 | ## To Reproduce 13 | 14 | Steps to reproduce the behavior: 15 | 16 | 1. Go to '...' 17 | 2. Click on '....' 18 | 3. Scroll down to '....' 19 | 4. See error 20 | 21 | ## Expected behavior 22 | 23 | > A clear and concise description of what you expected to happen. 24 | 25 | ## Screenshots 26 | 27 | > If applicable, add screenshots to help explain your problem. 28 | 29 | ## Environment 30 | 31 | - OS: [e.g. macOS] 32 | - Browser: [e.g. Chrome, Safari] 33 | - Version: [e.g. 22] 34 | -------------------------------------------------------------------------------- /packages/ui/src/components/label.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import type * as React from "react"; 4 | import * as LabelPrimitive from "@radix-ui/react-label"; 5 | 6 | import { cn } from "@deco/ui/lib/utils.ts"; 7 | 8 | function Label({ 9 | className, 10 | ...props 11 | }: React.ComponentProps) { 12 | return ( 13 | 21 | ); 22 | } 23 | 24 | export { Label }; 25 | -------------------------------------------------------------------------------- /packages/ui/src/hooks/use-mobile.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | 3 | const MOBILE_BREAKPOINT = 768; 4 | 5 | const isMobileDevice = () => globalThis.innerWidth < MOBILE_BREAKPOINT; 6 | 7 | export function useIsMobile() { 8 | const [isMobile, setIsMobile] = useState(isMobileDevice); 9 | 10 | // oxlint-disable-next-line ban-use-effect/ban-use-effect 11 | useEffect(() => { 12 | const onChange = () => setIsMobile(isMobileDevice); 13 | const mql = globalThis.matchMedia( 14 | `(max-width: ${MOBILE_BREAKPOINT - 1}px)`, 15 | ); 16 | mql.addEventListener("change", onChange); 17 | setIsMobile(isMobileDevice); 18 | return () => mql.removeEventListener("change", onChange); 19 | }, []); 20 | 21 | return isMobile; 22 | } 23 | -------------------------------------------------------------------------------- /apps/docs/server/main.ts: -------------------------------------------------------------------------------- 1 | import { withRuntime } from "@decocms/runtime"; 2 | import { createAssetServer } from "@decocms/runtime/asset-server"; 3 | 4 | interface Env { 5 | ASSETS?: { 6 | fetch: (req: Request) => Promise; 7 | }; 8 | } 9 | 10 | const runtime = withRuntime({ 11 | fetch: (req, env) => { 12 | const url = new URL(req.url); 13 | if (url.pathname === "/" || url.pathname === "") { 14 | return Response.redirect(new URL("/en/introduction", req.url), 302); 15 | } 16 | 17 | const assets = 18 | env.ASSETS ?? 19 | createAssetServer({ 20 | env: "development", 21 | assetsMiddlewarePath: "*", 22 | }); 23 | 24 | return assets.fetch(req); 25 | }, 26 | }); 27 | 28 | export default runtime; 29 | -------------------------------------------------------------------------------- /biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", 3 | "vcs": { 4 | "enabled": true, 5 | "clientKind": "git", 6 | "useIgnoreFile": true 7 | }, 8 | "files": { 9 | "includes": ["**", "!**/dist"], 10 | "ignoreUnknown": false 11 | }, 12 | "formatter": { 13 | "enabled": true, 14 | "indentStyle": "space", 15 | "indentWidth": 2 16 | }, 17 | "linter": { 18 | "enabled": false, 19 | "rules": { 20 | "recommended": true 21 | } 22 | }, 23 | "javascript": { 24 | "formatter": { 25 | "quoteStyle": "double" 26 | } 27 | }, 28 | "assist": { 29 | "enabled": false, 30 | "actions": { 31 | "source": { 32 | "organizeImports": "on" 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/cli/src/lib/banner.ts: -------------------------------------------------------------------------------- 1 | import chalk from "chalk"; 2 | import { packageInfo as decoCliPackageJson } from "./package-info.js"; 3 | 4 | /** 5 | * Displays a simple DECO ASCII art banner 6 | */ 7 | export function displayBanner(): void { 8 | const deco = chalk.green(` 9 | ██████╗ ███████╗ ██████╗ ██████╗ 10 | ██╔══██╗██╔════╝██╔════╝██╔═══██╗ 11 | ██║ ██║█████╗ ██║ ██║ ██║ 12 | ██║ ██║██╔══╝ ██║ ██║ ██║ 13 | ██████╔╝███████╗╚██████╗╚██████╔╝ 14 | ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ 15 | `); 16 | 17 | const subtitle = chalk.gray("Creating Deco project"); 18 | const version = chalk.dim(`CLI v${decoCliPackageJson.version}`); 19 | 20 | console.log(deco); 21 | console.log(` ${subtitle}`); 22 | console.log(` ${version}`); 23 | console.log(""); 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | 19 | - name: Setup Bun 20 | uses: oven-sh/setup-bun@v2 21 | 22 | - name: Install dependencies 23 | run: bun install 24 | 25 | - name: Run format 26 | run: bun run fmt:check 27 | 28 | - name: Run lint 29 | run: bun run lint 30 | 31 | - name: Run check 32 | run: bun run check:ci 33 | 34 | - name: Run tests 35 | run: bun test 36 | 37 | - name: Run knip 38 | run: bun run knip 39 | -------------------------------------------------------------------------------- /apps/mesh/migrations/006-add-views-to-settings.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Add Sidebar Items to Organization Settings Migration 3 | * 4 | * Adds a sidebar_items JSONB column to organization_settings table. 5 | * Sidebar items is an array of { title: string, url: string, connectionId: string } 6 | */ 7 | 8 | import { Kysely, sql } from "kysely"; 9 | 10 | export async function up(db: Kysely): Promise { 11 | await db.schema 12 | .alterTable("organization_settings") 13 | .addColumn("sidebar_items", sql`text`) // JSONB stored as text in SQLite 14 | .execute(); 15 | } 16 | 17 | export async function down(db: Kysely): Promise { 18 | await db.schema 19 | .alterTable("organization_settings") 20 | .dropColumn("sidebar_items") 21 | .execute(); 22 | } 23 | -------------------------------------------------------------------------------- /apps/mesh/src/web/utils/date-range.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Calculate a date range for the last 24 hours, rounded to the nearest minute 3 | * to ensure stable query keys. The end date is set to 1 hour in the future 4 | * to account for any clock skew. 5 | */ 6 | export function getLast24HoursDateRange(): { 7 | startDate: string; 8 | endDate: string; 9 | } { 10 | const now = new Date(); 11 | const startDate = new Date(); 12 | startDate.setHours(now.getHours() - 24); 13 | // Round to nearest minute to ensure stable query keys 14 | startDate.setSeconds(0, 0); 15 | const endDate = new Date(now); 16 | endDate.setHours(endDate.getHours() + 1); 17 | endDate.setSeconds(0, 0); 18 | return { 19 | startDate: startDate.toISOString(), 20 | endDate: endDate.toISOString(), 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /deploy/conf-examples/auth-config-sso-email.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "emailAndPassword": { 3 | "enabled": true 4 | }, 5 | "socialProviders": { 6 | "google": { 7 | "clientId": "", 8 | "clientSecret": "" 9 | }, 10 | "github": { 11 | "clientId": "", 12 | "clientSecret": "" 13 | } 14 | }, 15 | "saml": { 16 | "enabled": false, 17 | "providers": [] 18 | }, 19 | "emailProviders": [ 20 | { 21 | "id": "resend-primary", 22 | "provider": "resend", 23 | "config": { 24 | "apiKey": "", 25 | "fromEmail": "noreply@example.com" 26 | } 27 | } 28 | ], 29 | "inviteEmailProviderId": "resend-primary", 30 | "magicLinkConfig": { 31 | "enabled": true, 32 | "emailProviderId": "resend-primary" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/connection/json-path.ts: -------------------------------------------------------------------------------- 1 | export const prop = (path: string, object: unknown): unknown => { 2 | if (object === null || object === undefined) { 3 | return undefined; 4 | } 5 | 6 | // Split path into parts, handling both dot notation and bracket notation 7 | // e.g., "MESH[0].items[1].name" -> ["MESH", "0", "items", "1", "name"] 8 | const parts = path 9 | .replace(/\[(\w+)\]/g, ".$1") 10 | .split(".") 11 | .filter(Boolean); 12 | 13 | let current: unknown = object; 14 | 15 | for (const part of parts) { 16 | if ( 17 | current === null || 18 | current === undefined || 19 | typeof current !== "object" 20 | ) { 21 | return undefined; 22 | } 23 | current = (current as Record)[part]; 24 | } 25 | 26 | return current; 27 | }; 28 | -------------------------------------------------------------------------------- /apps/mesh/public/logos/cursor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/organization/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Organization Management Tools 3 | * 4 | * Wraps Better Auth organization plugin APIs as MCP tools 5 | */ 6 | 7 | export { ORGANIZATION_CREATE } from "./create"; 8 | export { ORGANIZATION_LIST } from "./list"; 9 | export { ORGANIZATION_GET } from "./get"; 10 | export { ORGANIZATION_UPDATE } from "./update"; 11 | export { ORGANIZATION_DELETE } from "./delete"; 12 | export { ORGANIZATION_SETTINGS_GET } from "./settings-get"; 13 | export { ORGANIZATION_SETTINGS_UPDATE } from "./settings-update"; 14 | 15 | // Member management 16 | export { ORGANIZATION_MEMBER_ADD } from "./member-add"; 17 | export { ORGANIZATION_MEMBER_REMOVE } from "./member-remove"; 18 | export { ORGANIZATION_MEMBER_LIST } from "./member-list"; 19 | export { ORGANIZATION_MEMBER_UPDATE_ROLE } from "./member-update-role"; 20 | -------------------------------------------------------------------------------- /packages/cli/src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | import process from "node:process"; 2 | const LOCAL_DEBUGGER = process.env.VITE_USE_LOCAL_BACKEND === "true"; 3 | 4 | export const SUPABASE_URL = "https://auth.deco.cx"; 5 | export const SUPABASE_ANON_KEY = 6 | "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im96a3NnZG15cnFjeGN3aG5iZXBnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTY3NzU3MDEsImV4cCI6MjA3MjM1MTcwMX0.X1SIxXbivIa2dEkWGfn6xigoHCms9Kri9SLu8N-VWck"; 7 | 8 | const DECO_CMS_WEB_URL = LOCAL_DEBUGGER 9 | ? "http://localhost:3000" 10 | : "https://admin.decocms.com"; 11 | 12 | export const DECO_CMS_API_PROD = "https://api.decocms.com"; 13 | export const DECO_CMS_API_LOCAL = "http://localhost:3001"; 14 | 15 | export const AUTH_PORT_CLI = 3457; 16 | 17 | export const DECO_CMS_LOGIN_URL = new URL("/login?cli", DECO_CMS_WEB_URL).href; 18 | -------------------------------------------------------------------------------- /packages/bindings/src/core/connection.ts: -------------------------------------------------------------------------------- 1 | export type SSEConnection = { 2 | type: "SSE"; 3 | url: string; 4 | token?: string; 5 | headers?: Record; 6 | }; 7 | 8 | export type WebsocketConnection = { 9 | type: "Websocket"; 10 | url: string; 11 | token?: string; 12 | }; 13 | 14 | export type DecoConnection = { 15 | type: "Deco"; 16 | tenant: string; 17 | token?: string; 18 | }; 19 | 20 | export type InnateConnection = { 21 | type: "INNATE"; 22 | name: string; 23 | workspace?: string; 24 | }; 25 | 26 | export type HTTPConnection = { 27 | type: "HTTP"; 28 | url: string; 29 | headers?: Record; 30 | token?: string; 31 | }; 32 | 33 | export type MCPConnection = 34 | | SSEConnection 35 | | WebsocketConnection 36 | | InnateConnection 37 | | DecoConnection 38 | | HTTPConnection; 39 | -------------------------------------------------------------------------------- /apps/mesh/src/api/routes/management.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Management Tools MCP Server 3 | * 4 | * Exposes MCP Mesh management tools via MCP protocol at /mcp endpoint 5 | * Tools: PROJECT_CREATE, PROJECT_LIST, CONNECTION_CREATE, etc. 6 | */ 7 | import { Hono } from "hono"; 8 | import type { MeshContext } from "../../core/mesh-context"; 9 | import { managementMCP } from "../../tools"; 10 | 11 | // Define Hono variables type 12 | type Variables = { 13 | meshContext: MeshContext; 14 | }; 15 | 16 | const app = new Hono<{ Variables: Variables }>(); 17 | 18 | /** 19 | * MCP Server endpoint for management tools 20 | * 21 | * Route: POST /mcp 22 | * Exposes all PROJECT_* and CONNECTION_* tools via MCP protocol 23 | */ 24 | app.all("/", async (c) => { 25 | return managementMCP(c.get("meshContext")).fetch(c.req.raw); 26 | }); 27 | 28 | export default app; 29 | -------------------------------------------------------------------------------- /packages/vite-plugin-deco/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | // Environment setup & latest features 4 | "lib": ["ESNext"], 5 | "target": "ESNext", 6 | "module": "Preserve", 7 | "moduleDetection": "force", 8 | "jsx": "react-jsx", 9 | "allowJs": true, 10 | 11 | // Bundler mode 12 | "moduleResolution": "bundler", 13 | "allowImportingTsExtensions": true, 14 | "verbatimModuleSyntax": true, 15 | "noEmit": true, 16 | 17 | // Best practices 18 | "strict": true, 19 | "skipLibCheck": true, 20 | "noFallthroughCasesInSwitch": true, 21 | "noUncheckedIndexedAccess": true, 22 | "noImplicitOverride": true, 23 | 24 | // Some stricter flags (disabled by default) 25 | "noUnusedLocals": false, 26 | "noUnusedParameters": false, 27 | "noPropertyAccessFromIndexSignature": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /apps/mesh/src/tools/connection/test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * CONNECTION_TEST Tool 3 | * 4 | * Test connection health 5 | */ 6 | 7 | import { z } from "zod"; 8 | import { defineTool } from "../../core/define-tool"; 9 | 10 | export const CONNECTION_TEST = defineTool({ 11 | name: "CONNECTION_TEST", 12 | description: "Test connection health and latency", 13 | 14 | inputSchema: z.object({ 15 | id: z.string(), 16 | }), 17 | 18 | outputSchema: z.object({ 19 | id: z.string(), 20 | healthy: z.boolean(), 21 | latencyMs: z.number(), 22 | }), 23 | 24 | handler: async (input, ctx) => { 25 | // Check authorization 26 | await ctx.access.check(); 27 | 28 | // Test connection 29 | const result = await ctx.storage.connections.testConnection(input.id); 30 | 31 | return { 32 | id: input.id, 33 | ...result, 34 | }; 35 | }, 36 | }); 37 | -------------------------------------------------------------------------------- /knip.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/knip@5/schema.json", 3 | "ignoreBinaries": ["deco"], 4 | "workspaces": { 5 | ".": { 6 | "entry": ["plugins/**/*"], 7 | "project": [], 8 | "ignoreDependencies": ["deco-cli"] 9 | }, 10 | "packages/runtime": { 11 | "entry": ["scripts/generate-json-schema.ts"] 12 | }, 13 | "packages/ui": { 14 | "ignore": ["src/styles/global.css"] 15 | }, 16 | "apps/mesh": { 17 | "entry": [ 18 | "src/index.ts", 19 | "src/web/index.tsx!", 20 | "migrations/**/*.ts", 21 | "scripts/**/*.ts" 22 | ], 23 | "ignore": ["src/api/index.ts"] 24 | } 25 | }, 26 | "ignoreDependencies": ["@types/*"], 27 | // TODO(@camudo): Remove this config once I fix all unused type exports 28 | "ignoreIssues": { 29 | "**/*": ["types"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | package-lock.json 11 | deno.lock 12 | bun.lock 13 | 14 | node_modules 15 | dist 16 | dist-ssr 17 | *.local 18 | 19 | **/.vite 20 | 21 | # Environment files 22 | .env 23 | **/.env 24 | 25 | # Editor directories and files 26 | !.vscode/extensions.json 27 | .idea 28 | .DS_Store 29 | *.suo 30 | *.ntvs* 31 | *.njsproj 32 | *.sln 33 | *.sw? 34 | 35 | .deco_host 36 | .wrangler 37 | dist 38 | .dev.vars 39 | 40 | kv 41 | kv-shm 42 | kv-wal 43 | .specstory/** 44 | .tsbuildinfo 45 | 46 | # SQLite database files 47 | *.db 48 | *.db-shm 49 | *.db-wal 50 | 51 | .playwright-mcp/ 52 | 53 | # SQLite database files 54 | *.db 55 | *.db-shm 56 | *.db-wal 57 | 58 | # Local test files 59 | deploy/auth-config.json 60 | deploy/docs 61 | deploy/test* 62 | -------------------------------------------------------------------------------- /packages/ui/src/components/separator.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import type * as React from "react"; 4 | import * as SeparatorPrimitive from "@radix-ui/react-separator"; 5 | 6 | import { cn } from "@deco/ui/lib/utils.ts"; 7 | 8 | function Separator({ 9 | className, 10 | orientation = "horizontal", 11 | decorative = true, 12 | ...props 13 | }: React.ComponentProps) { 14 | return ( 15 | 25 | ); 26 | } 27 | 28 | export { Separator }; 29 | -------------------------------------------------------------------------------- /apps/mesh/src/auth/index.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from "bun:test"; 2 | import { auth } from "./index"; 3 | 4 | describe("Better Auth Setup", () => { 5 | it("should export auth instance", () => { 6 | expect(auth).toBeDefined(); 7 | expect(auth.api).toBeDefined(); 8 | }); 9 | 10 | it("should have MCP plugin methods", () => { 11 | expect(auth.api.getMcpSession).toBeDefined(); 12 | }); 13 | 14 | it("should have API Key plugin methods", () => { 15 | expect(auth.api.createApiKey).toBeDefined(); 16 | expect(auth.api.verifyApiKey).toBeDefined(); 17 | expect(auth.api.listApiKeys).toBeDefined(); 18 | expect(auth.api.deleteApiKey).toBeDefined(); 19 | }); 20 | 21 | it("should have Admin plugin methods", () => { 22 | expect(auth.api.setRole).toBeDefined(); 23 | expect(auth.api.userHasPermission).toBeDefined(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /apps/mesh/src/web/lib/localstorage-keys.ts: -------------------------------------------------------------------------------- 1 | import type { ProjectLocator } from "./locator"; 2 | 3 | /** 4 | * Known localStorage keys for the mesh app. 5 | * When adding a new use of useLocalStorage, add the key to this object. 6 | * This is used to avoid inline key definitions and to ensure consistency. 7 | */ 8 | export const LOCALSTORAGE_KEYS = { 9 | decoChatOpen: () => `mesh:decochat:open`, 10 | threadManagerState: (locator: ProjectLocator) => 11 | `mesh:thread-manager-state:${locator}`, 12 | chatSelectedModel: (locator: ProjectLocator) => 13 | `mesh:chat:selectedModel:${locator}`, 14 | decoChatPanelWidth: () => `mesh:decochat:panel-width`, 15 | sidebarOpen: () => `mesh:sidebar-open`, 16 | selectedRegistry: (org: string) => `mesh:store:selected-registry:${org}`, 17 | orgHomeQuickstart: (org: string) => `mesh:org-home:quickstart:${org}`, 18 | } as const; 19 | -------------------------------------------------------------------------------- /packages/ui/src/components/textarea.tsx: -------------------------------------------------------------------------------- 1 | import type * as React from "react"; 2 | 3 | import { cn } from "@deco/ui/lib/utils.ts"; 4 | 5 | function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { 6 | return ( 7 |