create-cogenta 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/bin.d.ts +3 -0
  2. package/dist/bin.d.ts.map +1 -0
  3. package/dist/bin.js +17 -0
  4. package/dist/bin.js.map +1 -0
  5. package/dist/blueprints/association.d.ts +73 -0
  6. package/dist/blueprints/association.d.ts.map +1 -0
  7. package/dist/blueprints/association.js +176 -0
  8. package/dist/blueprints/association.js.map +1 -0
  9. package/dist/blueprints/blog.d.ts +211 -0
  10. package/dist/blueprints/blog.d.ts.map +1 -0
  11. package/dist/blueprints/blog.js +297 -0
  12. package/dist/blueprints/blog.js.map +1 -0
  13. package/dist/blueprints/content-pack.d.ts +54 -0
  14. package/dist/blueprints/content-pack.d.ts.map +1 -0
  15. package/dist/blueprints/content-pack.js +40 -0
  16. package/dist/blueprints/content-pack.js.map +1 -0
  17. package/dist/blueprints/content-packs.d.ts +10 -0
  18. package/dist/blueprints/content-packs.d.ts.map +1 -0
  19. package/dist/blueprints/content-packs.js +26 -0
  20. package/dist/blueprints/content-packs.js.map +1 -0
  21. package/dist/blueprints/documentation.d.ts +71 -0
  22. package/dist/blueprints/documentation.d.ts.map +1 -0
  23. package/dist/blueprints/documentation.js +153 -0
  24. package/dist/blueprints/documentation.js.map +1 -0
  25. package/dist/blueprints/magazine.d.ts +79 -0
  26. package/dist/blueprints/magazine.d.ts.map +1 -0
  27. package/dist/blueprints/magazine.js +163 -0
  28. package/dist/blueprints/magazine.js.map +1 -0
  29. package/dist/blueprints/portfolio.d.ts +73 -0
  30. package/dist/blueprints/portfolio.d.ts.map +1 -0
  31. package/dist/blueprints/portfolio.js +171 -0
  32. package/dist/blueprints/portfolio.js.map +1 -0
  33. package/dist/blueprints/registry.d.ts +23 -0
  34. package/dist/blueprints/registry.d.ts.map +1 -0
  35. package/dist/blueprints/registry.js +42 -0
  36. package/dist/blueprints/registry.js.map +1 -0
  37. package/dist/blueprints/restaurant.d.ts +79 -0
  38. package/dist/blueprints/restaurant.d.ts.map +1 -0
  39. package/dist/blueprints/restaurant.js +175 -0
  40. package/dist/blueprints/restaurant.js.map +1 -0
  41. package/dist/blueprints/saas.d.ts +66 -0
  42. package/dist/blueprints/saas.d.ts.map +1 -0
  43. package/dist/blueprints/saas.js +165 -0
  44. package/dist/blueprints/saas.js.map +1 -0
  45. package/dist/blueprints/vitrine.d.ts +100 -0
  46. package/dist/blueprints/vitrine.d.ts.map +1 -0
  47. package/dist/blueprints/vitrine.js +214 -0
  48. package/dist/blueprints/vitrine.js.map +1 -0
  49. package/dist/config-file.d.ts +13 -0
  50. package/dist/config-file.d.ts.map +1 -0
  51. package/dist/config-file.js +93 -0
  52. package/dist/config-file.js.map +1 -0
  53. package/dist/environment.d.ts +27 -0
  54. package/dist/environment.d.ts.map +1 -0
  55. package/dist/environment.js +91 -0
  56. package/dist/environment.js.map +1 -0
  57. package/dist/index.d.ts +37 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +79 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/llm-setup.d.ts +39 -0
  62. package/dist/llm-setup.d.ts.map +1 -0
  63. package/dist/llm-setup.js +47 -0
  64. package/dist/llm-setup.js.map +1 -0
  65. package/dist/playground-reset.d.ts +27 -0
  66. package/dist/playground-reset.d.ts.map +1 -0
  67. package/dist/playground-reset.js +40 -0
  68. package/dist/playground-reset.js.map +1 -0
  69. package/dist/prompts.d.ts +30 -0
  70. package/dist/prompts.d.ts.map +1 -0
  71. package/dist/prompts.js +63 -0
  72. package/dist/prompts.js.map +1 -0
  73. package/dist/recap.d.ts +19 -0
  74. package/dist/recap.d.ts.map +1 -0
  75. package/dist/recap.js +74 -0
  76. package/dist/recap.js.map +1 -0
  77. package/dist/scaffold.d.ts +49 -0
  78. package/dist/scaffold.d.ts.map +1 -0
  79. package/dist/scaffold.js +170 -0
  80. package/dist/scaffold.js.map +1 -0
  81. package/dist/skin-flow.d.ts +35 -0
  82. package/dist/skin-flow.d.ts.map +1 -0
  83. package/dist/skin-flow.js +56 -0
  84. package/dist/skin-flow.js.map +1 -0
  85. package/dist/skin-preview.d.ts +8 -0
  86. package/dist/skin-preview.d.ts.map +1 -0
  87. package/dist/skin-preview.js +130 -0
  88. package/dist/skin-preview.js.map +1 -0
  89. package/dist/types.d.ts +19 -0
  90. package/dist/types.d.ts.map +1 -0
  91. package/dist/types.js +13 -0
  92. package/dist/types.js.map +1 -0
  93. package/dist/wizard.d.ts +17 -0
  94. package/dist/wizard.d.ts.map +1 -0
  95. package/dist/wizard.js +157 -0
  96. package/dist/wizard.js.map +1 -0
  97. package/package.json +45 -6
  98. package/README.md +0 -39
