@caartzee/theme-sdk 1.0.0 → 1.2.1

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 (54) hide show
  1. package/README.md +208 -20
  2. package/dist/bin/caartzee-theme.js +2272 -87
  3. package/dist/lib/index.js +2274 -87
  4. package/dist/types/src/blocks/block-contract.d.ts +10 -10
  5. package/dist/types/src/cli/candy-mcp.d.ts +2 -0
  6. package/dist/types/src/cli/candy-tool-server.d.ts +39 -0
  7. package/dist/types/src/cli/mcp/component-tools.d.ts +2 -0
  8. package/dist/types/src/cli/mcp/docs-tools.d.ts +89 -0
  9. package/dist/types/src/cli/mcp/editor-tools.d.ts +22 -0
  10. package/dist/types/src/cli/mcp/resources-and-prompts.d.ts +2 -0
  11. package/dist/types/src/cli/mcp/testing-tools.d.ts +54 -0
  12. package/dist/types/src/cli/mcp/ui-patterns-tools.d.ts +26 -0
  13. package/dist/types/src/cli/mcp/v2-commerce-tools.d.ts +16 -0
  14. package/dist/types/src/contracts/manifest.d.ts +77 -77
  15. package/dist/types/src/dev-server/dev-server.d.ts +3 -0
  16. package/dist/types/src/dev-server/local-commerce-runtime.d.ts +76 -0
  17. package/dist/types/src/dev-server/local-editor-server.d.ts +22 -0
  18. package/dist/types/src/dev-server/theme-preview.d.ts +6 -2
  19. package/dist/types/src/scaffold/design-presets.d.ts +41 -0
  20. package/dist/types/src/scaffold/template-generator.d.ts +2 -0
  21. package/dist/types/src/sections/section-contract.d.ts +12 -12
  22. package/package.json +2 -1
  23. package/templates/theme-candy-boilerplate/.editorconfig +14 -0
  24. package/templates/theme-candy-boilerplate/.gitattributes +1 -0
  25. package/templates/theme-candy-boilerplate/.vscode/extensions.json +7 -0
  26. package/templates/theme-candy-boilerplate/.vscode/settings.json +17 -0
  27. package/templates/theme-candy-boilerplate/assets/theme.css +78 -0
  28. package/templates/theme-candy-boilerplate/assets/theme.js +7 -0
  29. package/templates/theme-candy-boilerplate/candy.config.json +40 -0
  30. package/templates/theme-candy-boilerplate/index.ts +39 -0
  31. package/templates/theme-candy-boilerplate/layout/theme.candy +25 -0
  32. package/templates/theme-candy-boilerplate/locales/en.default.json +37 -0
  33. package/templates/theme-candy-boilerplate/manifest.json +123 -0
  34. package/templates/theme-candy-boilerplate/package.json +16 -0
  35. package/templates/theme-candy-boilerplate/schemas/settings_schema.json +36 -0
  36. package/templates/theme-candy-boilerplate/sections/featured-products.candy +89 -0
  37. package/templates/theme-candy-boilerplate/sections/footer.candy +50 -0
  38. package/templates/theme-candy-boilerplate/sections/header.candy +116 -0
  39. package/templates/theme-candy-boilerplate/sections/hero-banner.candy +135 -0
  40. package/templates/theme-candy-boilerplate/sections/image-with-text.candy +85 -0
  41. package/templates/theme-candy-boilerplate/snippets/price.candy +19 -0
  42. package/templates/theme-candy-boilerplate/snippets/product-card.candy +43 -0
  43. package/templates/theme-candy-boilerplate/templates/404.candy +12 -0
  44. package/templates/theme-candy-boilerplate/templates/cart.candy +51 -0
  45. package/templates/theme-candy-boilerplate/templates/collection.candy +51 -0
  46. package/templates/theme-candy-boilerplate/templates/index.candy +7 -0
  47. package/templates/theme-candy-boilerplate/templates/page.candy +10 -0
  48. package/templates/theme-candy-boilerplate/templates/product.candy +59 -0
  49. package/templates/theme-candy-boilerplate/templates/search.candy +40 -0
  50. package/templates/vscode-candy/LICENSE +21 -0
  51. package/templates/vscode-candy/extension.js +689 -338
  52. package/templates/vscode-candy/icons/candy-logo.png +0 -0
  53. package/templates/vscode-candy/package.json +18 -3
  54. package/templates/vscode-candy/snippets/candy.code-snippets +91 -0
