create-cogenta 0.0.3 → 0.1.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 (99) hide show
  1. package/LICENSE +373 -0
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +17 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/blueprints/association.d.ts +73 -0
  7. package/dist/blueprints/association.d.ts.map +1 -0
  8. package/dist/blueprints/association.js +176 -0
  9. package/dist/blueprints/association.js.map +1 -0
  10. package/dist/blueprints/blog.d.ts +211 -0
  11. package/dist/blueprints/blog.d.ts.map +1 -0
  12. package/dist/blueprints/blog.js +303 -0
  13. package/dist/blueprints/blog.js.map +1 -0
  14. package/dist/blueprints/content-pack.d.ts +54 -0
  15. package/dist/blueprints/content-pack.d.ts.map +1 -0
  16. package/dist/blueprints/content-pack.js +40 -0
  17. package/dist/blueprints/content-pack.js.map +1 -0
  18. package/dist/blueprints/content-packs.d.ts +10 -0
  19. package/dist/blueprints/content-packs.d.ts.map +1 -0
  20. package/dist/blueprints/content-packs.js +26 -0
  21. package/dist/blueprints/content-packs.js.map +1 -0
  22. package/dist/blueprints/documentation.d.ts +71 -0
  23. package/dist/blueprints/documentation.d.ts.map +1 -0
  24. package/dist/blueprints/documentation.js +153 -0
  25. package/dist/blueprints/documentation.js.map +1 -0
  26. package/dist/blueprints/magazine.d.ts +79 -0
  27. package/dist/blueprints/magazine.d.ts.map +1 -0
  28. package/dist/blueprints/magazine.js +163 -0
  29. package/dist/blueprints/magazine.js.map +1 -0
  30. package/dist/blueprints/portfolio.d.ts +73 -0
  31. package/dist/blueprints/portfolio.d.ts.map +1 -0
  32. package/dist/blueprints/portfolio.js +171 -0
  33. package/dist/blueprints/portfolio.js.map +1 -0
  34. package/dist/blueprints/registry.d.ts +23 -0
  35. package/dist/blueprints/registry.d.ts.map +1 -0
  36. package/dist/blueprints/registry.js +42 -0
  37. package/dist/blueprints/registry.js.map +1 -0
  38. package/dist/blueprints/restaurant.d.ts +79 -0
  39. package/dist/blueprints/restaurant.d.ts.map +1 -0
  40. package/dist/blueprints/restaurant.js +175 -0
  41. package/dist/blueprints/restaurant.js.map +1 -0
  42. package/dist/blueprints/saas.d.ts +66 -0
  43. package/dist/blueprints/saas.d.ts.map +1 -0
  44. package/dist/blueprints/saas.js +165 -0
  45. package/dist/blueprints/saas.js.map +1 -0
  46. package/dist/blueprints/vitrine.d.ts +100 -0
  47. package/dist/blueprints/vitrine.d.ts.map +1 -0
  48. package/dist/blueprints/vitrine.js +214 -0
  49. package/dist/blueprints/vitrine.js.map +1 -0
  50. package/dist/config-file.d.ts +13 -0
  51. package/dist/config-file.d.ts.map +1 -0
  52. package/dist/config-file.js +93 -0
  53. package/dist/config-file.js.map +1 -0
  54. package/dist/environment.d.ts +27 -0
  55. package/dist/environment.d.ts.map +1 -0
  56. package/dist/environment.js +91 -0
  57. package/dist/environment.js.map +1 -0
  58. package/dist/index.d.ts +37 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +79 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/llm-setup.d.ts +39 -0
  63. package/dist/llm-setup.d.ts.map +1 -0
  64. package/dist/llm-setup.js +47 -0
  65. package/dist/llm-setup.js.map +1 -0
  66. package/dist/playground-reset.d.ts +27 -0
  67. package/dist/playground-reset.d.ts.map +1 -0
  68. package/dist/playground-reset.js +40 -0
  69. package/dist/playground-reset.js.map +1 -0
  70. package/dist/prompts.d.ts +30 -0
  71. package/dist/prompts.d.ts.map +1 -0
  72. package/dist/prompts.js +63 -0
  73. package/dist/prompts.js.map +1 -0
  74. package/dist/recap.d.ts +19 -0
  75. package/dist/recap.d.ts.map +1 -0
  76. package/dist/recap.js +74 -0
  77. package/dist/recap.js.map +1 -0
  78. package/dist/scaffold.d.ts +49 -0
  79. package/dist/scaffold.d.ts.map +1 -0
  80. package/dist/scaffold.js +170 -0
  81. package/dist/scaffold.js.map +1 -0
  82. package/dist/skin-flow.d.ts +35 -0
  83. package/dist/skin-flow.d.ts.map +1 -0
  84. package/dist/skin-flow.js +56 -0
  85. package/dist/skin-flow.js.map +1 -0
  86. package/dist/skin-preview.d.ts +8 -0
  87. package/dist/skin-preview.d.ts.map +1 -0
  88. package/dist/skin-preview.js +130 -0
  89. package/dist/skin-preview.js.map +1 -0
  90. package/dist/types.d.ts +19 -0
  91. package/dist/types.d.ts.map +1 -0
  92. package/dist/types.js +13 -0
  93. package/dist/types.js.map +1 -0
  94. package/dist/wizard.d.ts +17 -0
  95. package/dist/wizard.d.ts.map +1 -0
  96. package/dist/wizard.js +157 -0
  97. package/dist/wizard.js.map +1 -0
  98. package/package.json +44 -5
  99. package/README.md +0 -39
