@dyrected/sdk 2.5.25 → 2.5.27

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=robustness.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robustness.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/robustness.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ import { describe, it, expect, vi } from "vitest";
2
+ import { createClient } from "../index.js";
3
+ describe("SDK Robustness", () => {
4
+ const client = createClient({
5
+ baseUrl: "https://api.example.com",
6
+ apiKey: "test-key",
7
+ });
8
+ it("handles deeply nested relationships correctly", async () => {
9
+ const mockFetch = vi.fn().mockResolvedValue({
10
+ ok: true,
11
+ json: () => Promise.resolve({
12
+ id: "post-1",
13
+ title: "Post 1",
14
+ author: {
15
+ id: "author-1",
16
+ name: "Author 1",
17
+ profile: {
18
+ id: "profile-1",
19
+ bio: "Bio 1",
20
+ },
21
+ },
22
+ }),
23
+ });
24
+ const customClient = createClient({
25
+ baseUrl: "https://api.example.com",
26
+ fetch: mockFetch,
27
+ });
28
+ const post = await customClient.collection("posts").findOne("post-1", { depth: 3 });
29
+ expect(post.author.profile.bio).toBe("Bio 1");
30
+ expect(mockFetch).toHaveBeenCalledWith(expect.stringContaining("depth=3"), expect.any(Object));
31
+ });
32
+ it("handles complex boolean logic in where clause", async () => {
33
+ const mockFetch = vi.fn().mockResolvedValue({
34
+ ok: true,
35
+ json: () => Promise.resolve({ docs: [], total: 0 }),
36
+ });
37
+ const customClient = createClient({
38
+ baseUrl: "https://api.example.com",
39
+ fetch: mockFetch,
40
+ });
41
+ await customClient.collection("posts").find({
42
+ where: {
43
+ or: [{ status: { equals: "published" } }, { featured: { equals: true } }],
44
+ and: [{ price: { greater_than: 0 } }, { price: { less_than: 100 } }],
45
+ },
46
+ });
47
+ const lastCall = mockFetch.mock.calls[0][0];
48
+ const url = new URL(lastCall);
49
+ const where = JSON.parse(url.searchParams.get("where") || "{}");
50
+ expect(where.or).toBeDefined();
51
+ expect(where.and).toBeDefined();
52
+ expect(where.or[0].status.equals).toBe("published");
53
+ });
54
+ it("survives malformed JSON responses gracefully", async () => {
55
+ const mockFetch = vi.fn().mockResolvedValue({
56
+ ok: true,
57
+ json: () => Promise.reject(new Error("Unexpected token")),
58
+ });
59
+ const customClient = createClient({
60
+ baseUrl: "https://api.example.com",
61
+ fetch: mockFetch,
62
+ });
63
+ await expect(customClient.collection("posts").find()).rejects.toThrow();
64
+ });
65
+ });
66
+ //# sourceMappingURL=robustness.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robustness.test.js","sourceRoot":"","sources":["../../src/__tests__/robustness.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,MAAM,GAAG,YAAY,CAAC;QAC1B,OAAO,EAAE,yBAAyB;QAClC,MAAM,EAAE,UAAU;KACnB,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC;YAC1C,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,GAAG,EAAE,CACT,OAAO,CAAC,OAAO,CAAC;gBACd,EAAE,EAAE,QAAQ;gBACZ,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE;oBACN,EAAE,EAAE,UAAU;oBACd,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE;wBACP,EAAE,EAAE,WAAW;wBACf,GAAG,EAAE,OAAO;qBACb;iBACF;aACF,CAAC;SACL,CAAC,CAAC;QAEH,MAAM,YAAY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/api/schemas");
981
981
  }
