alchemy 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/README.md +3 -3
  2. package/lib/ai/astro-file.d.ts +137 -0
  3. package/lib/ai/astro-file.js +173 -0
  4. package/lib/ai/client.d.ts +2 -10
  5. package/lib/ai/client.js +8 -24
  6. package/lib/ai/css-file.d.ts +131 -0
  7. package/lib/ai/css-file.js +158 -0
  8. package/lib/ai/data.d.ts +45 -5
  9. package/lib/ai/data.js +45 -10
  10. package/lib/ai/document.d.ts +44 -20
  11. package/lib/ai/document.js +95 -28
  12. package/lib/ai/html-file.d.ts +128 -0
  13. package/lib/ai/html-file.js +155 -0
  14. package/lib/ai/index.d.ts +7 -0
  15. package/lib/ai/index.js +7 -0
  16. package/lib/ai/json-file.d.ts +160 -0
  17. package/lib/ai/json-file.js +208 -0
  18. package/lib/ai/typescript-file.d.ts +140 -0
  19. package/lib/ai/typescript-file.js +176 -0
  20. package/lib/ai/vue-file.d.ts +126 -0
  21. package/lib/ai/vue-file.js +153 -0
  22. package/lib/ai/yaml-file.d.ts +169 -0
  23. package/lib/ai/yaml-file.js +236 -0
  24. package/lib/cloudflare/dns.d.ts +88 -0
  25. package/lib/cloudflare/dns.js +192 -0
  26. package/lib/cloudflare/index.d.ts +2 -1
  27. package/lib/cloudflare/index.js +2 -1
  28. package/lib/cloudflare/r2-rest-state-store.d.ts +125 -0
  29. package/lib/cloudflare/r2-rest-state-store.js +254 -0
  30. package/lib/cloudflare/response.d.ts +12 -0
  31. package/lib/cloudflare/response.js +0 -0
  32. package/lib/cloudflare/zone.d.ts +18 -0
  33. package/lib/cloudflare/zone.js +17 -4
  34. package/lib/dns/godaddy.d.ts +7 -0
  35. package/lib/dns/godaddy.js +21 -0
  36. package/lib/dns/import-dns.d.ts +82 -0
  37. package/lib/dns/import-dns.js +114 -0
  38. package/lib/dns/index.d.ts +2 -0
  39. package/lib/dns/index.js +2 -0
  40. package/lib/dns/record.d.ts +88 -0
  41. package/lib/dns/record.js +13 -0
  42. package/lib/fs/file-system-state-store.d.ts +17 -0
  43. package/lib/fs/file-system-state-store.js +87 -0
  44. package/lib/fs/folder.d.ts +10 -0
  45. package/lib/fs/folder.js +2 -2
  46. package/lib/fs/index.d.ts +4 -4
  47. package/lib/fs/index.js +4 -4
  48. package/lib/fs/{json-file.d.ts → static-json-file.d.ts} +2 -2
  49. package/lib/fs/static-json-file.js +14 -0
  50. package/lib/fs/{text-file.d.ts → static-text-file.d.ts} +2 -2
  51. package/lib/fs/{text-file.js → static-text-file.js} +1 -1
  52. package/lib/fs/{typescript-file.d.ts → static-typescript-file.d.ts} +2 -2
  53. package/lib/fs/{typescript-file.js → static-typescript-file.js} +1 -1
  54. package/lib/fs/{yaml-file.d.ts → static-yaml-file.d.ts} +2 -2
  55. package/lib/fs/{yaml-file.js → static-yaml-file.js} +1 -1
  56. package/lib/internal/getting-started.d.ts +10 -0
  57. package/lib/internal/getting-started.js +94 -0
  58. package/lib/internal/project.d.ts +13 -0
  59. package/lib/internal/project.js +101 -0
  60. package/lib/internal/providers.d.ts +23 -0
  61. package/lib/internal/providers.js +148 -0
  62. package/lib/resource.js +8 -1
  63. package/lib/scope.d.ts +1 -1
  64. package/lib/scope.js +4 -2
  65. package/lib/state.d.ts +1 -16
  66. package/lib/state.js +0 -87
  67. package/lib/test/bun.d.ts +11 -0
  68. package/lib/test/bun.js +36 -8
  69. package/lib/web/astro.d.ts +147 -0
  70. package/lib/web/astro.js +414 -0
  71. package/lib/{shadcn/component.js → web/shadcn-component.js} +2 -9
  72. package/lib/web/shadcn.d.ts +97 -0
  73. package/lib/web/shadcn.js +99 -0
  74. package/lib/web/tailwind.d.ts +64 -0
  75. package/lib/web/tailwind.js +97 -0
  76. package/lib/{vite → web}/vite.d.ts +5 -0
  77. package/lib/{vite → web}/vite.js +44 -44
  78. package/lib/web/vitepress/custom-theme.d.ts +173 -0
  79. package/lib/web/vitepress/custom-theme.js +336 -0
  80. package/lib/{vitepress → web/vitepress}/dependencies.d.ts +2 -2
  81. package/lib/{vitepress → web/vitepress}/dependencies.js +1 -1
  82. package/lib/web/vitepress/home-page.d.ts +244 -0
  83. package/lib/web/vitepress/home-page.js +134 -0
  84. package/lib/{vitepress → web/vitepress}/index.d.ts +1 -0
  85. package/lib/{vitepress → web/vitepress}/index.js +1 -0
  86. package/lib/{vitepress → web/vitepress}/vitepress.d.ts +10 -8
  87. package/lib/{vitepress → web/vitepress}/vitepress.js +11 -12
  88. package/package.json +6 -2
  89. package/src/ai/astro-file.ts +288 -0
  90. package/src/ai/client.ts +8 -28
  91. package/src/ai/css-file.ts +266 -0
  92. package/src/ai/data.ts +53 -16
  93. package/src/ai/document.ts +130 -33
  94. package/src/ai/html-file.ts +263 -0
  95. package/src/ai/index.ts +7 -0
  96. package/src/ai/json-file.ts +349 -0
  97. package/src/ai/typescript-file.ts +293 -0
  98. package/src/ai/vue-file.ts +261 -0
  99. package/src/ai/yaml-file.ts +368 -0
  100. package/src/apply.ts +0 -1
  101. package/src/cloudflare/dns.ts +344 -0
  102. package/src/cloudflare/index.ts +2 -1
  103. package/src/cloudflare/r2-rest-state-store.ts +353 -0
  104. package/src/cloudflare/response.ts +9 -0
  105. package/src/cloudflare/zone.ts +39 -23
  106. package/src/dns/godaddy.ts +29 -0
  107. package/src/dns/import-dns.ts +213 -0
  108. package/src/dns/index.ts +2 -0
  109. package/src/dns/record.ts +121 -0
  110. package/src/fs/file-system-state-store.ts +109 -0
  111. package/src/fs/folder.ts +14 -2
  112. package/src/fs/index.ts +4 -4
  113. package/src/fs/{json-file.ts → static-json-file.ts} +13 -3
  114. package/src/fs/{text-file.ts → static-text-file.ts} +5 -2
  115. package/src/fs/{typescript-file.ts → static-typescript-file.ts} +3 -3
  116. package/src/fs/{yaml-file.ts → static-yaml-file.ts} +5 -2
  117. package/src/internal/getting-started.ts +107 -0
  118. package/src/internal/project.ts +119 -0
  119. package/src/internal/providers.ts +209 -0
  120. package/src/resource.ts +10 -1
  121. package/src/scope.ts +5 -6
  122. package/src/state.ts +1 -111
  123. package/src/test/bun.ts +60 -10
  124. package/src/web/astro.ts +644 -0
  125. package/src/{shadcn/component.ts → web/shadcn-component.ts} +5 -13
  126. package/src/web/shadcn.ts +219 -0
  127. package/src/web/tailwind.ts +167 -0
  128. package/src/{vite → web}/vite.ts +54 -56
  129. package/src/web/vitepress/custom-theme.ts +514 -0
  130. package/src/{vitepress → web/vitepress}/dependencies.ts +2 -2
  131. package/src/web/vitepress/home-page.ts +363 -0
  132. package/src/{vitepress → web/vitepress}/index.ts +1 -0
  133. package/src/{vitepress → web/vitepress}/vitepress.ts +34 -27
  134. package/lib/cloudflare/state.d.ts +0 -82
  135. package/lib/cloudflare/state.js +0 -108
  136. package/lib/fs/json-file.js +0 -7
  137. package/lib/internal/docs.d.ts +0 -5
  138. package/lib/internal/docs.js +0 -287
  139. package/lib/shadcn/index.d.ts +0 -1
  140. package/lib/shadcn/index.js +0 -1
  141. package/lib/vite/index.d.ts +0 -1
  142. package/lib/vite/index.js +0 -1
  143. package/lib/vitepress/home-page.d.ts +0 -133
  144. package/lib/vitepress/home-page.js +0 -11
  145. package/src/cloudflare/state.ts +0 -138
  146. package/src/internal/docs.ts +0 -338
  147. package/src/shadcn/index.ts +0 -1
  148. package/src/vite/index.ts +0 -1
  149. package/src/vitepress/home-page.ts +0 -166
  150. /package/lib/{shadcn/component.d.ts → web/shadcn-component.d.ts} +0 -0
  151. /package/src/{vitepress → web/vitepress}/index.md +0 -0