@@ -10,7 +10,7 @@ export declare const BlockContractSchema: z.ZodObject<{
10
10
  allowedParentSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
11
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
12
  id: z.ZodString;
13
- type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
13
+ type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
14
14
  label: z.ZodString;
15
15
  default: z.ZodOptional<z.ZodUnknown>;
16
16
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -30,7 +30,7 @@ export declare const BlockContractSchema: z.ZodObject<{
30
30
  placeholder: z.ZodOptional<z.ZodString>;
31
31
  }, "strip", z.ZodTypeAny, {
32
32
  id: string;
33
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
33
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
34
34
  label: string;
35
35
  options?: {
36
36
  value: string | number | boolean;
@@ -44,7 +44,7 @@ export declare const BlockContractSchema: z.ZodObject<{
44
44
  placeholder?: string | undefined;
45
45
  }, {
46
46
  id: string;
47
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
47
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
48
48
  label: string;
49
49
  options?: {
50
50
  value: string | number | boolean;
@@ -59,7 +59,7 @@ export declare const BlockContractSchema: z.ZodObject<{
59
59
  }>, "many">>;
60
60
  settingsSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
61
  id: z.ZodString;
62
- type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
62
+ type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
63
63
  label: z.ZodString;
64
64
  default: z.ZodOptional<z.ZodUnknown>;
65
65
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -79,7 +79,7 @@ export declare const BlockContractSchema: z.ZodObject<{
79
79
  placeholder: z.ZodOptional<z.ZodString>;
80
80
  }, "strip", z.ZodTypeAny, {
81
81
  id: string;
82
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
82
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
83
83
  label: string;
84
84
  options?: {
85
85
  value: string | number | boolean;
@@ -93,7 +93,7 @@ export declare const BlockContractSchema: z.ZodObject<{
93
93
  placeholder?: string | undefined;
94
94
  }, {
95
95
  id: string;
96
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
96
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
97
97
  label: string;
98
98
  options?: {
99
99
  value: string | number | boolean;
@@ -111,7 +111,7 @@ export declare const BlockContractSchema: z.ZodObject<{
111
111
  type: string;
112
112
  settings?: {
113
113
  id: string;
114
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
114
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
115
115
  label: string;
116
116
  options?: {
117
117
  value: string | number | boolean;
@@ -130,7 +130,7 @@ export declare const BlockContractSchema: z.ZodObject<{
130
130
  description?: string | undefined;
131
131
  settingsSchema?: {
132
132
  id: string;
133
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
133
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
134
134
  label: string;
135
135
  options?: {
136
136
  value: string | number | boolean;
@@ -150,7 +150,7 @@ export declare const BlockContractSchema: z.ZodObject<{
150
150
  type: string;
151
151
  settings?: {
152
152
  id: string;
153
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
153
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
154
154
  label: string;
155
155
  options?: {
156
156
  value: string | number | boolean;
@@ -169,7 +169,7 @@ export declare const BlockContractSchema: z.ZodObject<{
169
169
  description?: string | undefined;
170
170
  settingsSchema?: {
171
171
  id: string;
172
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
172
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
173
173
  label: string;
174
174
  options?: {
175
175
  value: string | number | boolean;
@@ -0,0 +1,2 @@
1
+ export declare function createCandyMcp(appId: string): import("@modelcontextprotocol/sdk/server/mcp").McpServer;
2
+ export declare function startCandyMcp(appId: string): Promise<void>;
@@ -0,0 +1,39 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { type TestingOperations } from './mcp/testing-tools';
3
+ export type StoreRequest = {
4
+ store: string;
5
+ note?: string | undefined;
6
+ scopes?: string[] | undefined;
7
+ };
8
+ export type CatalogRequest = {
9
+ store: string;
10
+ page?: number | undefined;
11
+ category?: string | undefined;
12
+ product?: string | undefined;
13
+ search?: string | undefined;
14
+ sort?: string | undefined;
15
+ };
16
+ export interface CandyToolServerOperations extends TestingOperations {
17
+ request(args: StoreRequest): Promise<unknown>;
18
+ list(): Promise<unknown>;
19
+ catalog(args: CatalogRequest): Promise<unknown>;
20
+ storeAccessStatus?: (args: {
21
+ store: string;
22
+ }) => Promise<unknown>;
23
+ storePermissionScopes?: () => Promise<unknown>;
24
+ storeTestCapabilities?: (args: {
25
+ store: string;
26
+ }) => Promise<unknown>;
27
+ storeData?: (args: {
28
+ store: string;
29
+ resource: string;
30
+ page?: number;
31
+ category?: string;
32
+ product?: string;
33
+ search?: string;
34
+ sort?: string;
35
+ }) => Promise<unknown>;
36
+ workspace?: () => Promise<unknown>;
37
+ themeVersions?: () => Promise<unknown>;
38
+ }
39
+ export declare function candyToolServer(operations: CandyToolServerOperations): McpServer;
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerComponentTools(server: McpServer): void;
@@ -0,0 +1,89 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const PLUGIN_HOOK_CATALOG: {
3
+ name: string;
4
+ group: string;
5
+ description: string;
6
+ }[];
7
+ export declare const RUNTIME_HOOKS_REFERENCE: {
8
+ cartAndWishlist: ({
9
+ selector: string;
10
+ dataAttributes: string[];
11
+ endpoint: string;
12
+ notes: string;
13
+ } | {
14
+ selector: string;
15
+ notes: string;
16
+ dataAttributes?: never;
17
+ endpoint?: never;
18
+ } | {
19
+ selector: string;
20
+ dataAttributes: string[];
21
+ endpoint: string;
22
+ notes?: never;
23
+ } | {
24
+ selector: string;
25
+ endpoint: string;
26
+ dataAttributes?: never;
27
+ notes?: never;
28
+ })[];
29
+ authentication: ({
30
+ selector: string;
31
+ method: string;
32
+ fields: string[];
33
+ notes: string;
34
+ } | {
35
+ selector: string;
36
+ method: string;
37
+ fields: string[];
38
+ notes?: never;
39
+ })[];
40
+ themeEditorEvents: ({
41
+ attribute: string;
42
+ description: string;
43
+ pattern?: never;
44
+ } | {
45
+ pattern: string;
46
+ description: string;
47
+ attribute?: never;
48
+ })[];
49
+ };
50
+ export declare const STOREFRONT_ROUTES: {
51
+ route: string;
52
+ pageType: string;
53
+ template: string;
54
+ description: string;
55
+ }[];
56
+ export declare const STOREFRONT_VARIABLES: {
57
+ global: ({
58
+ name: string;
59
+ fields: string[];
60
+ description?: never;
61
+ } | {
62
+ name: string;
63
+ description: string;
64
+ fields?: never;
65
+ })[];
66
+ sectionContext: {
67
+ name: string;
68
+ fields: string[];
69
+ }[];
70
+ commerceObjects: ({
71
+ name: string;
72
+ fields: string[];
73
+ description?: never;
74
+ } | {
75
+ name: string;
76
+ description: string;
77
+ fields?: never;
78
+ })[];
79
+ };
80
+ export declare const COMMON_ERRORS_REFERENCE: {
81
+ code: string;
82
+ cause: string;
83
+ fix: string;
84
+ }[];
85
+ export declare const SDK_COMMANDS_REFERENCE: {
86
+ command: string;
87
+ description: string;
88
+ }[];
89
+ export declare function registerDocsTools(server: McpServer): void;
@@ -0,0 +1,22 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export interface EditorCompatibilityCheck {
3
+ name: string;
4
+ status: 'passed' | 'failed' | 'warning';
5
+ message: string;
6
+ file?: string | undefined;
7
+ }
8
+ export declare function validateThemeEditorDirectory(themeDir: string): {
9
+ valid: boolean;
10
+ themeDir: string;
11
+ slug?: string;
12
+ version?: string;
13
+ sectionCount?: number;
14
+ sections?: string[];
15
+ checks: EditorCompatibilityCheck[];
16
+ summary: {
17
+ passed: number;
18
+ failed: number;
19
+ warnings: number;
20
+ };
21
+ };
22
+ export declare function registerEditorTools(server: McpServer): void;
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerResourcesAndPrompts(server: McpServer): void;
@@ -0,0 +1,54 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export interface StorefrontTestCheck {
3
+ id: string;
4
+ category: 'validation' | 'editor' | 'commerce' | 'responsive' | 'accessibility' | 'security' | 'plugins';
5
+ status: 'passed' | 'failed' | 'warning' | 'skipped' | 'blocked';
6
+ message: string;
7
+ file?: string | undefined;
8
+ }
9
+ export interface ThemeReadinessReport {
10
+ generatedAt: string;
11
+ themeDir: string;
12
+ slug: string;
13
+ version: string;
14
+ packageHash: string;
15
+ sdkVersion: string;
16
+ runtimeVersion: string;
17
+ status: 'passed' | 'failed' | 'partial';
18
+ summary: {
19
+ passed: number;
20
+ failed: number;
21
+ warnings: number;
22
+ skipped: number;
23
+ blocked: number;
24
+ };
25
+ checks: StorefrontTestCheck[];
26
+ }
27
+ export declare function runThemeReadinessAudit(themeDir: string): Promise<ThemeReadinessReport>;
28
+ export interface TestingOperations {
29
+ createTestSession?: (args: {
30
+ store: string;
31
+ themeVersion?: string | undefined;
32
+ ttlMinutes?: number | undefined;
33
+ }) => Promise<unknown>;
34
+ getTestSession?: (args: {
35
+ sessionId: string;
36
+ }) => Promise<unknown>;
37
+ getTestFixtures?: (args: {
38
+ sessionId: string;
39
+ }) => Promise<unknown>;
40
+ resetTestSession?: (args: {
41
+ sessionId: string;
42
+ }) => Promise<unknown>;
43
+ closeTestSession?: (args: {
44
+ sessionId: string;
45
+ }) => Promise<unknown>;
46
+ runTestAction?: (args: {
47
+ sessionId: string;
48
+ action: string;
49
+ payload?: Record<string, unknown> | undefined;
50
+ }) => Promise<unknown>;
51
+ saveTestReport?: (report: ThemeReadinessReport) => Promise<unknown>;
52
+ getLatestTestReport?: () => Promise<unknown>;
53
+ }
54
+ export declare function registerTestingTools(server: McpServer, ops: TestingOperations): void;
@@ -0,0 +1,26 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export interface CandyUiPattern {
3
+ id: string;
4
+ name: string;
5
+ category: 'hero' | 'merchandising' | 'social-proof' | 'conversion' | 'commerce-page';
6
+ targetFile: string;
7
+ description: string;
8
+ candySource: string;
9
+ cssSnippet: string;
10
+ }
11
+ export declare const CANDY_UI_PATTERNS: CandyUiPattern[];
12
+ export declare function auditCandyUiConsistency(themeDir: string): {
13
+ themeDir: string;
14
+ status: string;
15
+ summary: {
16
+ passed: number;
17
+ failed: number;
18
+ warnings: number;
19
+ };
20
+ checks: {
21
+ id: string;
22
+ status: string;
23
+ message: string;
24
+ }[];
25
+ };
26
+ export declare function registerUiPatternsTools(server: McpServer): void;
@@ -0,0 +1,16 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ /**
3
+ * Caartzee Developer V2 Commerce MCP Tools & Reusable Prompts
4
+ * Enables AI agents to discover V2 REST APIs, scopes, rate limits, webhooks,
5
+ * @caartzee/storefront-sdk, mobile (Expo/React Native/Flutter) and Next.js headless guides.
6
+ */
7
+ export declare const V2_COMMERCE_ENDPOINTS_SUMMARY: {
8
+ id: string;
9
+ method: string;
10
+ path: string;
11
+ tag: string;
12
+ scope: string;
13
+ auth: string;
14
+ rateTier: string;
15
+ }[];
16
+ export declare function registerV2CommerceMcpTools(server: McpServer): void;