982
+ async getPreference(key) {
983
+ return this.request(`/api/preferences/${encodeURIComponent(key)}`);
984
+ }
985
+ async setPreference(key, value) {
986
+ return this.request(`/api/preferences/${encodeURIComponent(key)}`, {
987
+ method: "PUT",
988
+ body: JSON.stringify({ value })
989
+ });
990
+ }
982
991
  /**
983
992
  * Fetch draft data for a specific preview token.
984
993
  * Used in "token" preview mode.
package/dist/index.d.cts CHANGED
@@ -125,6 +125,14 @@ declare class DyrectedClient<TSchema extends BaseSchema = any> {
125
125
  collections: any[];
126
126
  globals: any[];
127
127
  }>;
128
+ getPreference<T = unknown>(key: string): Promise<{
129
+ key: string;
130
+ value: T | null;
131
+ }>;
132
+ setPreference<T = unknown>(key: string, value: T): Promise<{
133
+ key: string;
134
+ value: T;
135
+ }>;
128
136
  /**
129
137
  * Fetch draft data for a specific preview token.
130
138
  * Used in "token" preview mode.
package/dist/index.d.ts CHANGED
@@ -125,6 +125,14 @@ declare class DyrectedClient<TSchema extends BaseSchema = any> {
125
125
  collections: any[];
126
126
  globals: any[];
127
127
  }>;
128
+ getPreference<T = unknown>(key: string): Promise<{
129
+ key: string;
130
+ value: T | null;
131
+ }>;
132
+ setPreference<T = unknown>(key: string, value: T): Promise<{
133
+ key: string;
134
+ value: T;
135
+ }>;
128
136
  /**
129
137
  * Fetch draft data for a specific preview token.
130
138
  * Used in "token" preview mode.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,IAAI,KAAK,EACjB,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAElE,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,E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CAAC;YAI3E,OAAO;CA+BtB;AAED,wBAAgB,YAAY,CAAC,OAAO,SAAS;IAAE,WAAW,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG,GAAG,EACnF,MAAM,EAAE,oBAAoB,GAC3B,cAAc,CAAC,OAAO,CAAC,CAEzB;AAGD,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -949,6 +949,15 @@ var DyrectedClient = class {
949
949
  async getSchemas() {
950
950
  return this.request("/api/schemas");
951
951
  }
952
+ async getPreference(key) {
953
+ return this.request(`/api/preferences/${encodeURIComponent(key)}`);
954
+ }
955
+ async setPreference(key, value) {
956
+ return this.request(`/api/preferences/${encodeURIComponent(key)}`, {
957
+ method: "PUT",
958
+ body: JSON.stringify({ value })
959
+ });
960
+ }
952
961
  /**
953
962
  * Fetch draft data for a specific preview token.
954
963
  * Used in "token" preview mode.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUjE,OAAO,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AA4ClE;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,UAAU,CAAS;IACnB,MAAM,CAAwC;IAEvD,YAAY,OAAe,EAAE,UAAkB,EAAE,SAAgD,EAAE;QACjG,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAiBD,MAAM,OAAO,cAAc;IACjB,OAAO,CAAS;IAChB,OAAO,CAAyB;IAChC,KAAK,CAAe;IACpB,YAAY,CAAS;IAE7B,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,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YACvC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;gBAC1E,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,IAAI,8BAA8B,GAAG,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7G,CAAC;YACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,MAAM,UAAU,YAAY,CAC1B,MAA4B;IAE5B,OAAO,IAAI,cAAc,CAAU,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,wDAAwD;AACxD,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+ import { DyrectedClient } from './index.js';
3
+ describe('DyrectedClient', () => {
4
+ let client;
5
+ const mockFetch = vi.fn();
6
+ beforeEach(() => {
7
+ mockFetch.mockReset();
8
+ client = new DyrectedClient({
9
+ baseUrl: 'http://api.test',
10
+ fetch: mockFetch,
11
+ });
12
+ });
13
+ it('should include depth in find queries', async () => {
14
+ mockFetch.mockResolvedValueOnce({
15
+ ok: true,
16
+ json: () => Promise.resolve({ docs: [], total: 0 }),
17
+ });
18
+ await client.find('posts', { depth: 2 });
19
+ const [url] = mockFetch.mock.calls[0];
20
+ expect(url).toContain('depth=2');
21
+ });
22
+ it('should include depth in findOne queries', async () => {
23
+ mockFetch.mockResolvedValueOnce({
24
+ ok: true,
25
+ json: () => Promise.resolve({ id: '1' }),
26
+ });
27
+ await client.findOne('posts', '1', { depth: 3 });
28
+ const [url] = mockFetch.mock.calls[0];
29
+ expect(url).toContain('depth=3');
30
+ });
31
+ it('should include depth in getGlobal queries', async () => {
32
+ mockFetch.mockResolvedValueOnce({
33
+ ok: true,
34
+ json: () => Promise.resolve({ siteName: 'Test' }),
35
+ });
36
+ await client.getGlobal('settings', { depth: 5 });
37
+ const [url] = mockFetch.mock.calls[0];
38
+ expect(url).toContain('depth=5');
39
+ });
40
+ });
41
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,MAAsB,CAAC;IAC3B,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;IAE1B,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,GAAG,IAAI,cAAc,CAAC;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,KAAK,EAAE,SAAgB;SACxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,SAAS,CAAC,qBAAqB,CAAC;YAC9B,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;SACpD,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KA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CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { PaginatedResult } from '@dyrected/core';
2
+ export interface QueryArgs {
3
+ limit?: number;
4
+ page?: number;
5
+ depth?: number;
6
+ where?: any;
7
+ sort?: string;
8
+ initialData?: any[];
9
+ }
10
+ export declare class QueryBuilder<T = any> {
11
+ private collection;
12
+ private executor;
13
+ private args;
14
+ constructor(collection: string, executor: (collection: string, args: QueryArgs) => Promise<PaginatedResult<T>>);
15
+ where(where: any): this;
16
+ sort(sort: string): this;
17
+ limit(limit: number): this;
18
+ page(page: number): this;
19
+ depth(depth: number): this;
20
+ seed(data: T[]): this;
21
+ exec(): Promise<PaginatedResult<T>>;
22
+ then<TResult1 = PaginatedResult<T>, TResult2 = never>(onfulfilled?: ((value: PaginatedResult<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
23
+ }
24
+ //# sourceMappingURL=query-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../src/query-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC;CACrB;AAED,qBAAa,YAAY,CAAC,CAAC,GAAG,GAAG;IAI7B,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ;IAJlB,OAAO,CAAC,IAAI,CAAiB;gBAGnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAGxF,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAKvB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI;IAKf,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAKzC,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,EAClD,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,EACtF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,GACtE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAGhC"}
@@ -0,0 +1,41 @@
1
+ export class QueryBuilder {
2
+ collection;
3
+ executor;
4
+ args = {};
5
+ constructor(collection, executor) {
6
+ this.collection = collection;
7
+ this.executor = executor;
8
+ }
9
+ where(where) {
10
+ this.args.where = { ...this.args.where, ...where };
11
+ return this;
12
+ }
13
+ sort(sort) {
14
+ this.args.sort = sort;
15
+ return this;
16
+ }
17
+ limit(limit) {
18
+ this.args.limit = limit;
19
+ return this;
20
+ }
21
+ page(page) {
22
+ this.args.page = page;
23
+ return this;
24
+ }
25
+ depth(depth) {
26
+ this.args.depth = depth;
27
+ return this;
28
+ }
29
+ seed(data) {
30
+ this.args.initialData = data;
31
+ return this;
32
+ }
33
+ async exec() {
34
+ return this.executor(this.collection, this.args);
35
+ }
36
+ // Thenable support for convenience
37
+ then(onfulfilled, onrejected) {
38
+ return this.exec().then(onfulfilled, onrejected);
39
+ }
40
+ }
41
+ //# sourceMappingURL=query-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../src/query-builder.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,YAAY;IAIb;IACA;IAJF,IAAI,GAAc,EAAE,CAAC;IAE7B,YACU,UAAkB,EAClB,QAA8E;QAD9E,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAsE;IACrF,CAAC;IAEJ,KAAK,CAAC,KAAU;QACd,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAa;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAa;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,mCAAmC;IACnC,IAAI,CACF,WAAsF,EACtF,UAAuE;QAEvE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ export interface SetupPromptConfig {
2
+ siteName?: string;
3
+ siteId?: string;
4
+ apiKey?: string;
5
+ baseUrl?: string;
6
+ isSelfHosted?: boolean;
7
+ existingSite?: boolean;
8
+ }
9
+ export declare function generateFreshSetupPrompt(activeTab: "next" | "nuxt" | "react" | "vue", config: SetupPromptConfig): string;
10
+ export declare function generateAIPrompt(activeTab: "next" | "nuxt" | "react" | "vue", config: SetupPromptConfig): string;
11
+ //# sourceMappingURL=setup-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-prompt.d.ts","sourceRoot":"","sources":["../../src/utils/setup-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAogBD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,EAC5C,MAAM,EAAE,iBAAiB,GACxB,MAAM,CA8WR;AAMD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA+BhH"}
@@ -0,0 +1,855 @@
1
+ // ─────────────────────────────────────────────
2
+ // Section builders
3
+ // ─────────────────────────────────────────────
4
+ function buildEnvironmentSection(frameworkLabel, isSelfHosted, config) {
5
+ const credentialLines = isSelfHosted ? "" : `- Site ID : ${config.siteId}\n- API Key : ${config.apiKey}`;
6
+ return `
7
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8
+ 1. ENVIRONMENT
9
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10
+ - Framework : ${frameworkLabel || "Detect it"}
11
+ - Host Type : ${isSelfHosted ? "Self-Hosted (Local/Private Server)" : "Managed (Dyrected Cloud)"}
12
+ - API Base : ${config.baseUrl || "http://localhost:3000"}
13
+ ${credentialLines}`;
14
+ }
15
+ function buildDiagnosticSection() {
16
+ return `
17
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
18
+ 2. PHASE 0 — DISCOVERY
19
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20
+ Before writing any code, you MUST ask the user these questions.
21
+ Write them exactly as shown below — in plain language with examples.
22
+ Wait for the user to answer ALL of them before proceeding.
23
+
24
+ ─── QUESTION 1 ───
25
+ Ask:
26
+ "Do you already have a website built, or are we starting fresh?
27
+
28
+ → Already built: share your project or describe what pages you have
29
+ (e.g. Home, About, Services, Contact)
30
+ → Starting fresh: just say 'new site' and describe what the site is for"
31
+
32
+ ─── QUESTION 2 ───
33
+ Ask:
34
+ "What kind of content will your client need to update regularly?
35
+
36
+ Here are some examples to help you think:
37
+ → Blog posts or news articles
38
+ → Team member profiles (name, photo, bio)
39
+ → Services or product descriptions
40
+ → Testimonials or reviews
41
+ → Event listings
42
+ → FAQs
43
+ → Homepage text (headline, hero image, call-to-action button)
44
+
45
+ Just list the ones that apply. You can say things like:
46
+ 'They need to update blog posts and team members'"
47
+
48
+ ─── QUESTION 3 ───
49
+ Ask:
50
+ "Are there any pages on the site that should NEVER change — like a
51
+ custom-coded page you want to leave exactly as it is?
52
+
53
+ Example answer: 'The homepage has a custom animation, leave that alone.
54
+ Everything else can be managed from the CMS.'
55
+
56
+ If everything should be manageable, just say 'all pages'"
57
+
58
+ ─── QUESTION 4 ───
59
+ Ask:
60
+ "What is this website for? Pick the closest description:
61
+
62
+ A) A business or agency marketing site (show services, get leads)
63
+ B) A blog or content site (publish articles regularly)
64
+ C) A SaaS or product site (landing page, pricing, features)
65
+ D) A portfolio (show work, case studies)
66
+ E) An e-commerce or product catalogue
67
+ F) Something else — describe it in one sentence"
68
+
69
+ ─── IF EXISTING SITE ───
70
+ If the user confirms they have an existing site, also:
71
+ - Scan the codebase for all hardcoded text that should be CMS-managed
72
+ - Identify repeated data structures that should become collections
73
+ - Propose saving current content to a migration/ folder as .json files
74
+ BEFORE touching any code
75
+ - Report your findings to the user and get confirmation before proceeding
76
+
77
+ Do NOT write any implementation code until all questions are answered
78
+ and the user has confirmed the content plan.`;
79
+ }
80
+ function buildConstraintsSection() {
81
+ return `
82
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
+ 3. ARCHITECTURE & CONSTRAINTS
84
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
85
+ - API ACCESS : Use client.collection(slug) as the only entry point.
86
+ - ZERO-STATE : Always use initialData in all data fetches so the site
87
+ renders correctly on first load and never throws during render.
88
+ - MARKETING FREEDOM : Use a dynamic pages collection with a catch-all route
89
+ so marketing can create and manage pages without a developer.
90
+ - BLOCKS DESIGN : Use blocks for flexible page builders. Store as
91
+ [{ blockType: 'slug', ...fields }] and switch on blockType
92
+ in the frontend renderer.
93
+ - DATA SAFETY : Never overwrite or drop existing content or pages.
94
+ Preserve everything before making changes.
95
+ - RESILIENCE : If Dyrected backend is unreachable, fall back to
96
+ initialData and show stale content — never an error page.
97
+ All relationship fields must handle null gracefully.
98
+ Every block renderer must have a default fallback case.`;
99
+ }
100
+ function buildSchemaRulesSection() {
101
+ return `
102
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
103
+ 4. SCHEMA EVOLUTION RULES
104
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
+ - Never drop existing fields from the schema. Mark unused fields as deprecated only.
106
+ - All new fields must have a defaultValue.
107
+ - Never rename a field slug — add a new field and migrate data separately.
108
+ - For Cloud deployments, run npx @dyrected/cli sync:schema after every config change. Self-hosted deployments sync automatically on startup.`;
109
+ }
110
+ function buildDoNotSection() {
111
+ return `
112
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
+ 5. DO NOT
114
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+ - Do NOT use client.collections — always use client.collection(slug).
116
+ - Do NOT add custom auth middleware to the admin route.
117
+ Dyrected handles admin authentication internally. Do not wrap,
118
+ protect, or redirect the admin route yourself.
119
+ - Do NOT use renderAdminUI in a Nuxt.js project. Use the DyrectedAdmin
120
+ component which is auto-imported by @dyrected/nuxt.
121
+ - Do NOT modify or overwrite existing pages without first preserving their data.
122
+ - Do NOT drop, rename, or remove fields from an existing schema.
123
+ - Do NOT integrate blog posts or testimonials unless explicitly requested.
124
+ - Do NOT skip the diagnostic or discovery phase.`;
125
+ }
126
+ function buildTechnicalReferenceSection() {
127
+ return `
128
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
+ 6. TECHNICAL REFERENCE
130
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
131
+ Use defineCollection, defineGlobal, and defineConfig from '@dyrected/core'.
132
+
133
+ FIELD TYPES:
134
+ - Primitive : text | textarea | richText | number | boolean | date | email | url | json | image
135
+ - Choice : select | multiSelect (requires options: [{ label, value }])
136
+ - Structural : array | object (requires nested fields: [...])
137
+ - Relation : relationship (requires relationTo: '<slug>')
138
+ - Media : relationship to an upload collection (e.g. 'media')
139
+ - Blocks : blocks (requires blocks: [{ slug, labels, fields }])
140
+
141
+ COLLECTION OPTIONS:
142
+ - upload: true — media library with file upload support
143
+ - auth: true — adds login/me endpoints; password field is auto-managed
144
+ - audit: true — enables activity logging
145
+ - admin.useAsTitle — field used as display title in admin list view
146
+ - admin.group — groups collection under a sidebar heading
147
+ - admin.hidden — hides collection from the sidebar (internal/system use)
148
+
149
+ FIELD OPTIONS:
150
+ - label — user-friendly display name (REQUIRED for all fields)
151
+ - required — validation
152
+ - unique — database-level uniqueness constraint
153
+ - hasMany — allow multiple values (for relationship, select, image)
154
+ - defaultValue — fallback value (required on all new fields added to existing schemas)
155
+ - admin.condition — Jexl expression string to conditionally show/hide field
156
+ e.g. "status == \\"published\\""
157
+ - admin.readOnly — display only, not editable
158
+ - admin.hidden — hidden from editor UI entirely
159
+ - hooks.beforeChange — [async (value) => newValue] transform before save
160
+ - hooks.afterRead — [async (value) => newValue] transform after read
161
+
162
+ GLOBALS:
163
+ Use defineGlobal for single-instance documents like site settings or navigation.
164
+ Access via client.global(slug).get() and client.global(slug).update(data).
165
+
166
+ BLOCKS:
167
+ Blocks are stored as [{ blockType: '<slug>', ...fields }].
168
+ The admin renders a drag-and-drop block editor automatically.
169
+ On the frontend, iterate the array and switch on block.blockType.
170
+ Always include a default case in your switch for unknown block types.
171
+
172
+ COMPLETE SCHEMA EXAMPLE:
173
+ \`\`\`ts
174
+ import { defineCollection, defineGlobal, defineConfig } from '@dyrected/core'
175
+ import { SqliteAdapter } from '@dyrected/db-sqlite'
176
+
177
+ const media = defineCollection({
178
+ slug: 'media',
179
+ upload: true,
180
+ fields: [
181
+ { name: 'alt', label: 'Alt Text', type: 'text' },
182
+ ],
183
+ })
184
+
185
+ const pages = defineCollection({
186
+ slug: 'pages',
187
+ admin: { useAsTitle: 'title', group: 'Content' },
188
+ fields: [
189
+ { name: 'title', label: 'Title', type: 'text', required: true },
190
+ { name: 'slug', label: 'URL Slug', type: 'text', required: true, unique: true },
191
+ { name: 'seo', label: 'SEO Metadata', type: 'object', fields: [
192
+ { name: 'metaTitle', label: 'Meta Title', type: 'text' },
193
+ { name: 'metaDescription', label: 'Meta Description', type: 'textarea' },
194
+ { name: 'ogImage', label: 'OG Image', type: 'relationship', relationTo: 'media' },
195
+ ]},
196
+ {
197
+ name: 'layout',
198
+ label: 'Page Layout',
199
+ type: 'blocks',
200
+ blocks: [
201
+ {
202
+ slug: 'hero',
203
+ labels: { singular: 'Hero', plural: 'Heroes' },
204
+ fields: [
205
+ { name: 'heading', label: 'Heading', type: 'text', required: true },
206
+ { name: 'subheading', label: 'Subheading', type: 'textarea' },
207
+ { name: 'image', label: 'Hero Image', type: 'relationship', relationTo: 'media' },
208
+ { name: 'ctaLabel', label: 'Button Label', type: 'text' },
209
+ { name: 'ctaLink', label: 'Button Link', type: 'url' },
210
+ ],
211
+ },
212
+ {
213
+ slug: 'richContent',
214
+ labels: { singular: 'Rich Content', plural: 'Rich Content Blocks' },
215
+ fields: [
216
+ { name: 'content', label: 'Content', type: 'richText', required: true },
217
+ ],
218
+ },
219
+ {
220
+ slug: 'callToAction',
221
+ labels: { singular: 'Call to Action', plural: 'Calls to Action' },
222
+ fields: [
223
+ { name: 'heading', label: 'Heading', type: 'text', required: true },
224
+ { name: 'description', label: 'Description', type: 'textarea' },
225
+ { name: 'buttonLabel', label: 'Button Text', type: 'text' },
226
+ { name: 'buttonLink', label: 'Button Link', type: 'url' },
227
+ { name: 'theme', label: 'Theme', type: 'select', options: [
228
+ { label: 'Primary', value: 'primary' },
229
+ { label: 'Secondary', value: 'secondary' },
230
+ { label: 'Dark', value: 'dark' },
231
+ ]},
232
+ ],
233
+ },
234
+ ],
235
+ },
236
+ ],
237
+ })
238
+
239
+ const settings = defineGlobal({
240
+ slug: 'settings',
241
+ label: 'Site Settings',
242
+ fields: [
243
+ { name: 'siteName', label: 'Site Name', type: 'text' },
244
+ { name: 'tagline', label: 'Site Tagline', type: 'text' },
245
+ { name: 'logo', label: 'Site Logo', type: 'relationship', relationTo: 'media' },
246
+ { name: 'footerText', label: 'Footer Text', type: 'textarea' },
247
+ ],
248
+ })
249
+
250
+ export default defineConfig({
251
+ collections: [media, pages],
252
+ globals: [settings],
253
+ db: new SqliteAdapter({ filename: './dyrected.db' }),
254
+ })
255
+ \`\`\``;
256
+ }
257
+ function buildDeliverablesSection() {
258
+ return `
259
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
260
+ 7. REQUIRED DELIVERABLES — IN THIS ORDER
261
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
262
+ Return your response in exactly this order. Do not combine steps. Do not skip steps.
263
+
264
+ 1. Diagnostic findings (what exists, what needs to become CMS-managed)
265
+ 2. dyrected.config.ts — complete file
266
+ 3. Admin route file — complete file
267
+ 4. Catch-all frontend page route — complete file
268
+ 5. Block components — names and fields only
269
+ 6. Migration/fallback strategy — numbered steps
270
+ 7. Schema sync command
271
+
272
+ API Reference: https://docs.dyrected.com
273
+ If you are unsure about any syntax or property, refer to the documentation above.`;
274
+ }
275
+ // ─────────────────────────────────────────────
276
+ // Framework-specific implementation sections
277
+ // ─────────────────────────────────────────────
278
+ function buildFrameworkSection(activeTab, isSelfHosted, config) {
279
+ const envPrefix = activeTab === "next" ? "NEXT_PUBLIC_" : activeTab === "nuxt" ? "NUXT_PUBLIC_" : "";
280
+ const credentialEnvLines = isSelfHosted
281
+ ? ""
282
+ : `
283
+ apiKey: process.env.${envPrefix}DYRECTED_API_KEY || '${config.apiKey}',
284
+ siteId: process.env.${envPrefix}SITE_ID || '${config.siteId}',`;
285
+ const baseUrlLine = `process.env.${envPrefix}DYRECTED_URL || '${config.baseUrl || "http://localhost:3000"}'`;
286
+ const sections = {
287
+ next: `
288
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
289
+ 8. IMPLEMENTATION — Next.js
290
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
291
+ 1. SDK Setup (lib/dyrected.ts):
292
+ \`\`\`ts
293
+ import { createClient } from '@dyrected/sdk'
294
+
295
+ export const dyrected = createClient({
296
+ baseUrl: ${baseUrlLine},${credentialEnvLines}
297
+ })
298
+ \`\`\`
299
+
300
+ 2. Admin Route (app/cms/page.tsx):
301
+ \`\`\`tsx
302
+ import { DyrectedAdmin } from '@dyrected/next/admin'
303
+
304
+ export default function AdminPage() {
305
+ // DyrectedAdmin handles routing, auth, and CSS automatically.
306
+ // Do NOT wrap this in custom auth middleware.
307
+ return <DyrectedAdmin basename="/cms" />
308
+ }
309
+ \`\`\`
310
+
311
+ 3. Catch-all Page Route (app/[...slug]/page.tsx):
312
+ \`\`\`tsx
313
+ import { dyrected } from '@/lib/dyrected'
314
+
315
+ export default async function CmsPage({ params }: { params: { slug: string[] } }) {
316
+ const slug = params.slug?.join('/') || 'home'
317
+ const page = await dyrected.collection('pages').findOne({ where: { slug: { equals: slug } } })
318
+
319
+ if (!page) return <div>Page not found</div>
320
+
321
+ return (
322
+ <main>
323
+ {page.layout?.map((block: any, i: number) => (
324
+ <BlockRenderer key={i} block={block} />
325
+ ))}
326
+ </main>
327
+ )
328
+ }
329
+ \`\`\``,
330
+ nuxt: `
331
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
332
+ 8. IMPLEMENTATION — Nuxt.js
333
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
334
+ 1. Nuxt.js Config (nuxt.config.ts):
335
+ \`\`\`ts
336
+ export default defineNuxtConfig({
337
+ modules: ['@dyrected/nuxt'],
338
+ dyrected: {
339
+ baseUrl: process.env.${envPrefix}DYRECTED_URL || '${config.baseUrl || "http://localhost:3000"}',${isSelfHosted
340
+ ? ""
341
+ : `
342
+ apiKey: process.env.${envPrefix}DYRECTED_API_KEY || '${config.apiKey}',
343
+ siteId: process.env.${envPrefix}SITE_ID || '${config.siteId}',`}
344
+ },
345
+ })
346
+ \`\`\`
347
+
348
+ 2. Admin Route (pages/cms/index.vue):
349
+ \`\`\`vue
350
+ <script setup lang="ts">
351
+ // DyrectedAdmin is auto-imported by @dyrected/nuxt.
352
+ // Do NOT manually import it.
353
+ // Do NOT use renderAdminUI here.
354
+ // Do NOT add custom auth middleware — Dyrected handles authentication.
355
+ definePageMeta({ layout: false })
356
+ </script>
357
+
358
+ <template>
359
+ <ClientOnly>
360
+ <DyrectedAdmin basename="/cms" />
361
+ </ClientOnly>
362
+ </template>
363
+ \`\`\`
364
+
365
+ 3. Catch-all Page Route (pages/[...slug].vue):
366
+ \`\`\`vue
367
+ <script setup lang="ts">
368
+ const route = useRoute()
369
+ const slug = computed(() =>
370
+ Array.isArray(route.params.slug)
371
+ ? route.params.slug.join('/')
372
+ : route.params.slug || 'home'
373
+ )
374
+
375
+ const { data: page } = await useDyrected('pages').findOne({
376
+ where: { slug: { equals: slug.value } },
377
+ initialData: null,
378
+ })
379
+ </script>
380
+
381
+ <template>
382
+ <main v-if="page">
383
+ <BlockRenderer
384
+ v-for="(block, i) in page.layout"
385
+ :key="i"
386
+ :block="block"
387
+ />
388
+ </main>
389
+ <div v-else>Page not found</div>
390
+ </template>
391
+ \`\`\``,
392
+ react: `
393
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
394
+ 8. IMPLEMENTATION — React
395
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
396
+ 1. SDK Setup (lib/dyrected.ts):
397
+ \`\`\`ts
398
+ import { createClient } from '@dyrected/sdk'
399
+
400
+ export const dyrected = createClient({
401
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
402
+ ? ""
403
+ : `
404
+ apiKey: '${config.apiKey}',
405
+ siteId: '${config.siteId}',`}
406
+ })
407
+ \`\`\`
408
+
409
+ 2. Admin Route (pages/cms.tsx):
410
+ \`\`\`tsx
411
+ import { AdminUI } from '@dyrected/admin'
412
+ import '@dyrected/admin/styles'
413
+
414
+ export default function AdminPage() {
415
+ return (
416
+ <div style={{ height: '100vh' }}>
417
+ <AdminUI
418
+ baseUrl="${config.baseUrl || "https://api.dyrected.cloud"}"${isSelfHosted
419
+ ? ""
420
+ : `
421
+ apiKey="${config.apiKey}"
422
+ siteId="${config.siteId}"`}
423
+ />
424
+ </div>
425
+ )
426
+ }
427
+ \`\`\``,
428
+ vue: `
429
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
430
+ 8. IMPLEMENTATION — Vue
431
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
432
+ 1. SDK Setup (lib/dyrected.ts):
433
+ \`\`\`ts
434
+ import { createClient } from '@dyrected/sdk'
435
+
436
+ export const dyrected = createClient({
437
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
438
+ ? ""
439
+ : `
440
+ apiKey: '${config.apiKey}',
441
+ siteId: '${config.siteId}',`}
442
+ })
443
+ \`\`\`
444
+
445
+ 2. Admin Route (pages/cms.vue):
446
+ \`\`\`vue
447
+ <template>
448
+ <div ref="container" style="height: 100vh" />
449
+ </template>
450
+
451
+ <script setup>
452
+ import { ref, onMounted, onUnmounted } from 'vue'
453
+ import { renderAdminUI } from '@dyrected/admin'
454
+ import '@dyrected/admin/styles'
455
+
456
+ const container = ref(null)
457
+ let cleanup: (() => void) | undefined
458
+
459
+ onMounted(() => {
460
+ cleanup = renderAdminUI(container.value, {
461
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
462
+ ? ""
463
+ : `
464
+ apiKey: '${config.apiKey}',
465
+ siteId: '${config.siteId}',`}
466
+ })
467
+ })
468
+
469
+ onUnmounted(() => cleanup?.())
470
+ </script>
471
+ \`\`\``,
472
+ };
473
+ return sections[activeTab] || sections.next;
474
+ }
475
+ // ─────────────────────────────────────────────
476
+ // Fresh install prompt (no Dyrected installed yet)
477
+ // ─────────────────────────────────────────────
478
+ export function generateFreshSetupPrompt(activeTab, config) {
479
+ const frameworkLabel = activeTab === "next"
480
+ ? "Next.js"
481
+ : activeTab === "nuxt"
482
+ ? "Nuxt.js"
483
+ : activeTab
484
+ ? activeTab.charAt(0).toUpperCase() + activeTab.slice(1)
485
+ : "the project's detected framework";
486
+ const isSelfHosted = config.isSelfHosted === true || (!config.apiKey && !config.siteId);
487
+ const frameworkSetup = {
488
+ nuxt: `
489
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
490
+ 3. INSTALLATION STEPS — Run these in order
491
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
492
+ Tell the user to follow these steps exactly. Explain each one in plain
493
+ language before showing the command. Do not skip any step.
494
+
495
+ STEP 1 — Initialize Dyrected
496
+ Tell the user:
497
+ "Run this command in your terminal inside your Nuxt.js project folder.
498
+ It will set everything up for you automatically."
499
+
500
+ \`\`\`bash
501
+ npx @dyrected/cli init
502
+ \`\`\`
503
+
504
+ When it asks questions, tell the user to:
505
+ - Choose: Nuxt.js 3
506
+ - Choose: SQLite (easiest option, no extra setup needed)
507
+
508
+ The CLI will automatically:
509
+ - Install all required packages
510
+ - Create a dyrected.config.ts file
511
+ - Mount the Admin UI at pages/cms/index.vue
512
+ - Generate a .env.example file
513
+
514
+ STEP 2 — Register the module
515
+ Tell the user to open nuxt.config.ts and add '@dyrected/nuxt' to modules:
516
+
517
+ \`\`\`ts
518
+ export default defineNuxtConfig({
519
+ modules: ['@dyrected/nuxt'],
520
+ })
521
+ \`\`\`
522
+
523
+ STEP 3 — Set up environment variables
524
+ Tell the user:
525
+ "Find the file called .env.example in your project.
526
+ Make a copy of it and rename the copy to .env
527
+ Then open .env and fill in the values."
528
+
529
+ STEP 4 — Start the project
530
+ \`\`\`bash
531
+ pnpm dev
532
+ \`\`\`
533
+
534
+ STEP 5 — Open the dashboard
535
+ Tell the user to open their browser and go to:
536
+ http://localhost:3000/cms
537
+
538
+ If they see the Dyrected admin dashboard, the installation worked.
539
+ Tell them: "You are ready. Now let's set up your content."`,
540
+ next: `
541
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
542
+ 3. INSTALLATION STEPS — Run these in order
543
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
544
+ Tell the user to follow these steps exactly. Explain each one in plain
545
+ language before showing the command. Do not skip any step.
546
+
547
+ STEP 1 — Initialize Dyrected
548
+ Tell the user:
549
+ "Run this command in your terminal inside your Next.js project folder."
550
+
551
+ \`\`\`bash
552
+ npx @dyrected/cli init
553
+ \`\`\`
554
+
555
+ When it asks questions, tell the user to:
556
+ - Choose: Next.js
557
+ - Choose: SQLite (easiest option, no extra setup needed)
558
+
559
+ The CLI will automatically:
560
+ - Install all required packages
561
+ - Create a dyrected.config.ts file
562
+ - Mount the Admin UI at app/cms/page.tsx
563
+ - Generate a .env.example file
564
+
565
+ STEP 2 — Set up environment variables
566
+ Tell the user:
567
+ "Find the file called .env.example in your project.
568
+ Make a copy of it and rename the copy to .env.local
569
+ Then open .env.local and fill in the values."
570
+
571
+ STEP 3 — Start the project
572
+ \`\`\`bash
573
+ pnpm dev
574
+ \`\`\`
575
+
576
+ STEP 4 — Open the dashboard
577
+ Tell the user to open their browser and go to:
578
+ http://localhost:3000/cms
579
+
580
+ If they see the Dyrected admin dashboard, the installation worked.
581
+ Tell them: "You are ready. Now let's set up your content."`,
582
+ react: `
583
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
584
+ 3. INSTALLATION STEPS — Run these in order
585
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
586
+ STEP 1 — Install the SDK and admin packages
587
+ \`\`\`bash
588
+ npm install @dyrected/sdk @dyrected/admin
589
+ \`\`\`
590
+
591
+ STEP 2 — Set up the client (lib/dyrected.ts):
592
+ \`\`\`ts
593
+ import { createClient } from '@dyrected/sdk'
594
+
595
+ export const dyrected = createClient({
596
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
597
+ ? ""
598
+ : `
599
+ apiKey: '${config.apiKey}',
600
+ siteId: '${config.siteId}',`}
601
+ })
602
+ \`\`\`
603
+
604
+ STEP 3 — Mount the Admin UI (pages/cms.tsx):
605
+ \`\`\`tsx
606
+ import { AdminUI } from '@dyrected/admin'
607
+ import '@dyrected/admin/styles'
608
+
609
+ export default function AdminPage() {
610
+ return (
611
+ <div style={{ height: '100vh' }}>
612
+ <AdminUI
613
+ baseUrl="${config.baseUrl || "https://api.dyrected.cloud"}"${isSelfHosted
614
+ ? ""
615
+ : `
616
+ apiKey="${config.apiKey}"
617
+ siteId="${config.siteId}"`}
618
+ />
619
+ </div>
620
+ )
621
+ }
622
+ \`\`\``,
623
+ vue: `
624
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
625
+ 3. INSTALLATION STEPS — Run these in order
626
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
627
+ STEP 1 — Install the SDK and admin packages
628
+ \`\`\`bash
629
+ npm install @dyrected/sdk @dyrected/admin
630
+ \`\`\`
631
+
632
+ STEP 2 — Set up the client (lib/dyrected.ts):
633
+ \`\`\`ts
634
+ import { createClient } from '@dyrected/sdk'
635
+
636
+ export const dyrected = createClient({
637
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
638
+ ? ""
639
+ : `
640
+ apiKey: '${config.apiKey}',
641
+ siteId: '${config.siteId}',`}
642
+ })
643
+ \`\`\`
644
+
645
+ STEP 3 — Mount the Admin UI (pages/cms.vue):
646
+ \`\`\`vue
647
+ <template>
648
+ <div ref="container" style="height: 100vh" />
649
+ </template>
650
+
651
+ <script setup>
652
+ import { ref, onMounted, onUnmounted } from 'vue'
653
+ import { renderAdminUI } from '@dyrected/admin'
654
+ import '@dyrected/admin/styles'
655
+
656
+ const container = ref(null)
657
+ let cleanup
658
+
659
+ onMounted(() => {
660
+ cleanup = renderAdminUI(container.value, {
661
+ baseUrl: '${config.baseUrl || "https://api.dyrected.cloud"}',${isSelfHosted
662
+ ? ""
663
+ : `
664
+ apiKey: '${config.apiKey}',
665
+ siteId: '${config.siteId}',`}
666
+ })
667
+ })
668
+
669
+ onUnmounted(() => cleanup?.())
670
+ </script>
671
+ \`\`\``,
672
+ };
673
+ return [
674
+ `You are a friendly technical assistant helping someone set up Dyrected CMS for the very first time in a ${frameworkLabel} project. They have NOT installed anything yet.
675
+
676
+ Your job is to:
677
+ 1. Understand who you are talking to before giving any instructions
678
+ 2. Ask simple questions about their project and content needs
679
+ 3. Walk them through setup in a way that matches their technical level
680
+ 4. Confirm each step worked before moving to the next
681
+ 5. Help them design their content so their client can manage it
682
+
683
+ Speak in plain language at all times. Never assume technical knowledge.
684
+ Never show more than one step at a time.
685
+ Never mention the terminal, command line, or any commands until you have
686
+ confirmed the user is comfortable running them.`,
687
+ `
688
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
689
+ 1. ENVIRONMENT
690
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
691
+ - Framework : ${frameworkLabel}
692
+ - Host Type : ${isSelfHosted ? "Self-Hosted" : "Dyrected Cloud"}
693
+ - API Base : ${config.baseUrl || "http://localhost:3000"}
694
+ ${isSelfHosted ? "" : `- Site ID : ${config.siteId}\n- API Key : ${config.apiKey}`}`.trim(),
695
+ `
696
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
697
+ 2. PHASE 0 — UNDERSTAND THE USER FIRST
698
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
699
+ Ask these questions one at a time. Wait for each answer before asking the next.
700
+ Never ask more than one question at a time.
701
+
702
+ ─── QUESTION 1 — TECH LEVEL ───
703
+ This is the most important question. Ask it first.
704
+
705
+ Ask exactly this:
706
+ "Before we dive in — how would you describe yourself?
707
+
708
+ A) I write code myself (I'm comfortable with the terminal and editing files)
709
+ B) I use tools like Lovable, Bolt, or v0 to build with AI — I don't write much code myself
710
+ C) I'm a designer or project manager — someone else usually handles the technical stuff
711
+ D) Something else — just describe how you work"
712
+
713
+ Use their answer to decide how to guide them for the rest of the setup:
714
+ - If A → they are TECHNICAL. You may show terminal commands and code directly.
715
+ - If B → they are SEMI-TECHNICAL. Explain what each step does before showing
716
+ any code or commands. Ask before running anything in the terminal.
717
+ For Lovable users specifically: guide them to use the built-in
718
+ terminal or ask them to paste code into the right file in their editor.
719
+ - If C → they are NON-TECHNICAL. Do not show terminal commands at all.
720
+ Generate all the code and config for them. Walk them through
721
+ copy-pasting into specific files by name. If a terminal step is
722
+ unavoidable, warn them first and offer to write the exact command
723
+ with a clear explanation of what it does and where to run it.
724
+ - If D → ask one follow-up question to understand their workflow before
725
+ deciding which path above fits best.
726
+
727
+ ─── QUESTION 2 — PROJECT STATUS ───
728
+ Ask after Q1 is answered:
729
+
730
+ "Do you already have a ${frameworkLabel} project open,
731
+ or are we starting from scratch?
732
+
733
+ → Already have a project: tell me what the site is about or
734
+ share the folder name
735
+ → Starting fresh: just say 'new project' and I will help you
736
+ create one first"
737
+
738
+ ─── QUESTION 3 — SITE PURPOSE ───
739
+ Ask after Q2 is answered:
740
+
741
+ "What kind of website is this?
742
+
743
+ A) A business or agency site (show services, get enquiries)
744
+ B) A blog or news site (publish articles regularly)
745
+ C) A SaaS or product landing page (features, pricing, sign up)
746
+ D) A portfolio (show work and past projects)
747
+ E) Something else — describe it in one sentence"
748
+
749
+ ─── QUESTION 4 — CONTENT NEEDS ───
750
+ Ask after Q3 is answered:
751
+
752
+ "What will your client need to update themselves — without calling you?
753
+
754
+ Some examples to help you think:
755
+ → Blog posts or news articles
756
+ → Team member profiles (name, photo, bio)
757
+ → Services or product descriptions
758
+ → Homepage text (headline, buttons, images)
759
+ → Testimonials or reviews
760
+ → FAQs
761
+ → Event listings or announcements
762
+
763
+ Just list the ones that apply. Or say 'not sure yet'
764
+ and we will figure it out together."
765
+
766
+ ─── AFTER ALL QUESTIONS ───
767
+ Once all four questions are answered:
768
+ 1. Summarise what you understood in plain English
769
+ 2. Ask the user to confirm before touching any code
770
+ 3. Then move to the installation steps using the correct path
771
+ for their tech level from Question 1`,
772
+ frameworkSetup[activeTab] || frameworkSetup.nuxt,
773
+ `
774
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
775
+ 4. AFTER INSTALLATION — CONTENT SETUP
776
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
777
+ Once the dashboard is confirmed working, help the user design their
778
+ content model in dyrected.config.ts based on what they told you in
779
+ Phase 0.
780
+
781
+ RULES for this phase:
782
+ - Use defineCollection and defineConfig from '@dyrected/core'
783
+ - Use client.collection(slug) only — never client.collections
784
+ - Always use initialData in all data fetches
785
+ - Use a catch-all pages collection for marketing-managed pages
786
+ - Use blocks for flexible page layouts
787
+ - Use type: 'relationship', relationTo: 'collectionSlug' for relations
788
+ - Never throw during render — fall back to initialData on errors
789
+ - All relationship fields must handle null gracefully
790
+
791
+ CONTENT SETUP DELIVERABLES — in this order:
792
+ 1. dyrected.config.ts — complete file based on their answers
793
+ 2. Catch-all page route for CMS-managed pages
794
+ 3. Block components list (names and fields only)
795
+ 4. One example fetch showing how to load content on a page
796
+
797
+ After delivering the config, tell the user to sync their schema.
798
+ For TECHNICAL users show the command directly:
799
+ \`\`\`bash
800
+ npx @dyrected/cli sync:schema
801
+ \`\`\`
802
+ For SEMI-TECHNICAL or NON-TECHNICAL users explain it first:
803
+ "This next step tells Dyrected to read your content setup file
804
+ and prepare the database. Here is the command to run:" then show it.
805
+
806
+ Then ask: "Do you want me to help you connect this content to your
807
+ frontend pages now?"
808
+
809
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
810
+ DO NOT
811
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
812
+ - Do NOT show terminal commands before confirming the user's tech level
813
+ - Do NOT assume the user knows what a terminal, CLI, or package manager is
814
+ - Do NOT show all steps at once — one step at a time always
815
+ - Do NOT use client.collections — use client.collection(slug)
816
+ - Do NOT add custom auth middleware to the admin route
817
+ - Do NOT use renderAdminUI in a Nuxt.js project
818
+ - Do NOT skip the confirmation after each installation step
819
+ - Do NOT use jargon without explaining it in plain English first
820
+ - Do NOT assume the installation worked — ask the user to confirm
821
+
822
+ API Reference: https://docs.dyrected.com
823
+ If you are unsure about any syntax, refer to the official documentation above.`,
824
+ ].join("\n");
825
+ }
826
+ // ─────────────────────────────────────────────
827
+ // Main export
828
+ // ─────────────────────────────────────────────
829
+ export function generateAIPrompt(activeTab, config) {
830
+ const frameworkLabel = activeTab === "next"
831
+ ? "Next.js"
832
+ : activeTab === "nuxt"
833
+ ? "Nuxt.js"
834
+ : activeTab
835
+ ? activeTab.charAt(0).toUpperCase() + activeTab.slice(1)
836
+ : "the project's detected framework";
837
+ const isSelfHosted = config.isSelfHosted === true || (!config.apiKey && !config.siteId);
838
+ const existingSite = config.existingSite ?? false;
839
+ const missionText = existingSite
840
+ ? `You are a Senior Content Architect. Your mission is to integrate Dyrected CMS into an EXISTING ${frameworkLabel} project. Your absolute priority is DATA PRESERVATION and MIGRATION of existing hardcoded content into a flexible, blocks-based schema that empowers marketing teams to move independently.`
841
+ : `You are a Senior Content Architect. Your mission is to integrate Dyrected CMS into a NEW ${frameworkLabel} project. Your priority is DATA PRESERVATION and creating a CMS that empowers marketing teams to move independently without raising tickets to engineering.`;
842
+ const sections = [
843
+ missionText,
844
+ buildEnvironmentSection(frameworkLabel, isSelfHosted, config),
845
+ buildDiagnosticSection(),
846
+ buildConstraintsSection(),
847
+ buildSchemaRulesSection(),
848
+ buildDoNotSection(),
849
+ buildTechnicalReferenceSection(),
850
+ buildDeliverablesSection(),
851
+ buildFrameworkSection(activeTab, isSelfHosted, config),
852
+ ];
853
+ return sections.join("\n");
854
+ }
855
+ //# sourceMappingURL=setup-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-prompt.js","sourceRoot":"","sources":["../../src/utils/setup-prompt.ts"],"names":[],"mappings":"AASA,gDAAgD;AAChD,mBAAmB;AACnB,gDAAgD;AAEhD,SAAS,uBAAuB,CAC9B,cAAkC,EAClC,YAAqB,EACrB,MAAyB;IAEzB,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,MAAM,CAAC,MAAM,kBAAkB,MAAM,CAAC,MAAM,EAAE,CAAC;IAE3G,OAAO;;;;gBAIO,cAAc,IAAI,WAAW;gBAC7B,YAAY,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,0BAA0B;gBAChF,MAAM,CA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,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAExF,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,KAAK,CAAC;IAElD,MAAM,WAAW,GAAG,YAAY;QAC9B,CAAC,CAAC,kGAAkG,cAAc,6LAA6L;QAC/S,CAAC,CAAC,4FAA4F,cAAc,6JAA6J,CAAC;IAE5Q,MAAM,QAAQ,GAAG;QACf,WAAW;QACX,uBAAuB,CAAC,cAAc,EAAE,YAAY,EAAE,MAAM,CAAC;QAC7D,sBAAsB,EAAE;QACxB,uBAAuB,EAAE;QACzB,uBAAuB,EAAE;QACzB,iBAAiB,EAAE;QACnB,8BAA8B,EAAE;QAChC,wBAAwB,EAAE;QAC1B,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC;KACvD,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function stringify(obj: any, prefix?: string): string;
2
+ export declare function stringifyQuery(obj: any, options?: {
3
+ addQueryPrefix?: boolean;
4
+ }): string;
5
+ //# sourceMappingURL=stringify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../src/utils/stringify.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,SAAK,GAAG,MAAM,CAgCvD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAMvF"}
@@ -0,0 +1,41 @@
1
+ export function stringify(obj, prefix = "") {
2
+ if (obj === null || obj === undefined) {
3
+ return "";
4
+ }
5
+ const pairs = [];
6
+ for (const key in obj) {
7
+ if (!Object.prototype.hasOwnProperty.call(obj, key))
8
+ continue;
9
+ const value = obj[key];
10
+ const enKey = prefix ? `${prefix}[${encodeURIComponent(key)}]` : encodeURIComponent(key);
11
+ if (value === null || value === undefined) {
12
+ continue;
13
+ }
14
+ else if (Array.isArray(value)) {
15
+ for (let i = 0; i < value.length; i++) {
16
+ const val = value[i];
17
+ if (typeof val === "object" && val !== null) {
18
+ pairs.push(stringify(val, `${enKey}[${i}]`));
19
+ }
20
+ else if (val !== null && val !== undefined) {
21
+ pairs.push(`${enKey}[${i}]=${encodeURIComponent(val)}`);
22
+ }
23
+ }
24
+ }
25
+ else if (typeof value === "object") {
26
+ pairs.push(stringify(value, enKey));
27
+ }
28
+ else {
29
+ pairs.push(`${enKey}=${encodeURIComponent(value)}`);
30
+ }
31
+ }
32
+ return pairs.filter(Boolean).join("&");
33
+ }
34
+ export function stringifyQuery(obj, options) {
35
+ const result = stringify(obj);
36
+ if (options?.addQueryPrefix && result) {
37
+ return `?${result}`;
38
+ }
39
+ return result;
40
+ }
41
+ //# sourceMappingURL=stringify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify.js","sourceRoot":"","sources":["../../src/utils/stringify.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,GAAQ,EAAE,MAAM,GAAG,EAAE;IAC7C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;YAAE,SAAS;QAE9D,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CA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O,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC;QACtC,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/sdk",
3
- "version": "2.5.25",
3
+ "version": "2.5.27",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -30,7 +30,7 @@
30
30
  "tsup": "^8.5.1",
31
31
  "typescript": "^5.4.5",
32
32
  "vitest": "^1.0.0",
33
- "@dyrected/core": "2.5.25"
33
+ "@dyrected/core": "2.5.27"
34
34
  },
35
35
  "license": "BSL-1.1",
36
36
  "author": "Busola Okeowo <busolaokemoney@gmail.com>",