@@ -0,0 +1,97 @@
1
+ import { exec } from "child_process";
2
+ import path from "path";
3
+ import { promisify } from "util";
4
+ import { Folder, StaticTextFile } from "../fs";
5
+ import { Resource } from "../resource";
6
+ const execAsync = promisify(exec);
7
+ /**
8
+ * Installs and configures Tailwind CSS for a project
9
+ *
10
+ * @example
11
+ * // Install Tailwind for a Vite project
12
+ * const tailwind = await TailwindConfig("vite-tailwind", {
13
+ * cwd: "my-vite-app",
14
+ * framework: "vite"
15
+ * });
16
+ *
17
+ * @example
18
+ * // Install Tailwind for an Astro project
19
+ * const tailwind = await TailwindConfig("astro-tailwind", {
20
+ * cwd: "my-astro-app",
21
+ * framework: "astro"
22
+ * });
23
+ *
24
+ * @example
25
+ * // Install Tailwind as standalone with a custom CSS path
26
+ * const tailwind = await TailwindConfig("custom-tailwind", {
27
+ * cwd: "my-project",
28
+ * cssPath: "src/css/main.css",
29
+ * additionalPackages: ["@tailwindcss/typography", "@tailwindcss/forms"]
30
+ * });
31
+ */
32
+ export const TailwindConfig = Resource("config::TailwindConfig", async function (id, props) {
33
+ if (this.phase === "delete") {
34
+ // Nothing to clean up specifically for Tailwind
35
+ return this.destroy();
36
+ }
37
+ const framework = props.framework || "standalone";
38
+ // Setup execAsync with the correct cwd
39
+ const exec = (command) => execAsync(command, { cwd: props.cwd });
40
+ // Install Tailwind and framework-specific dependencies
41
+ await installTailwindDependencies(framework);
42
+ // Create CSS file with Tailwind directives
43
+ await createTailwindCssFile();
44
+ return this({
45
+ ...props,
46
+ framework: framework,
47
+ });
48
+ /**
49
+ * Install Tailwind and framework-specific dependencies
50
+ */
51
+ async function installTailwindDependencies(framework) {
52
+ const basePackages = ["tailwindcss", "postcss", "autoprefixer"];
53
+ // Add framework-specific packages
54
+ const frameworkPackages = getFrameworkPackages(framework);
55
+ // Add custom additional packages
56
+ const additionalPackages = props.additionalPackages || [];
57
+ // Combine all packages
58
+ const allPackages = [
59
+ ...basePackages,
60
+ ...frameworkPackages,
61
+ ...additionalPackages,
62
+ ];
63
+ // Install all packages
64
+ await exec(`bun add -D ${allPackages.join(" ")}`);
65
+ }
66
+ /**
67
+ * Get framework-specific packages for Tailwind
68
+ */
69
+ function getFrameworkPackages(framework) {
70
+ switch (framework) {
71
+ case "vite":
72
+ return ["@tailwindcss/vite"];
73
+ case "astro":
74
+ return ["@astrojs/tailwind"];
75
+ case "next":
76
+ return [];
77
+ case "standalone":
78
+ default:
79
+ return [];
80
+ }
81
+ }
82
+ /**
83
+ * Create or update CSS file with Tailwind directives
84
+ */
85
+ async function createTailwindCssFile() {
86
+ const tailwindDirectives = `@import 'tailwindcss';`;
87
+ // Determine CSS file path
88
+ const cssPath = props.cssPath || path.join(props.cwd, "src", "styles", "global.css");
89
+ // Create directory structure if needed
90
+ const cssDir = path.dirname(cssPath);
91
+ await Folder(path.join(id, "css-dir"), {
92
+ path: cssDir,
93
+ });
94
+ // Create CSS file with Tailwind directives
95
+ await StaticTextFile(cssPath, tailwindDirectives);
96
+ }
97
+ });
@@ -79,6 +79,11 @@ export interface ViteProjectProps {
79
79
  * @default false
80
80
  */
81
81
  overwrite?: boolean;
82
+ /**
83
+ * Whether to delete the project folder during the delete phase
84
+ * @default true
85
+ */
86
+ delete?: boolean;
82
87
  }