@@ -0,0 +1,153 @@
1
+ import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
2
+ import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
3
+ /**
4
+ * The `documentation` blueprint's content model (L9 task 8, batch A):
5
+ * reference material, not marketing — the "pages types" are `docPage`
6
+ * entries themselves (ordered, grouped into sections), rather than a
7
+ * generic block-composed page for each one. A single `page` entry (`home`)
8
+ * still exists so the site root works and links into the docs, exactly
9
+ * like every other blueprint's landing page.
10
+ */
11
+ export const docPage = defineCollection({
12
+ name: 'doc_page',
13
+ labels: { singular: 'Doc page', plural: 'Doc pages' },
14
+ routing: { pattern: '/docs/:slug' },
15
+ fields: {
16
+ title: f.text({ required: true, max: 200 }),
17
+ slug: f.slug({ from: 'title', unique: true }),
18
+ section: f.text({ required: true, max: 80 }),
19
+ order: f.number({ required: true, integer: true, min: 0 }),
20
+ body: f.blocks({ required: true }),
21
+ },
22
+ indexes: [['slug'], ['section']],
23
+ permissions: {
24
+ read: ['public'],
25
+ create: ['editor', 'admin'],
26
+ update: ['editor', 'admin'],
27
+ delete: ['admin'],
28
+ },
29
+ });
30
+ export const page = definePageCollection('/:slug');
31
+ export const DOCUMENTATION_COLLECTIONS = [docPage, page];
32
+ validateCollectionSet(DOCUMENTATION_COLLECTIONS);
33
+ const BLOCK_VERSION = '1.0.0';
34
+ function proseParagraph(key, text) {
35
+ return {
36
+ _key: key,
37
+ _type: 'prose',
38
+ _version: BLOCK_VERSION,
39
+ body: [
40
+ {
41
+ _key: `${key}-block`,
42
+ _type: 'block',
43
+ style: 'normal',
44
+ children: [{ _key: `${key}-span`, _type: 'span', text, marks: [] }],
45
+ markDefs: [],
46
+ },
47
+ ],
48
+ };
49
+ }
50
+ export const DOCUMENTATION_DEMO_DOC_PAGES = [
51
+ {
52
+ title: 'Getting started',
53
+ slug: 'getting-started',
54
+ section: 'Guides',
55
+ order: 1,
56
+ body: [
57
+ proseParagraph('demo-doc-getting-started', 'This is a demo documentation site, scaffolded by create-cogenta from the "documentation" blueprint. Each doc page below was seeded by the installer so there is real content to look at from the first run.'),
58
+ ],
59
+ },
60
+ {
61
+ title: 'Configuration',
62
+ slug: 'configuration',
63
+ section: 'Guides',
64
+ order: 2,
65
+ body: [
66
+ proseParagraph('demo-doc-configuration', 'Doc pages are ordered within a section by the "order" field, and grouped by "section" — both normal, editable fields, not fixed navigation.'),
67
+ ],
68
+ },
69
+ {
70
+ title: 'API reference',
71
+ slug: 'api-reference',
72
+ section: 'Reference',
73
+ order: 1,
74
+ body: [
75
+ proseParagraph('demo-doc-api-reference', 'A separate section from the guides above, so a docs site can hold both narrative and reference material without one crowding out the other.'),
76
+ ],
77
+ },
78
+ ];
79
+ export const DOCUMENTATION_DEMO_PAGES = [
80
+ {
81
+ title: 'Home',
82
+ slug: 'home',
83
+ blocks: [
84
+ {
85
+ _key: 'demo-home-hero',
86
+ _type: 'hero',
87
+ _version: BLOCK_VERSION,
88
+ eyebrow: 'Documentation',
89
+ title: 'Everything documented, nothing hidden',
90
+ subtitle: 'Scaffolded by create-cogenta from the "documentation" blueprint, with real demo doc pages already in place.',
91
+ actions: [
92
+ {
93
+ label: 'Start reading',
94
+ target: { href: '/docs/getting-started' },
95
+ emphasis: 'primary',
96
+ },
97
+ ],
98
+ },
99
+ {
100
+ _key: 'demo-home-docs',
101
+ _type: 'collectionList',
102
+ _version: BLOCK_VERSION,
103
+ title: 'Doc pages',
104
+ collection: 'doc_page',
105
+ sort: { field: 'createdAt', direction: 'asc' },
106
+ limit: 20,
107
+ layout: 'list',
108
+ },
109
+ ],
110
+ },
111
+ ];
112
+ export const DOCUMENTATION_RECOMMENDED_AGENTS = [
113
+ {
114
+ name: 'contentAgent',
115
+ package: '@cogenta/agents-builtin',
116
+ reason: 'Flags terminology drift across doc pages, where consistent wording matters most.',
117
+ },
118
+ {
119
+ name: 'seoAgent',
120
+ package: '@cogenta/agents-builtin',
121
+ reason: 'Audits internal linking between doc pages so readers can navigate without the sidebar.',
122
+ },
123
+ ];
124
+ /**
125
+ * Inserts the `documentation` blueprint's demo content through the real
126
+ * `ContentStore` — never mocked (house rule).
127
+ */
128
+ async function seedDocumentationDemoContent(db, defaultLocale, adminId) {
129
+ const docPageStore = createContentStore({ db, collection: docPage, defaultLocale });
130
+ const pageStore = createContentStore({ db, collection: page, defaultLocale });
131
+ for (const demo of DOCUMENTATION_DEMO_DOC_PAGES) {
132
+ await docPageStore.create({
133
+ status: 'published',
134
+ createdBy: adminId,
135
+ values: { title: demo.title, slug: demo.slug, section: demo.section, order: demo.order },
136
+ blocks: { body: demo.body.map(toBlockZoneEntry) },
137
+ });
138
+ }
139
+ for (const demo of DOCUMENTATION_DEMO_PAGES) {
140
+ await pageStore.create({
141
+ status: 'published',
142
+ createdBy: adminId,
143
+ values: { title: demo.title, slug: demo.slug },
144
+ blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
145
+ });
146
+ }
147
+ }
148
+ export const documentationContentPack = {
149
+ collections: DOCUMENTATION_COLLECTIONS,
150
+ recommendedAgents: DOCUMENTATION_RECOMMENDED_AGENTS,
151
+ seedDemoContent: seedDocumentationDemoContent,
152
+ };
153
+ //# sourceMappingURL=documentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentation.js","sourceRoot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AE,CAAC,CAAA;IAE7E,KAAK,MAAM,IAAI,IAAI,4BAA4B,EAAE,CAAC;QAChD,MAAM,YAAY,CAAC,MAAM,CAAC;YACxB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;YACxF,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SAClD,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,wBAAwB,EAAE,CAAC;QAC5C,MAAM,SAAS,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;YAC9C,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAyB;IAC5D,WAAW,EAAE,yBAAyB;IACtC,iBAAiB,EAAE,gCAAgC;IACnD,eAAe,EAAE,4BAA4B;CAC9C,CAAA"}
@@ -0,0 +1,79 @@
1
+ import type { VocabularyBlock } from '@cogenta/blocks';
2
+ import { type CollectionDefinition } from '@cogenta/schema';
3
+ import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
4
+ /**
5
+ * The `magazine` blueprint's content model (L9 task 8, batch B): editorial
6
+ * content grouped into sections — one collection (`article`), one grouping
7
+ * field (`section`), rather than a separate category collection on top of
8
+ * it (`blog` already covers the "posts plus a real category collection"
9
+ * shape; a magazine's twist is section-grouped editorial, not another
10
+ * taxonomy).
11
+ */
12
+ export declare const article: {
13
+ readonly name: "article";
14
+ readonly labels: {
15
+ readonly singular: "Article";
16
+ readonly plural: "Articles";
17
+ };
18
+ readonly routing: {
19
+ readonly pattern: "/articles/:slug";
20
+ };
21
+ readonly fields: {
22
+ title: import("@cogenta/schema").FieldDefinition & {
23
+ readonly kind: "text";
24
+ readonly options: Readonly<Record<string, unknown>>;
25
+ };
26
+ slug: import("@cogenta/schema").FieldDefinition & {
27
+ readonly kind: "slug";
28
+ readonly options: Readonly<Record<string, unknown>>;
29
+ };
30
+ excerpt: import("@cogenta/schema").FieldDefinition & {
31
+ readonly kind: "text";
32
+ readonly options: Readonly<Record<string, unknown>>;
33
+ };
34
+ section: import("@cogenta/schema").FieldDefinition & {
35
+ readonly kind: "select";
36
+ readonly options: {
37
+ options: readonly import("@cogenta/schema").SelectChoice[];
38
+ many: boolean;
39
+ };
40
+ };
41
+ body: import("@cogenta/schema").FieldDefinition & {
42
+ readonly kind: "blocks";
43
+ readonly options: {
44
+ allow: "*" | readonly string[];
45
+ };
46
+ };
47
+ };
48
+ readonly indexes: readonly [readonly ["slug"], readonly ["section"]];
49
+ readonly permissions: {
50
+ readonly read: readonly ["public"];
51
+ readonly create: readonly ["editor", "admin"];
52
+ readonly update: readonly ["editor", "admin"];
53
+ readonly delete: readonly ["admin"];
54
+ readonly publish: readonly ["admin"];
55
+ };
56
+ };
57
+ export declare const page: CollectionDefinition;
58
+ export declare const MAGAZINE_COLLECTIONS: readonly CollectionDefinition[];
59
+ export interface MagazineDemoArticle {
60
+ readonly title: string;
61
+ readonly slug: string;
62
+ readonly excerpt: string;
63
+ readonly section: 'News' | 'Culture' | 'Opinion';
64
+ readonly body: readonly VocabularyBlock[];
65
+ }
66
+ export declare const MAGAZINE_DEMO_ARTICLES: readonly MagazineDemoArticle[];
67
+ export interface MagazineDemoPage {
68
+ readonly title: string;
69
+ readonly slug: string;
70
+ readonly blocks: readonly VocabularyBlock[];
71
+ }
72
+ /**
73
+ * `home` (hero + a live list of recent articles) and `about` (a short prose
74
+ * masthead note).
75
+ */
76
+ export declare const MAGAZINE_DEMO_PAGES: readonly MagazineDemoPage[];
77
+ export declare const MAGAZINE_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
78
+ export declare const magazineContentPack: BlueprintContentPack;
79
+ //# sourceMappingURL=magazine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magazine.d.ts","sourceRoot":"","sources":["../../src/blueprints/magazine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EACL,KAAK,oBAAoB,EAK1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;QAKhB,KAAK;;;;QACL,IAAI;;;;QACJ,OAAO;;;;QACP,OAAO;;;;;;;QACP,IAAI;;;;;;;;;;;;;;;CAUN,CAAA;AAEF,eAAO,MAAM,IAAI,sBAAiC,CAAA;AAElD,eAAO,MAAM,oBAAoB,EAAE,SAAS,oBAAoB,EAAoB,CAAA;AAuBpF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAA;CAC1C;AAED,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAqChE,CAAA;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAoC1D,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,SAAS,oBAAoB,EAWtE,CAAA;AAsCD,eAAO,MAAM,mBAAmB,EAAE,oBAIjC,CAAA"}
@@ -0,0 +1,163 @@
1
+ import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
2
+ import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
3
+ /**
4
+ * The `magazine` blueprint's content model (L9 task 8, batch B): editorial
5
+ * content grouped into sections — one collection (`article`), one grouping
6
+ * field (`section`), rather than a separate category collection on top of
7
+ * it (`blog` already covers the "posts plus a real category collection"
8
+ * shape; a magazine's twist is section-grouped editorial, not another
9
+ * taxonomy).
10
+ */
11
+ export const article = defineCollection({
12
+ name: 'article',
13
+ labels: { singular: 'Article', plural: 'Articles' },
14
+ routing: { pattern: '/articles/:slug' },
15
+ fields: {
16
+ title: f.text({ required: true, max: 200 }),
17
+ slug: f.slug({ from: 'title', unique: true }),
18
+ excerpt: f.text({ max: 300, multiline: true }),
19
+ section: f.select({ options: ['News', 'Culture', 'Opinion'], required: true }),
20
+ body: f.blocks({ required: true }),
21
+ },
22
+ indexes: [['slug'], ['section']],
23
+ permissions: {
24
+ read: ['public'],
25
+ create: ['editor', 'admin'],
26
+ update: ['editor', 'admin'],
27
+ delete: ['admin'],
28
+ publish: ['admin'],
29
+ },
30
+ });
31
+ export const page = definePageCollection('/:slug');
32
+ export const MAGAZINE_COLLECTIONS = [article, page];
33
+ validateCollectionSet(MAGAZINE_COLLECTIONS);
34
+ const BLOCK_VERSION = '1.0.0';
35
+ function proseParagraph(key, text) {
36
+ return {
37
+ _key: key,
38
+ _type: 'prose',
39
+ _version: BLOCK_VERSION,
40
+ body: [
41
+ {
42
+ _key: `${key}-block`,
43
+ _type: 'block',
44
+ style: 'normal',
45
+ children: [{ _key: `${key}-span`, _type: 'span', text, marks: [] }],
46
+ markDefs: [],
47
+ },
48
+ ],
49
+ };
50
+ }
51
+ export const MAGAZINE_DEMO_ARTICLES = [
52
+ {
53
+ title: 'A new season, a new lineup',
54
+ slug: 'a-new-season-a-new-lineup',
55
+ excerpt: 'What changed this quarter, and why it matters to readers.',
56
+ section: 'News',
57
+ body: [
58
+ proseParagraph('demo-article-1-p1', 'This is a demo magazine, scaffolded by create-cogenta from the "magazine" blueprint. Its articles were seeded by the installer so there is real content to look at from the first run.'),
59
+ ],
60
+ },
61
+ {
62
+ title: 'Three exhibitions worth the trip',
63
+ slug: 'three-exhibitions-worth-the-trip',
64
+ excerpt: 'A short, opinionated guide to what is showing this month.',
65
+ section: 'Culture',
66
+ body: [
67
+ proseParagraph('demo-article-2-p1', 'Articles are grouped by "section", a normal editable field, not a fixed navigation menu.'),
68
+ ],
69
+ },
70
+ {
71
+ title: 'Why the small stories matter most',
72
+ slug: 'why-the-small-stories-matter-most',
73
+ excerpt: "An editor's take on what gets left out of the bigger headlines.",
74
+ section: 'Opinion',
75
+ body: [
76
+ proseParagraph('demo-article-3-p1', 'Everything here — the schema, the content, the skin — is a normal part of the site and is meant to be edited, renamed or deleted the moment the defaults stop fitting.'),
77
+ ],
78
+ },
79
+ ];
80
+ /**
81
+ * `home` (hero + a live list of recent articles) and `about` (a short prose
82
+ * masthead note).
83
+ */
84
+ export const MAGAZINE_DEMO_PAGES = [
85
+ {
86
+ title: 'Home',
87
+ slug: 'home',
88
+ blocks: [
89
+ {
90
+ _key: 'demo-home-hero',
91
+ _type: 'hero',
92
+ _version: BLOCK_VERSION,
93
+ eyebrow: 'Magazine',
94
+ title: 'Stories worth your time',
95
+ subtitle: 'Scaffolded by create-cogenta from the "magazine" blueprint, with real demo articles already in place.',
96
+ },
97
+ {
98
+ _key: 'demo-home-articles',
99
+ _type: 'collectionList',
100
+ _version: BLOCK_VERSION,
101
+ title: 'Latest articles',
102
+ collection: 'article',
103
+ sort: { field: 'createdAt', direction: 'desc' },
104
+ limit: 10,
105
+ layout: 'list',
106
+ },
107
+ ],
108
+ },
109
+ {
110
+ title: 'About',
111
+ slug: 'about',
112
+ blocks: [
113
+ proseParagraph('demo-about-prose', 'This is a demo magazine, scaffolded by create-cogenta from the "magazine" blueprint. Its articles and this page were seeded by the installer so there is real content to look at from the first run.'),
114
+ ],
115
+ },
116
+ ];
117
+ export const MAGAZINE_RECOMMENDED_AGENTS = [
118
+ {
119
+ name: 'contentAgent',
120
+ package: '@cogenta/agents-builtin',
121
+ reason: 'Flags terminology drift and topic gaps across sections written by different editors.',
122
+ },
123
+ {
124
+ name: 'seoAgent',
125
+ package: '@cogenta/agents-builtin',
126
+ reason: 'Audits published articles for on-page SEO issues and internal-linking gaps.',
127
+ },
128
+ ];
129
+ /**
130
+ * Inserts the `magazine` blueprint's demo content through the real
131
+ * `ContentStore` — never mocked (house rule).
132
+ */
133
+ async function seedMagazineDemoContent(db, defaultLocale, adminId) {
134
+ const articleStore = createContentStore({ db, collection: article, defaultLocale });
135
+ const pageStore = createContentStore({ db, collection: page, defaultLocale });
136
+ for (const demo of MAGAZINE_DEMO_ARTICLES) {
137
+ await articleStore.create({
138
+ status: 'published',
139
+ createdBy: adminId,
140
+ values: {
141
+ title: demo.title,
142
+ slug: demo.slug,
143
+ excerpt: demo.excerpt,
144
+ section: demo.section,
145
+ },
146
+ blocks: { body: demo.body.map(toBlockZoneEntry) },
147
+ });
148
+ }
149
+ for (const demo of MAGAZINE_DEMO_PAGES) {
150
+ await pageStore.create({
151
+ status: 'published',
152
+ createdBy: adminId,
153
+ values: { title: demo.title, slug: demo.slug },
154
+ blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
155
+ });
156
+ }
157
+ }
158
+ export const magazineContentPack = {
159
+ collections: MAGAZINE_COLLECTIONS,
160
+ recommendedAgents: MAGAZINE_RECOMMENDED_AGENTS,
161
+ seedDemoContent: seedMagazineDemoContent,
162
+ };
163
+ //# sourceMappingURL=magazine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magazine.js","sourceRoot":"","sources":["../../src/blueprints/magazine.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAChB,CAAC,EACD,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEL,oBAAoB,EAEpB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;IACtC,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE;IACnD,OAAO,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;IACvC,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QAC3C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9E,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KACnC;IACD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAChC,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,QAAQ,CAAC;QAChB,MAAM,EAAE,CAAC,QAAQ,EA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AC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;IACnF,MAAM,SAAS,GAAG,kBAAkB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;IAE7E,KAAK,MAAM,IAAI,IAAI,sBAAsB,EAAE,CAAC;QAC1C,MAAM,YAAY,CAAC,MAAM,CAAC;YACxB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE;gBACN,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB;YACD,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SAClD,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,mBAAmB,EAAE,CAAC;QACvC,MAAM,SAAS,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;YAC9C,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;SACtD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,WAAW,EAAE,oBAAoB;IACjC,iBAAiB,EAAE,2BAA2B;IAC9C,eAAe,EAAE,uBAAuB;CACzC,CAAA"}
@@ -0,0 +1,73 @@
1
+ import type { VocabularyBlock } from '@cogenta/blocks';
2
+ import { type CollectionDefinition } from '@cogenta/schema';
3
+ import { type BlueprintContentPack, type RecommendedAgentHint } from './content-pack.js';
4
+ /**
5
+ * The `portfolio` blueprint's content model (L9 task 8, batch A): a
6
+ * freelance/creative portfolio — a `project` collection with its own
7
+ * routed page, and two demo pages.
8
+ */
9
+ export declare const project: {
10
+ readonly name: "project";
11
+ readonly labels: {
12
+ readonly singular: "Project";
13
+ readonly plural: "Projects";
14
+ };
15
+ readonly routing: {
16
+ readonly pattern: "/work/:slug";
17
+ };
18
+ readonly fields: {
19
+ title: import("@cogenta/schema").FieldDefinition & {
20
+ readonly kind: "text";
21
+ readonly options: Readonly<Record<string, unknown>>;
22
+ };
23
+ slug: import("@cogenta/schema").FieldDefinition & {
24
+ readonly kind: "slug";
25
+ readonly options: Readonly<Record<string, unknown>>;
26
+ };
27
+ summary: import("@cogenta/schema").FieldDefinition & {
28
+ readonly kind: "text";
29
+ readonly options: Readonly<Record<string, unknown>>;
30
+ };
31
+ role: import("@cogenta/schema").FieldDefinition & {
32
+ readonly kind: "text";
33
+ readonly options: Readonly<Record<string, unknown>>;
34
+ };
35
+ year: import("@cogenta/schema").FieldDefinition & {
36
+ readonly kind: "text";
37
+ readonly options: Readonly<Record<string, unknown>>;
38
+ };
39
+ };
40
+ readonly indexes: readonly [readonly ["slug"]];
41
+ readonly permissions: {
42
+ readonly read: readonly ["public"];
43
+ readonly create: readonly ["editor", "admin"];
44
+ readonly update: readonly ["editor", "admin"];
45
+ readonly delete: readonly ["admin"];
46
+ readonly publish: readonly ["admin"];
47
+ };
48
+ };
49
+ export declare const page: CollectionDefinition;
50
+ export declare const PORTFOLIO_COLLECTIONS: readonly CollectionDefinition[];
51
+ export interface PortfolioDemoProject {
52
+ readonly title: string;
53
+ readonly slug: string;
54
+ readonly summary: string;
55
+ readonly role: string;
56
+ readonly year: string;
57
+ }
58
+ export declare const PORTFOLIO_DEMO_PROJECTS: readonly PortfolioDemoProject[];
59
+ export interface PortfolioDemoPage {
60
+ readonly title: string;
61
+ readonly slug: string;
62
+ readonly blocks: readonly VocabularyBlock[];
63
+ }
64
+ /**
65
+ * `home` (hero + a live grid of projects) and `about` (a short prose bio
66
+ * plus a static `stats` summary — years of experience and projects
67
+ * delivered are page-authored numbers, not something to model as a
68
+ * separate queryable collection).
69
+ */
70
+ export declare const PORTFOLIO_DEMO_PAGES: readonly PortfolioDemoPage[];
71
+ export declare const PORTFOLIO_RECOMMENDED_AGENTS: readonly RecommendedAgentHint[];
72
+ export declare const portfolioContentPack: BlueprintContentPack;
73
+ //# sourceMappingURL=portfolio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../../src/blueprints/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EACL,KAAK,oBAAoB,EAK1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;GAIG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;QAKhB,KAAK;;;;QACL,IAAI;;;;QACJ,OAAO;;;;QACP,IAAI;;;;QACJ,IAAI;;;;;;;;;;;;;CAUN,CAAA;AAEF,eAAO,MAAM,IAAI,sBAAiC,CAAA;AAElD,eAAO,MAAM,qBAAqB,EAAE,SAAS,oBAAoB,EAAoB,CAAA;AAIrF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAwBlE,CAAA;AAID,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAC5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAgE5D,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,SAAS,oBAAoB,EAWvE,CAAA;AAsCD,eAAO,MAAM,oBAAoB,EAAE,oBAIlC,CAAA"}
@@ -0,0 +1,171 @@
1
+ import { createContentStore, defineCollection, f, validateCollectionSet, } from '@cogenta/schema';
2
+ import { definePageCollection, toBlockZoneEntry, } from './content-pack.js';
3
+ /**
4
+ * The `portfolio` blueprint's content model (L9 task 8, batch A): a
5
+ * freelance/creative portfolio — a `project` collection with its own
6
+ * routed page, and two demo pages.
7
+ */
8
+ export const project = defineCollection({
9
+ name: 'project',
10
+ labels: { singular: 'Project', plural: 'Projects' },
11
+ routing: { pattern: '/work/:slug' },
12
+ fields: {
13
+ title: f.text({ required: true, max: 200 }),
14
+ slug: f.slug({ from: 'title', unique: true }),
15
+ summary: f.text({ max: 300, multiline: true }),
16
+ role: f.text({ max: 120 }),
17
+ year: f.text({ max: 4 }),
18
+ },
19
+ indexes: [['slug']],
20
+ permissions: {
21
+ read: ['public'],
22
+ create: ['editor', 'admin'],
23
+ update: ['editor', 'admin'],
24
+ delete: ['admin'],
25
+ publish: ['admin'],
26
+ },
27
+ });
28
+ export const page = definePageCollection('/:slug');
29
+ export const PORTFOLIO_COLLECTIONS = [project, page];
30
+ validateCollectionSet(PORTFOLIO_COLLECTIONS);
31
+ export const PORTFOLIO_DEMO_PROJECTS = [
32
+ {
33
+ title: 'Northwind rebrand',
34
+ slug: 'northwind-rebrand',
35
+ summary: 'A full visual identity refresh for a regional grocery chain, from logotype to packaging.',
36
+ role: 'Art direction',
37
+ year: '2025',
38
+ },
39
+ {
40
+ title: 'Contoso mobile app',
41
+ slug: 'contoso-mobile-app',
42
+ summary: 'Interaction design and a component library for a fintech app used by two million people.',
43
+ role: 'Product design',
44
+ year: '2024',
45
+ },
46
+ {
47
+ title: 'Fabrikam annual report',
48
+ slug: 'fabrikam-annual-report',
49
+ summary: 'Editorial design for a 60-page annual report, printed and interactive.',
50
+ role: 'Editorial design',
51
+ year: '2023',
52
+ },
53
+ ];
54
+ const BLOCK_VERSION = '1.0.0';
55
+ /**
56
+ * `home` (hero + a live grid of projects) and `about` (a short prose bio
57
+ * plus a static `stats` summary — years of experience and projects
58
+ * delivered are page-authored numbers, not something to model as a
59
+ * separate queryable collection).
60
+ */
61
+ export const PORTFOLIO_DEMO_PAGES = [
62
+ {
63
+ title: 'Home',
64
+ slug: 'home',
65
+ blocks: [
66
+ {
67
+ _key: 'demo-home-hero',
68
+ _type: 'hero',
69
+ _version: BLOCK_VERSION,
70
+ eyebrow: 'Portfolio',
71
+ title: 'Selected work',
72
+ subtitle: 'Scaffolded by create-cogenta from the "portfolio" blueprint, with real demo projects already in place.',
73
+ },
74
+ {
75
+ _key: 'demo-home-projects',
76
+ _type: 'collectionList',
77
+ _version: BLOCK_VERSION,
78
+ title: 'Projects',
79
+ collection: 'project',
80
+ sort: { field: 'createdAt', direction: 'desc' },
81
+ limit: 10,
82
+ layout: 'grid',
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ title: 'About',
88
+ slug: 'about',
89
+ blocks: [
90
+ {
91
+ _key: 'demo-about-prose',
92
+ _type: 'prose',
93
+ _version: BLOCK_VERSION,
94
+ body: [
95
+ {
96
+ _key: 'demo-about-p1',
97
+ _type: 'block',
98
+ style: 'normal',
99
+ children: [
100
+ {
101
+ _key: 'demo-about-p1-span',
102
+ _type: 'span',
103
+ text: 'This is a demo portfolio, scaffolded by create-cogenta from the "portfolio" blueprint. Its projects and this page were seeded by the installer so there is real content to look at from the first run.',
104
+ marks: [],
105
+ },
106
+ ],
107
+ markDefs: [],
108
+ },
109
+ ],
110
+ },
111
+ {
112
+ _key: 'demo-about-stats',
113
+ _type: 'stats',
114
+ _version: BLOCK_VERSION,
115
+ title: 'At a glance',
116
+ items: [
117
+ { _key: 'demo-stat-1', value: '8', unit: 'years', label: 'in practice' },
118
+ { _key: 'demo-stat-2', value: '40+', label: 'projects delivered' },
119
+ { _key: 'demo-stat-3', value: '12', label: 'ongoing clients' },
120
+ ],
121
+ },
122
+ ],
123
+ },
124
+ ];
125
+ export const PORTFOLIO_RECOMMENDED_AGENTS = [
126
+ {
127
+ name: 'performanceAgent',
128
+ package: '@cogenta/agents-builtin',
129
+ reason: 'Catches oversized project cover images before they slow the work grid down.',
130
+ },
131
+ {
132
+ name: 'seoAgent',
133
+ package: '@cogenta/agents-builtin',
134
+ reason: 'Audits project pages so each one is findable on its own, not only from the grid.',
135
+ },
136
+ ];
137
+ /**
138
+ * Inserts the `portfolio` blueprint's demo content through the real
139
+ * `ContentStore` — never mocked (house rule).
140
+ */
141
+ async function seedPortfolioDemoContent(db, defaultLocale, adminId) {
142
+ const projectStore = createContentStore({ db, collection: project, defaultLocale });
143
+ const pageStore = createContentStore({ db, collection: page, defaultLocale });
144
+ for (const demo of PORTFOLIO_DEMO_PROJECTS) {
145
+ await projectStore.create({
146
+ status: 'published',
147
+ createdBy: adminId,
148
+ values: {
149
+ title: demo.title,
150
+ slug: demo.slug,
151
+ summary: demo.summary,
152
+ role: demo.role,
153
+ year: demo.year,
154
+ },
155
+ });
156
+ }
157
+ for (const demo of PORTFOLIO_DEMO_PAGES) {
158
+ await pageStore.create({
159
+ status: 'published',
160
+ createdBy: adminId,
161
+ values: { title: demo.title, slug: demo.slug },
162
+ blocks: { blocks: demo.blocks.map(toBlockZoneEntry) },
163
+ });
164
+ }
165
+ }
166
+ export const portfolioContentPack = {
167
+ collections: PORTFOLIO_COLLECTIONS,
168
+ recommendedAgents: PORTFOLIO_RECOMMENDED_AGENTS,
169
+ seedDemoContent: seedPortfolioDemoContent,
170
+ };
171
+ //# sourceMappingURL=portfolio.js.map