@@ -0,0 +1,211 @@
1
+ import type { VocabularyBlock } from '@cogenta/blocks';
2
+ import { type CollectionDefinition, type RichTextDocument } from '@cogenta/schema';
3
+ import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
4
+ /**
5
+ * The `blog` blueprint's content model (L9 task 3).
6
+ *
7
+ * `post` reuses `SystemFields.status`/`createdAt` for publish state and
8
+ * publish date rather than declaring its own — contract A already carries
9
+ * both on every entry. Authorship reuses `SystemFields.createdBy`, which
10
+ * points at the real user/actor system, rather than a separate author
11
+ * collection this blueprint would have to invent and keep in sync.
12
+ */
13
+ export declare const category: {
14
+ readonly name: "category";
15
+ readonly labels: {
16
+ readonly singular: "Category";
17
+ readonly plural: "Categories";
18
+ };
19
+ readonly routing: {
20
+ readonly pattern: "/blog/category/:slug";
21
+ };
22
+ readonly fields: {
23
+ name: import("@cogenta/schema").FieldDefinition & {
24
+ readonly kind: "text";
25
+ readonly options: Readonly<Record<string, unknown>>;
26
+ };
27
+ slug: import("@cogenta/schema").FieldDefinition & {
28
+ readonly kind: "slug";
29
+ readonly options: Readonly<Record<string, unknown>>;
30
+ };
31
+ };
32
+ readonly indexes: readonly [readonly ["slug"]];
33
+ readonly permissions: {
34
+ readonly read: readonly ["public"];
35
+ readonly create: readonly ["editor", "admin"];
36
+ readonly update: readonly ["editor", "admin"];
37
+ readonly delete: readonly ["admin"];
38
+ };
39
+ };
40
+ export declare const tag: {
41
+ readonly name: "tag";
42
+ readonly labels: {
43
+ readonly singular: "Tag";
44
+ readonly plural: "Tags";
45
+ };
46
+ readonly fields: {
47
+ name: import("@cogenta/schema").FieldDefinition & {
48
+ readonly kind: "text";
49
+ readonly options: Readonly<Record<string, unknown>>;
50
+ };
51
+ slug: import("@cogenta/schema").FieldDefinition & {
52
+ readonly kind: "slug";
53
+ readonly options: Readonly<Record<string, unknown>>;
54
+ };
55
+ };
56
+ readonly indexes: readonly [readonly ["slug"]];
57
+ readonly permissions: {
58
+ readonly read: readonly ["public"];
59
+ readonly create: readonly ["editor", "admin"];
60
+ readonly update: readonly ["editor", "admin"];
61
+ readonly delete: readonly ["admin"];
62
+ };
63
+ };
64
+ export declare const post: {
65
+ readonly name: "post";
66
+ readonly labels: {
67
+ readonly singular: "Post";
68
+ readonly plural: "Posts";
69
+ };
70
+ readonly routing: {
71
+ readonly pattern: "/blog/:slug";
72
+ };
73
+ readonly versioning: {
74
+ readonly drafts: true;
75
+ readonly history: true;
76
+ };
77
+ readonly fields: {
78
+ title: import("@cogenta/schema").FieldDefinition & {
79
+ readonly kind: "text";
80
+ readonly options: Readonly<Record<string, unknown>>;
81
+ };
82
+ slug: import("@cogenta/schema").FieldDefinition & {
83
+ readonly kind: "slug";
84
+ readonly options: Readonly<Record<string, unknown>>;
85
+ };
86
+ excerpt: import("@cogenta/schema").FieldDefinition & {
87
+ readonly kind: "text";
88
+ readonly options: Readonly<Record<string, unknown>>;
89
+ };
90
+ body: import("@cogenta/schema").FieldDefinition & {
91
+ readonly kind: "richText";
92
+ readonly options: {};
93
+ };
94
+ coverImage: import("@cogenta/schema").FieldDefinition & {
95
+ readonly kind: "media";
96
+ readonly options: {
97
+ accept: readonly ("audio" | "file" | "image" | "video")[];
98
+ many: boolean;
99
+ };
100
+ };
101
+ category: import("@cogenta/schema").FieldDefinition & {
102
+ readonly kind: "relation";
103
+ readonly options: {
104
+ to: string;
105
+ many: boolean;
106
+ onDelete: import("@cogenta/schema").OnDelete;
107
+ };
108
+ };
109
+ tags: import("@cogenta/schema").FieldDefinition & {
110
+ readonly kind: "relation";
111
+ readonly options: {
112
+ to: string;
113
+ many: boolean;
114
+ onDelete: import("@cogenta/schema").OnDelete;
115
+ };
116
+ };
117
+ };
118
+ readonly indexes: readonly [readonly ["slug"]];
119
+ readonly permissions: {
120
+ readonly read: readonly ["public"];
121
+ readonly create: readonly ["editor", "admin"];
122
+ readonly update: readonly ["editor", "admin"];
123
+ readonly delete: readonly ["admin"];
124
+ readonly publish: readonly ["admin"];
125
+ };
126
+ };
127
+ /**
128
+ * The blueprint's "page types" (L9 task 4): standalone pages composed of
129
+ * vocabulary blocks rather than a bespoke template each — the same
130
+ * title-plus-block-zone shape `theme-canonical`'s own test fixtures already
131
+ * use for `{ collection: 'page', id: … }` internal-link targets, formalised
132
+ * here as a real `CollectionDefinition` for the first time. `blocks` uses
133
+ * `f.blocks()` (contract A), the field kind a `BlockZone` — an ordered list of
134
+ * vocabulary blocks — is stored under; `renderPage` (`@cogenta/theme-canonical`)
135
+ * takes exactly a title plus that list.
136
+ */
137
+ export declare const page: {
138
+ readonly name: "page";
139
+ readonly labels: {
140
+ readonly singular: "Page";
141
+ readonly plural: "Pages";
142
+ };
143
+ readonly routing: {
144
+ readonly pattern: "/:slug";
145
+ };
146
+ readonly fields: {
147
+ title: import("@cogenta/schema").FieldDefinition & {
148
+ readonly kind: "text";
149
+ readonly options: Readonly<Record<string, unknown>>;
150
+ };
151
+ slug: import("@cogenta/schema").FieldDefinition & {
152
+ readonly kind: "slug";
153
+ readonly options: Readonly<Record<string, unknown>>;
154
+ };
155
+ blocks: import("@cogenta/schema").FieldDefinition & {
156
+ readonly kind: "blocks";
157
+ readonly options: {
158
+ allow: "*" | readonly string[];
159
+ };
160
+ };
161
+ };
162
+ readonly indexes: readonly [readonly ["slug"]];
163
+ readonly permissions: {
164
+ readonly read: readonly ["public"];
165
+ readonly create: readonly ["editor", "admin"];
166
+ readonly update: readonly ["editor", "admin"];
167
+ readonly delete: readonly ["admin"];
168
+ };
169
+ };
170
+ /**
171
+ * Also the export written into the scaffolded site's `cogenta.schema.mjs`
172
+ * (`scaffold.ts`), so `loadCollections` (`@cogenta/cli`) reads back exactly
173
+ * these four collections.
174
+ */
175
+ export declare const BLOG_COLLECTIONS: readonly CollectionDefinition[];
176
+ export interface BlogDemoCategory {
177
+ readonly name: string;
178
+ readonly slug: string;
179
+ }
180
+ export interface BlogDemoTag {
181
+ readonly name: string;
182
+ readonly slug: string;
183
+ }
184
+ export interface BlogDemoPost {
185
+ readonly title: string;
186
+ readonly slug: string;
187
+ readonly excerpt: string;
188
+ readonly body: RichTextDocument;
189
+ readonly categorySlug: string;
190
+ readonly tagSlugs: readonly string[];
191
+ }
192
+ export declare const BLOG_DEMO_CATEGORIES: readonly BlogDemoCategory[];
193
+ export declare const BLOG_DEMO_TAGS: readonly BlogDemoTag[];
194
+ export declare const BLOG_DEMO_POSTS: readonly BlogDemoPost[];
195
+ export interface BlogDemoPage {
196
+ readonly title: string;
197
+ readonly slug: string;
198
+ readonly blocks: readonly VocabularyBlock[];
199
+ }
200
+ /**
201
+ * `home` and `about` — the two demo pages a freshly scaffolded blog needs so
202
+ * its front page is not the empty admin screen. `home` pairs a `hero` with a
203
+ * `collectionList` scoped to `post`, both part of the frozen block vocabulary
204
+ * (contract B) and both already rendered generically by
205
+ * `@cogenta/theme-canonical`'s `renderPage`/`renderBlock` — no bespoke
206
+ * "home page" or "about page" template is needed for either.
207
+ */
208
+ export declare const BLOG_DEMO_PAGES: readonly BlogDemoPage[];
209
+ export declare const BLOG_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
210
+ export declare const blogContentPack: BlueprintContentPack;
211
+ //# sourceMappingURL=blog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAgBD,eAAO,MAAM,oBAAoB,EAAE,SAAS,gBAAgB,EAG3D,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAIhD,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EA2DlD,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EA6DlD,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAWlE,CAAA;AA8DD,eAAO,MAAM,eAAe,EAAE,oBAI7B,CAAA"}
@@ -0,0 +1,303 @@
1
+ import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
2
+ import { toBlockZoneEntry, } from './content-pack.js';
3
+ /**
4
+ * The `blog` blueprint's content model (L9 task 3).
5
+ *
6
+ * `post` reuses `SystemFields.status`/`createdAt` for publish state and
7
+ * publish date rather than declaring its own — contract A already carries
8
+ * both on every entry. Authorship reuses `SystemFields.createdBy`, which
9
+ * points at the real user/actor system, rather than a separate author
10
+ * collection this blueprint would have to invent and keep in sync.
11
+ */
12
+ export const category = defineCollection({
13
+ name: 'category',
14
+ labels: { singular: 'Category', plural: 'Categories' },
15
+ routing: { pattern: '/blog/category/:slug' },
16
+ fields: {
17
+ name: f.text({ required: true, max: 80 }),
18
+ slug: f.slug({ from: 'name', unique: true }),
19
+ },
20
+ indexes: [['slug']],
21
+ permissions: {
22
+ read: ['public'],
23
+ create: ['editor', 'admin'],
24
+ update: ['editor', 'admin'],
25
+ delete: ['admin'],
26
+ },
27
+ });
28
+ export const tag = defineCollection({
29
+ name: 'tag',
30
+ labels: { singular: 'Tag', plural: 'Tags' },
31
+ fields: {
32
+ name: f.text({ required: true, max: 40 }),
33
+ slug: f.slug({ from: 'name', unique: true }),
34
+ },
35
+ indexes: [['slug']],
36
+ permissions: {
37
+ read: ['public'],
38
+ create: ['editor', 'admin'],
39
+ update: ['editor', 'admin'],
40
+ delete: ['admin'],
41
+ },
42
+ });
43
+ export const post = defineCollection({
44
+ name: 'post',
45
+ labels: { singular: 'Post', plural: 'Posts' },
46
+ routing: { pattern: '/blog/:slug' },
47
+ versioning: { drafts: true, history: true },
48
+ fields: {
49
+ title: f.text({ required: true, max: 200 }),
50
+ slug: f.slug({ from: 'title', unique: true }),
51
+ excerpt: f.text({ max: 300, multiline: true }),
52
+ body: f.richText({ required: true }),
53
+ coverImage: f.media({ accept: ['image'] }),
54
+ category: f.relation({ to: 'category', onDelete: 'setNull' }),
55
+ tags: f.relation({ to: 'tag', many: true, onDelete: 'cascade' }),
56
+ },
57
+ indexes: [['slug']],
58
+ permissions: {
59
+ read: ['public'],
60
+ create: ['editor', 'admin'],
61
+ update: ['editor', 'admin'],
62
+ delete: ['admin'],
63
+ publish: ['admin'],
64
+ },
65
+ });
66
+ /**
67
+ * The blueprint's "page types" (L9 task 4): standalone pages composed of
68
+ * vocabulary blocks rather than a bespoke template each — the same
69
+ * title-plus-block-zone shape `theme-canonical`'s own test fixtures already
70
+ * use for `{ collection: 'page', id: … }` internal-link targets, formalised
71
+ * here as a real `CollectionDefinition` for the first time. `blocks` uses
72
+ * `f.blocks()` (contract A), the field kind a `BlockZone` — an ordered list of
73
+ * vocabulary blocks — is stored under; `renderPage` (`@cogenta/theme-canonical`)
74
+ * takes exactly a title plus that list.
75
+ */
76
+ export const page = defineCollection({
77
+ name: 'page',
78
+ labels: { singular: 'Page', plural: 'Pages' },
79
+ routing: { pattern: '/:slug' },
80
+ fields: {
81
+ title: f.text({ required: true, max: 200 }),
82
+ slug: f.slug({ from: 'title', unique: true }),
83
+ blocks: f.blocks({ required: true }),
84
+ },
85
+ indexes: [['slug']],
86
+ permissions: {
87
+ read: ['public'],
88
+ create: ['editor', 'admin'],
89
+ update: ['editor', 'admin'],
90
+ delete: ['admin'],
91
+ },
92
+ });
93
+ /**
94
+ * Also the export written into the scaffolded site's `cogenta.schema.mjs`
95
+ * (`scaffold.ts`), so `loadCollections` (`@cogenta/cli`) reads back exactly
96
+ * these four collections.
97
+ */
98
+ export const BLOG_COLLECTIONS = [post, category, tag, page];
99
+ // Cross-collection checks (duplicate names, dangling relation targets) run
100
+ // at import time, same as `defineCollection` itself: a mistake here costs a
101
+ // restart, not a database.
102
+ validateCollectionSet(BLOG_COLLECTIONS);
103
+ let paragraphKey = 0;
104
+ /** One `normal`-style rich-text paragraph, unmarked. */
105
+ function paragraph(text) {
106
+ paragraphKey += 1;
107
+ return {
108
+ _key: `demo-${paragraphKey}`,
109
+ _type: 'block',
110
+ style: 'normal',
111
+ children: [{ _key: `demo-${paragraphKey}-span`, _type: 'span', text, marks: [] }],
112
+ markDefs: [],
113
+ };
114
+ }
115
+ export const BLOG_DEMO_CATEGORIES = [
116
+ { name: 'Announcements', slug: 'announcements' },
117
+ { name: 'Guides', slug: 'guides' },
118
+ ];
119
+ export const BLOG_DEMO_TAGS = [
120
+ { name: 'cms', slug: 'cms' },
121
+ { name: 'open source', slug: 'open-source' },
122
+ { name: 'agents', slug: 'agents' },
123
+ ];
124
+ export const BLOG_DEMO_POSTS = [
125
+ {
126
+ title: 'Welcome to Cogenta',
127
+ slug: 'welcome-to-cogenta',
128
+ excerpt: 'Cogenta is an open-source, agentic CMS: a site that monitors, patches and optimises itself, and reports what it did.',
129
+ body: [
130
+ paragraph('Cogenta is a content management system built around a simple idea: a site should be able to run ' +
131
+ 'itself. Under the hood it is a normal, dependable CMS — content types, drafts, versioning, media, ' +
132
+ 'multi-locale entries — with an agent runtime as a first-class part of the core rather than a ' +
133
+ 'bolted-on plugin.'),
134
+ paragraph('This post, and this blog, were scaffolded by create-cogenta as part of the "blog" blueprint: a ready ' +
135
+ 'content model, a skin, and a few real demo posts to look at instead of an empty admin screen.'),
136
+ ],
137
+ categorySlug: 'announcements',
138
+ tagSlugs: ['cms', 'open-source'],
139
+ },
140
+ {
141
+ title: 'What a blueprint actually gives you',
142
+ slug: 'what-a-blueprint-gives-you',
143
+ excerpt: 'A blueprint is not a theme. It is a content model, a skin, recommended agents and demo content, all at once — and every part of it can still be changed afterwards.',
144
+ body: [
145
+ paragraph('Picking the "blog" blueprint during setup creates three collections — post, category and tag — wires ' +
146
+ "up routing for a post list, a post page and a category archive, and applies the canonical theme's " +
147
+ 'default skin.'),
148
+ paragraph('None of that is a cage. The schema is a normal cogenta.schema.mjs file, the skin is a normal ' +
149
+ 'tokens.json, and both are meant to be edited the moment the defaults stop fitting.'),
150
+ ],
151
+ categorySlug: 'guides',
152
+ tagSlugs: ['cms'],
153
+ },
154
+ {
155
+ title: 'Agents recommended for a blog',
156
+ slug: 'agents-recommended-for-a-blog',
157
+ excerpt: 'The blog blueprint names two agents worth turning on — it does not turn them on for you.',
158
+ body: [
159
+ paragraph('No site in Cogenta runs a live agent scheduler by default (R2: the CMS works with zero AI configured). ' +
160
+ 'What the "blog" blueprint does instead is record a recommendation: seoAgent and contentAgent, both ' +
161
+ 'shipped in @cogenta/agents-builtin, are a reasonable pair to enable for a content-heavy site once an ' +
162
+ 'LLM provider is configured.'),
163
+ paragraph('Turning them on is a deliberate, separate step — not something a scaffold should decide on your behalf.'),
164
+ ],
165
+ categorySlug: 'guides',
166
+ tagSlugs: ['agents', 'open-source'],
167
+ },
168
+ ];
169
+ const BLOCK_VERSION = '1.0.0';
170
+ /**
171
+ * `home` and `about` — the two demo pages a freshly scaffolded blog needs so
172
+ * its front page is not the empty admin screen. `home` pairs a `hero` with a
173
+ * `collectionList` scoped to `post`, both part of the frozen block vocabulary
174
+ * (contract B) and both already rendered generically by
175
+ * `@cogenta/theme-canonical`'s `renderPage`/`renderBlock` — no bespoke
176
+ * "home page" or "about page" template is needed for either.
177
+ */
178
+ export const BLOG_DEMO_PAGES = [
179
+ {
180
+ title: 'Home',
181
+ slug: 'home',
182
+ blocks: [
183
+ {
184
+ _key: 'demo-home-hero',
185
+ _type: 'hero',
186
+ _version: BLOCK_VERSION,
187
+ eyebrow: 'Cogenta',
188
+ title: 'A blog that runs itself',
189
+ subtitle: 'Scaffolded by create-cogenta with real demo posts, categories and tags — every one of them editable the moment you sign in.',
190
+ actions: [
191
+ {
192
+ label: 'Read the latest post',
193
+ target: { href: '/blog/welcome-to-cogenta' },
194
+ emphasis: 'primary',
195
+ },
196
+ ],
197
+ },
198
+ {
199
+ _key: 'demo-home-recent-posts',
200
+ _type: 'collectionList',
201
+ _version: BLOCK_VERSION,
202
+ title: 'Latest posts',
203
+ collection: 'post',
204
+ // `publishedAt` is nullable (a draft has none) and was never in the
205
+ // real, frozen `SortField` union (`id`/`createdAt`/`updatedAt` only —
206
+ // cursor pagination needs a column that is never null). This block
207
+ // asked for it anyway and nothing exercised the query until
208
+ // `cogenta serve`'s theme-render fallback did, surfacing a real
209
+ // QUERY_INVALID on every request for the seeded home page.
210
+ sort: { field: 'createdAt', direction: 'desc' },
211
+ limit: 10,
212
+ layout: 'list',
213
+ },
214
+ ],
215
+ },
216
+ {
217
+ title: 'About',
218
+ slug: 'about',
219
+ blocks: [
220
+ {
221
+ _key: 'demo-about-prose',
222
+ _type: 'prose',
223
+ _version: BLOCK_VERSION,
224
+ body: [
225
+ paragraph('This is a demo blog, scaffolded by create-cogenta from the "blog" blueprint. Its posts, ' +
226
+ 'categories, tags and this very page were seeded by the installer so there is real content to ' +
227
+ 'look at from the first run, not an empty admin screen.'),
228
+ paragraph('Everything here — the schema, the content, the skin — is a normal part of the site and is meant ' +
229
+ 'to be edited, renamed or deleted the moment the defaults stop fitting.'),
230
+ ],
231
+ },
232
+ ],
233
+ },
234
+ ];
235
+ export const BLOG_RECOMMENDED_AGENTS = [
236
+ {
237
+ name: 'seoAgent',
238
+ package: '@cogenta/agents-builtin',
239
+ reason: 'Audits published posts for on-page SEO issues and internal-linking gaps.',
240
+ },
241
+ {
242
+ name: 'contentAgent',
243
+ package: '@cogenta/agents-builtin',
244
+ reason: 'Flags terminology drift and topic gaps across the post archive.',
245
+ },
246
+ ];
247
+ /**
248
+ * Inserts the `blog` blueprint's demo content through the real `ContentStore`
249
+ * — never mocked (house rule) — so a scaffolded blog blueprint has genuine
250
+ * rows to look at, not a claim that it does.
251
+ */
252
+ async function seedBlogDemoContent(db, defaultLocale, adminId) {
253
+ const categoryStore = createContentStore({ db, collection: category, defaultLocale });
254
+ const tagStore = createContentStore({ db, collection: tag, defaultLocale });
255
+ const postStore = createContentStore({ db, collection: post, defaultLocale });
256
+ const pageStore = createContentStore({ db, collection: page, defaultLocale });
257
+ const categoryIdBySlug = new Map();
258
+ for (const demo of BLOG_DEMO_CATEGORIES) {
259
+ const entry = await categoryStore.create({
260
+ status: 'published',
261
+ createdBy: adminId,
262
+ values: { name: demo.name, slug: demo.slug },
263
+ });
264
+ categoryIdBySlug.set(demo.slug, entry.id);
265
+ }
266
+ const tagIdBySlug = new Map();
267
+ for (const demo of BLOG_DEMO_TAGS) {
268
+ const entry = await tagStore.create({
269
+ status: 'published',
270
+ createdBy: adminId,
271
+ values: { name: demo.name, slug: demo.slug },
272
+ });
273
+ tagIdBySlug.set(demo.slug, entry.id);
274
+ }
275
+ for (const demo of BLOG_DEMO_POSTS) {
276
+ await postStore.create({
277
+ status: 'published',
278
+ createdBy: adminId,
279
+ values: {
280
+ title: demo.title,
281
+ slug: demo.slug,
282
+ excerpt: demo.excerpt,
283
+ body: demo.body,
284
+ category: categoryIdBySlug.get(demo.categorySlug) ?? null,
285
+ tags: demo.tagSlugs.map((slug) => tagIdBySlug.get(slug)).filter((id) => id !== undefined),
286
+ },
287
+ });
288
+ }
289
+ for (const demo of BLOG_DEMO_PAGES) {
290
+ await pageStore.create({
291
+ status: 'published',
292
+ createdBy: adminId,
293
+ values: { title: demo.title, slug: demo.slug },
294
+ blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
295
+ });
296
+ }
297
+ }
298
+ export const blogContentPack = {
299
+ collections: BLOG_COLLECTIONS,
300
+ recommendedAgents: BLOG_RECOMMENDED_AGENTS,
301
+ seedDemoContent: seedBlogDemoContent,
302
+ };
303
+ //# sourceMappingURL=blog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blog.js","sourceRoot":"","sources":["../../src/blueprints/blog.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAChB,CAAC,EAED,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGL,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IACvC,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE;IACtD,OAAO,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE;IAC5C,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KAC7C;IACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACnB,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,QAAQ,CAAC;QAChB,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,MAAM,EAAE,CAAC,OAAO,CAAC;KAClB;CAC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type CollectionDefinition } from '@cogenta/schema';
4
+ /**
5
+ * Names, and does not wire, an agent a blueprint recommends.
6
+ *
7
+ * No site anywhere in this codebase constructs a live `AgentRegistry` yet
8
+ * (see `Site.agentsRouter` in `@cogenta/cli`'s `serve.ts`) — R2 requires the
9
+ * CMS to work with no AI provider configured at all. Pretending to schedule
10
+ * an agent from the installer would be dishonest about what actually runs;
11
+ * naming it here is the scoped, truthful version of "agents préconfigurés"
12
+ * until a live scheduler exists somewhere to preconfigure.
13
+ */
14
+ export interface RecommendedAgentHint {
15
+ readonly name: string;
16
+ readonly package: string;
17
+ readonly reason: string;
18
+ }
19
+ export type SeedDemoContent = (db: DatabaseHandle, defaultLocale: string, adminId: string | null) => Promise<void>;
20
+ /**
21
+ * "Un blueprint = modèle de contenu + skin + agents préconfigurés + contenu
22
+ * de démo + pages types" (`docs/lots/L9-ecosysteme.md`). The skin is a
23
+ * separate, shared concern (`chooseSkin`, L9 task 7) — this is the part that
24
+ * differs per blueprint: its collections, the agents it recommends, and how
25
+ * it seeds its own demo content (including template pages, via
26
+ * `f.blocks()`) through the real `ContentStore`.
27
+ */
28
+ export interface BlueprintContentPack {
29
+ readonly collections: readonly CollectionDefinition[];
30
+ readonly recommendedAgents: readonly RecommendedAgentHint[];
31
+ readonly seedDemoContent: SeedDemoContent;
32
+ }
33
+ /**
34
+ * A `VocabularyBlock` (contract B: `_key`/`_type`/`_version` plus its own
35
+ * fields) as the block zone `f.blocks()` stores it: `key`/`type`/`data`,
36
+ * where `data` is everything but the three contract-B envelope fields.
37
+ * Shared by every blueprint that seeds a page with a `blocks` field.
38
+ */
39
+ export declare function toBlockZoneEntry(block: VocabularyBlock): {
40
+ key: string;
41
+ type: string;
42
+ data: Record<string, unknown>;
43
+ };
44
+ /**
45
+ * The "page types" shape every blueprint beyond `blog` needs (this is the
46
+ * third real usage of it, after `blog.ts`'s own hand-written `page` — see
47
+ * AGENTS.md "not before three real usages"): a title plus a block zone,
48
+ * routed generically. `blog.ts` keeps its own copy rather than being
49
+ * refactored to call this — it predates this helper and already has
50
+ * passing tests against its exact shape; duplication of one small,
51
+ * frozen-contract-shaped collection is cheaper than touching working code.
52
+ */
53
+ export declare function definePageCollection(routingPattern: string): CollectionDefinition;
54
+ //# sourceMappingURL=content-pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-pack.d.ts","sourceRoot":"","sources":["../../src/blueprints/content-pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,iBAAiB,CAAA;AAEhF;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,EAAE,EAAE,cAAc,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,GAAG,IAAI,KACnB,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACrD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3D,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG;IACxD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAGA;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,oBAAoB,CAkBjF"}
@@ -0,0 +1,40 @@
1
+ import { defineCollection, f } from '@cogenta/schema';
2
+ /**
3
+ * A `VocabularyBlock` (contract B: `_key`/`_type`/`_version` plus its own
4
+ * fields) as the block zone `f.blocks()` stores it: `key`/`type`/`data`,
5
+ * where `data` is everything but the three contract-B envelope fields.
6
+ * Shared by every blueprint that seeds a page with a `blocks` field.
7
+ */
8
+ export function toBlockZoneEntry(block) {
9
+ const { _key, _type, _version: _discard, ...data } = block;
10
+ return { key: _key, type: _type, data };
11
+ }
12
+ /**
13
+ * The "page types" shape every blueprint beyond `blog` needs (this is the
14
+ * third real usage of it, after `blog.ts`'s own hand-written `page` — see
15
+ * AGENTS.md "not before three real usages"): a title plus a block zone,
16
+ * routed generically. `blog.ts` keeps its own copy rather than being
17
+ * refactored to call this — it predates this helper and already has
18
+ * passing tests against its exact shape; duplication of one small,
19
+ * frozen-contract-shaped collection is cheaper than touching working code.
20
+ */
21
+ export function definePageCollection(routingPattern) {
22
+ return defineCollection({
23
+ name: 'page',
24
+ labels: { singular: 'Page', plural: 'Pages' },
25
+ routing: { pattern: routingPattern },
26
+ fields: {
27
+ title: f.text({ required: true, max: 200 }),
28
+ slug: f.slug({ from: 'title', unique: true }),
29
+ blocks: f.blocks({ required: true }),
30
+ },
31
+ indexes: [['slug']],
32
+ permissions: {
33
+ read: ['public'],
34
+ create: ['editor', 'admin'],
35
+ update: ['editor', 'admin'],
36
+ delete: ['admin'],
37
+ },
38
+ });
39
+ }
40
+ //# sourceMappingURL=content-pack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-pack.js","sourceRoot":"","sources":["../../src/blueprints/content-pack.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,gBAAgB,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAA;AAsChF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAsB;IAKrD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAAsB;IACzD,OAAO,gBAAgB,CAAC;QACtB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;QAC7C,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;QACpC,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;YAC3C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACrC;QACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QACnB,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC3B,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC3B,MAAM,EAAE,CAAC,OAAO,CAAC;SAClB;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BlueprintContentPack } from './content-pack.js';
2
+ /**
3
+ * Every blueprint beyond `blank` that has a real content pack, keyed by its
4
+ * `Blueprint.id` (`./registry.js`). Every blueprint listed in `BLUEPRINTS`
5
+ * now has one (L9 task 8, batch B) — `blank` remains the only one without,
6
+ * which is honest: it is the empty schema by design, never `resolveBlueprint`
7
+ * handing out an `available: false` blueprint.
8
+ */
9
+ export declare const BLUEPRINT_CONTENT_PACKS: Readonly<Record<string, BlueprintContentPack>>;
10
+ //# sourceMappingURL=content-packs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-packs.d.ts","sourceRoot":"","sources":["../../src/blueprints/content-packs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAQ7D;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CASlF,CAAA"}