83
88
  export interface ViteProject extends ViteProjectProps, Resource {
84
89
  /**
@@ -1,10 +1,11 @@
1
1
  import { exec } from "child_process";
2
- import fs from "fs/promises";
3
2
  import path from "path";
4
3
  import { promisify } from "util";
4
+ import { Folder, StaticJsonFile, StaticTypeScriptFile } from "../fs";
5
5
  import { Resource } from "../resource";
6
- import { ShadcnComponent } from "../shadcn/component";
7
6
  import { rm } from "../util/rm";
7
+ import { ShadcnComponent } from "./shadcn-component";
8
+ import { TailwindConfig } from "./tailwind";
8
9
  const execAsync = promisify(exec);
9
10
  export const ViteProject = Resource("project::ViteProject", {
10
11
  alwaysUpdate: true,
@@ -12,9 +13,8 @@ export const ViteProject = Resource("project::ViteProject", {
12
13
  const phase = this.phase;
13
14
  if (this.phase === "delete") {
14
15
  try {
15
- if (await fs.exists(props.name)) {
16
- // TODO: OS agnostic - fs.rm is slow to delete node_modules/
17
- await execAsync("rm -rf " + props.name);
16
+ if (props.delete !== false) {
17
+ await execAsync(`rm -rf ${props.name}`);
18
18
  }
19
19
  }
20
20
  catch (error) {
@@ -45,6 +45,11 @@ export const ViteProject = Resource("project::ViteProject", {
45
45
  "react()",
46
46
  ].filter((s) => typeof s === "string");
47
47
  const cwd = path.resolve(process.cwd(), props.name);
48
+ // Create folder for project
49
+ await Folder("project-dir", {
50
+ path: props.name,
51
+ delete: props.delete,
52
+ });
48
53
  const exec = (command) => execAsync(command, { cwd });
49
54
  if (phase === "create" || props.overwrite) {
50
55
  await removeUnnecessaryFiles();
@@ -65,8 +70,11 @@ export const ViteProject = Resource("project::ViteProject", {
65
70
  await execAsync(`bun vite build`, { cwd: props.name });
66
71
  }
67
72
  async function installTailwind() {
68
- await exec(`bun add tailwindcss @tailwindcss/vite`);
69
- await fs.writeFile(path.join(props.name, "vite.config.ts"), `import path from "path";
73
+ await TailwindConfig(`${id}-tailwind`, {
74
+ cwd: props.name,
75
+ framework: "vite",
76
+ });
77
+ await StaticTypeScriptFile(path.join(props.name, "vite.config.ts"), `import path from "path";
70
78
  import react from "@vitejs/plugin-react";
71
79
  import { defineConfig } from "vite";
72
80
  ${tailwind ? "import tailwindcss from '@tailwindcss/vite';" : ""}
@@ -81,12 +89,6 @@ export default defineConfig({
81
89
  },
82
90
  },
83
91
  });`);
84
- // Add Tailwind CSS import to index.css
85
- const indexCssPath = path.join(props.name, "src", "index.css");
86
- const currentCss = await fs.readFile(indexCssPath, "utf-8");
87
- if (!currentCss.includes('@import "tailwindcss";')) {
88
- await fs.writeFile(indexCssPath, '@import "tailwindcss";\n\n' + currentCss);
89
- }
90
92
  }
91
93
  async function installShadcn() {
92
94
  await exec("bun add -D @types/node");
@@ -120,8 +122,12 @@ export default defineConfig({
120
122
  await exec(`bun add -D @tanstack/router-plugin @tanstack/react-router-devtools`);
121
123
  const src = path.join(props.name, "src");
122
124
  const routes = path.join(src, "routes");
123
- await fs.mkdir(routes, { recursive: true });
124
- await fs.writeFile(path.join(routes, "__root.tsx"), `import { Link, Outlet, createRootRoute } from "@tanstack/react-router";
125
+ // Create routes directory
126
+ await Folder("routes-dir", {
127
+ path: routes,
128
+ });
129
+ // Create root route file
130
+ await StaticTypeScriptFile(path.join(routes, "__root.tsx"), `import { Link, Outlet, createRootRoute } from "@tanstack/react-router";
125
131
  import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
126
132
 
127
133
  export const Route = createRootRoute({
@@ -142,7 +148,8 @@ export const Route = createRootRoute({
142
148
  ),
143
149
  });
144
150
  `);
145
- await fs.writeFile(path.join(routes, "index.tsx"), `import { createLazyFileRoute } from '@tanstack/react-router'
151
+ // Create index route file
152
+ await StaticTypeScriptFile(path.join(routes, "index.tsx"), `import { createLazyFileRoute } from '@tanstack/react-router'
146
153
 
147
154
  export const Route = createLazyFileRoute('/')({
148
155
  component: Index,
@@ -155,7 +162,8 @@ function Index() {
155
162
  </div>
156
163
  )
157
164
  }`);
158
- await fs.writeFile(path.join(routes, "about.tsx"), `import { createLazyFileRoute } from '@tanstack/react-router'
165
+ // Create about route file
166
+ await StaticTypeScriptFile(path.join(routes, "about.tsx"), `import { createLazyFileRoute } from '@tanstack/react-router'
159
167
 
160
168
  export const Route = createLazyFileRoute('/about')({
161
169
  component: About,
@@ -164,7 +172,8 @@ export const Route = createLazyFileRoute('/about')({
164
172
  function About() {
165
173
  return <div className="p-2">Hello from About!</div>
166
174
  }`);
167
- await fs.writeFile(path.join(src, "main.tsx"), `import { StrictMode } from 'react'
175
+ // Create main.tsx
176
+ await StaticTypeScriptFile(path.join(src, "main.tsx"), `import { StrictMode } from 'react'
168
177
  import ReactDOM from 'react-dom/client'
169
178
  import { RouterProvider, createRouter } from '@tanstack/react-router'
170
179
  import './index.css'
@@ -194,35 +203,26 @@ if (!rootElement.innerHTML) {
194
203
  }`);
195
204
  }
196
205
  async function removeUnnecessaryFiles() {
197
- await Promise.all([
198
- rm(path.join(props.name, "src", "App.tsx")),
199
- rm(path.join(props.name, "src", "App.css")),
200
- ]);
206
+ await rm(path.join(props.name, "src", "App.tsx"));
207
+ await rm(path.join(props.name, "src", "App.css"));
201
208
  }
202
209
  async function patchTsConfig() {
203
- await Promise.all([
204
- rm(path.join(props.name, "tsconfig.app.json")),
205
- rm(path.join(props.name, "tsconfig.node.json")),
206
- fs.writeFile(path.join(props.name, "tsconfig.json"), JSON.stringify({
207
- extends: props.extends,
208
- compilerOptions: {
209
- baseUrl: ".",
210
- paths: {
211
- "@/*": ["./src/*"],
212
- },
213
- types: ["@cloudflare/workers-types"],
214
- allowImportingTsExtensions: true,
215
- jsx: "react-jsx",
210
+ await rm(path.join(props.name, "tsconfig.app.json"));
211
+ await rm(path.join(props.name, "tsconfig.node.json"));
212
+ await StaticJsonFile(path.join(props.name, "tsconfig.json"), {
213
+ extends: props.extends,
214
+ compilerOptions: {
215
+ baseUrl: ".",
216
+ paths: {
217
+ "@/*": ["./src/*"],
216
218
  },
217
- include: [
218
- "vite/*.ts",
219
- "src/**/*.ts",
220
- "src/**/*.tsx",
221
- "src/env.d.ts",
222
- ],
223
- references: props.references?.map((path) => ({ path })),
224
- }, null, 2)),
225
- ]);
219
+ types: ["@cloudflare/workers-types"],
220
+ allowImportingTsExtensions: true,
221
+ jsx: "react-jsx",
222
+ },
223
+ include: ["vite/*.ts", "src/**/*.ts", "src/**/*.tsx", "src/env.d.ts"],
224
+ references: props.references?.map((path) => ({ path })),
225
+ });
226
226
  }
