diff --git a/templates/assistant-ui/.cursor/rules/echo_rules.mdc b/templates/assistant-ui/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/assistant-ui/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/authjs/.cursor/rules/echo_rules.mdc b/templates/authjs/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/authjs/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/echo-cli/.cursor/rules/echo_rules.mdc b/templates/echo-cli/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..e9bea2921 --- /dev/null +++ b/templates/echo-cli/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo CLI template rules for command architecture, auth flows, and secure wallet handling +globs: **/*.{ts,js,mjs,cjs} +--- + +# Echo CLI template rules + +- Define CLI commands in `src/index.ts` using Commander and keep command handlers thin. +- Put business logic in existing modules (`src/core`, `src/auth`, `src/utils`, `src/config`) instead of inlining logic in command definitions. +- Read `ECHO_APP_ID` from environment-backed constants and keep configuration centralized in `src/constants.ts`. +- Never log or persist sensitive values (private keys, tokens, session secrets) outside secure keychain/storage paths already used by this template. +- Reuse existing print, validation, and error utilities for consistent CLI output and failure handling. +- Preserve current async command patterns (`process.exit` semantics, prompt cancellation handling, and auth gating behavior). diff --git a/templates/next-chat/.cursor/rules/echo_rules.mdc b/templates/next-chat/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/next-chat/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/next-image/.cursor/rules/echo_rules.mdc b/templates/next-image/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/next-image/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/next-video-template/.cursor/rules/echo_rules.mdc b/templates/next-video-template/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/next-video-template/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/next/.cursor/rules/echo_rules.mdc b/templates/next/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/next/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc b/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..786efa3fe --- /dev/null +++ b/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc @@ -0,0 +1,13 @@ +--- +description: Echo Next.js template rules for server routes, client providers, and safe env usage +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo Next.js template rules + +- Keep Echo server wiring centralized in `src/echo/index.ts` (or `echo.ts` in this template) and only expose handlers through the App Router echo route. +- Keep the echo route as a thin passthrough (`export const { GET, POST } = handlers`) in `app/api/echo/[...echo]/route.ts` (or `[...path]/route.ts`). +- Use `ECHO_APP_ID` for server-side Echo setup and `NEXT_PUBLIC_ECHO_APP_ID` for client-side provider config. +- In client components, import from `@merit-systems/echo-next-sdk/client`; in server code, import from `@merit-systems/echo-next-sdk`. +- Do not expose provider API keys or secrets in client code. Route model calls through server route handlers. +- Preserve existing App Router conventions, path aliases, and component structure used by this template. diff --git a/templates/react-chat/.cursor/rules/echo_rules.mdc b/templates/react-chat/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d2ef987d6 --- /dev/null +++ b/templates/react-chat/.cursor/rules/echo_rules.mdc @@ -0,0 +1,12 @@ +--- +description: Echo React (Vite) template rules for provider setup, hooks, and client-safe patterns +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo React template rules + +- Keep Echo provider setup at the app root (`src/main.tsx` or `src/App.tsx`) and pass `import.meta.env.VITE_ECHO_APP_ID`. +- Use hooks and helpers from `@merit-systems/echo-react-sdk` (`useEcho`, `useChat`, `EchoTokens`, `EchoProvider`) instead of custom wrappers unless needed. +- Keep all credentials and provider secrets out of client code; only public Echo app ID values belong in Vite env vars. +- Follow existing Vite + React patterns in this template (module paths, component layout, styling approach, and TypeScript strictness). +- For chat and generation flows, keep streaming and message-state logic in the existing component boundaries. diff --git a/templates/react-image/.cursor/rules/echo_rules.mdc b/templates/react-image/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d2ef987d6 --- /dev/null +++ b/templates/react-image/.cursor/rules/echo_rules.mdc @@ -0,0 +1,12 @@ +--- +description: Echo React (Vite) template rules for provider setup, hooks, and client-safe patterns +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo React template rules + +- Keep Echo provider setup at the app root (`src/main.tsx` or `src/App.tsx`) and pass `import.meta.env.VITE_ECHO_APP_ID`. +- Use hooks and helpers from `@merit-systems/echo-react-sdk` (`useEcho`, `useChat`, `EchoTokens`, `EchoProvider`) instead of custom wrappers unless needed. +- Keep all credentials and provider secrets out of client code; only public Echo app ID values belong in Vite env vars. +- Follow existing Vite + React patterns in this template (module paths, component layout, styling approach, and TypeScript strictness). +- For chat and generation flows, keep streaming and message-state logic in the existing component boundaries. diff --git a/templates/react/.cursor/rules/echo_rules.mdc b/templates/react/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d2ef987d6 --- /dev/null +++ b/templates/react/.cursor/rules/echo_rules.mdc @@ -0,0 +1,12 @@ +--- +description: Echo React (Vite) template rules for provider setup, hooks, and client-safe patterns +globs: **/*.{ts,tsx,js,jsx,mjs,cjs} +--- + +# Echo React template rules + +- Keep Echo provider setup at the app root (`src/main.tsx` or `src/App.tsx`) and pass `import.meta.env.VITE_ECHO_APP_ID`. +- Use hooks and helpers from `@merit-systems/echo-react-sdk` (`useEcho`, `useChat`, `EchoTokens`, `EchoProvider`) instead of custom wrappers unless needed. +- Keep all credentials and provider secrets out of client code; only public Echo app ID values belong in Vite env vars. +- Follow existing Vite + React patterns in this template (module paths, component layout, styling approach, and TypeScript strictness). +- For chat and generation flows, keep streaming and message-state logic in the existing component boundaries.