227
227
  }
228
228
  });
@@ -0,0 +1,173 @@
1
+ import type { ModelConfig } from "../../ai/client";
2
+ import type { Context } from "../../context";
3
+ import { Resource } from "../../resource";
4
+ import type { Secret } from "../../secret";
5
+ /**
6
+ * Theme component props for customizing the layout
7
+ */
8
+ export interface ThemeComponentProps {
9
+ /**
10
+ * Name of the component
11
+ */
12
+ name: string;
13
+ /**
14
+ * Description of what the component does
15
+ */
16
+ description: string;
17
+ /**
18
+ * Features or functionality to include in the component
19
+ */
20
+ features?: string[];
21
+ }
22
+ /**
23
+ * Properties for creating or updating a VitePress custom theme
24
+ */
25
+ export interface CustomThemeProps {
26
+ /**
27
+ * Output directory for the theme files
28
+ */
29
+ outDir: string;
30
+ /**
31
+ * Title of the theme
32
+ */
33
+ title: string;
34
+ /**
35
+ * Description of the theme
36
+ */
37
+ description: string;
38
+ /**
39
+ * Components to include in the theme
40
+ */
41
+ components?: ThemeComponentProps[];
42
+ /**
43
+ * Whether to include dark mode support
44
+ * @default true
45
+ */
46
+ darkMode?: boolean;
47
+ /**
48
+ * Custom CSS variables for theming
49
+ */
50
+ customCssVars?: Record<string, string>;
51
+ /**
52
+ * Custom plugins to add to the theme
53
+ */
54
+ plugins?: string[];
55
+ /**
56
+ * User prompt describing the design of the theme
57
+ */
58
+ prompt: string;
59
+ /**
60
+ * Optional extension to the built-in system prompt
61
+ */
62
+ systemPromptExtension?: string;
63
+ /**
64
+ * Base URL for the OpenAI API
65
+ * @default 'https://api.openai.com/v1'
66
+ */
67
+ baseURL?: string;
68
+ /**
69
+ * OpenAI API key to use for generating content
70
+ * If not provided, will use OPENAI_API_KEY environment variable
71
+ */
72
+ apiKey?: Secret;
73
+ /**
74
+ * Model configuration for the AI generator
75
+ */
76
+ model?: ModelConfig;
77
+ /**
78
+ * Temperature for controlling randomness in generation
79
+ * @default 0.7
80
+ */
81
+ temperature?: number;
82
+ }
83
+ /**
84
+ * A generated file in the custom theme
85
+ */
86
+ export interface ThemeFile {
87
+ /**
88
+ * Path to the file
89
+ */
90
+ path: string;
91
+ /**
92
+ * Content of the file
93
+ */
94
+ content: string;
95
+ }
96
+ /**
97
+ * Output for the VitePress custom theme resource
98
+ */
99
+ export interface CustomTheme extends CustomThemeProps, Resource<"vitepress::CustomTheme"> {
100
+ /**
101
+ * Path to the generated theme directory
102
+ */
103
+ themePath: string;
104
+ /**
105
+ * List of generated files
106
+ */
107
+ files: ThemeFile[];
108
+ /**
109
+ * Time at which the theme was created
110
+ */
111
+ createdAt: number;
112
+ /**
113
+ * Time at which the theme was last updated
114
+ */
115
+ updatedAt: number;
116
+ }
117
+ /**
118
+ * Resource for generating a custom VitePress theme using AI.
119
+ *
120
+ * Generates the necessary theme files including:
121
+ * - Theme entry file (index.ts)
122
+ * - Layout component (Layout.vue)
123
+ * - Additional components based on configuration
124
+ * - Style sheets and utilities
125
+ *
126
+ * @example
127
+ * // Create a basic custom theme
128
+ * const theme = await CustomTheme("docs-theme", {
129
+ * outDir: "./.vitepress/theme",
130
+ * title: "My Custom Theme",
131
+ * description: "A clean, minimal theme for documentation",
132
+ * prompt: "Create a clean documentation theme with a sidebar and search"
133
+ * });
134
+ *
135
+ * @example
136
+ * // Create a theme with specific components
137
+ * const complexTheme = await CustomTheme("blog-theme", {
138
+ * outDir: "./.vitepress/theme",
139
+ * title: "Blog Theme",
140
+ * description: "A theme for technical blogs",
141
+ * components: [
142
+ * {
143
+ * name: "PostList",
144
+ * description: "Component that displays a list of blog posts with pagination",
145
+ * features: ["thumbnail images", "post dates", "categories", "excerpts"]
146
+ * },
147
+ * {
148
+ * name: "TableOfContents",
149
+ * description: "Component that displays the current page's table of contents",
150
+ * features: ["sticky positioning", "active link highlighting"]
151
+ * }
152
+ * ],
153
+ * darkMode: true,
154
+ * prompt: "Create a modern blog theme with post listings and detailed article pages"
155
+ * });
156
+ *
157
+ * @example
158
+ * // Create a theme with custom CSS variables
159
+ * const brandedTheme = await CustomTheme("branded-theme", {
160
+ * outDir: "./.vitepress/theme",
161
+ * title: "Branded Docs",
162
+ * description: "A themed documentation site with custom branding",
163
+ * customCssVars: {
164
+ * "--vp-c-brand": "#3a70b0",
165
+ * "--vp-c-brand-light": "#5785bc",
166
+ * "--vp-c-brand-lighter": "#79a1ce",
167
+ * "--vp-c-brand-dark": "#2c5989",
168
+ * "--vp-c-brand-darker": "#1e3d5c"
169
+ * },
170
+ * prompt: "Create a documentation theme with custom branding and color scheme"
171
+ * });
172
+ */
173
+ export declare const CustomTheme: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<CustomTheme>, id: string, props: CustomThemeProps) => Promise<CustomTheme>);