@pagesmith/core 0.3.0 → 0.4.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 (87) hide show
  1. package/README.md +28 -4
  2. package/REFERENCE.md +163 -94
  3. package/dist/ai/index.d.mts +5 -3
  4. package/dist/ai/index.d.mts.map +1 -1
  5. package/dist/ai/index.mjs +300 -206
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/assets/index.d.mts +10 -1
  8. package/dist/assets/index.d.mts.map +1 -1
  9. package/dist/assets/index.mjs +2 -2
  10. package/dist/{assets-DXiWF_KI.mjs → assets-CAPOqQ_P.mjs} +42 -5
  11. package/dist/assets-CAPOqQ_P.mjs.map +1 -0
  12. package/dist/{content-config-Bfe4W9us.d.mts → content-config-Bu2HH0Yx.d.mts} +49 -17
  13. package/dist/{content-config-Bfe4W9us.d.mts.map → content-config-Bu2HH0Yx.d.mts.map} +1 -1
  14. package/dist/{content-layer-DPK1EmfY.mjs → content-layer-CJRrNpZ_.mjs} +192 -36
  15. package/dist/content-layer-CJRrNpZ_.mjs.map +1 -0
  16. package/dist/content-layer-Ckt08g2i.d.mts +122 -0
  17. package/dist/content-layer-Ckt08g2i.d.mts.map +1 -0
  18. package/dist/create/index.d.mts.map +1 -1
  19. package/dist/create/index.mjs +31 -30
  20. package/dist/create/index.mjs.map +1 -1
  21. package/dist/css/index.d.mts +1 -1
  22. package/dist/css/index.mjs +1 -1
  23. package/dist/css-CO3CBqxx.mjs +24 -0
  24. package/dist/css-CO3CBqxx.mjs.map +1 -0
  25. package/dist/heading-D4X2L4vd.d.mts +12 -0
  26. package/dist/heading-D4X2L4vd.d.mts.map +1 -0
  27. package/dist/{index-BBYkDxwI.d.mts → index-B4YZRIzb.d.mts} +1 -1
  28. package/dist/{index-BBYkDxwI.d.mts.map → index-B4YZRIzb.d.mts.map} +1 -1
  29. package/dist/{index-Bg9srb5U.d.mts → index-B7NRZAxd.d.mts} +1 -1
  30. package/dist/{index-Bg9srb5U.d.mts.map → index-B7NRZAxd.d.mts.map} +1 -1
  31. package/dist/{index-YXQxMV6J.d.mts → index-CryArLlX.d.mts} +2 -2
  32. package/dist/{index-YXQxMV6J.d.mts.map → index-CryArLlX.d.mts.map} +1 -1
  33. package/dist/{index-CbOKbkjJ.d.mts → index-D44syBt-.d.mts} +3 -2
  34. package/dist/index-D44syBt-.d.mts.map +1 -0
  35. package/dist/index.d.mts +16 -99
  36. package/dist/index.d.mts.map +1 -1
  37. package/dist/index.mjs +15 -11
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/loaders/index.d.mts +2 -2
  40. package/dist/loaders/index.mjs +1 -1
  41. package/dist/{loaders-Cf-BXf2L.mjs → loaders-DnyWfANR.mjs} +3 -3
  42. package/dist/loaders-DnyWfANR.mjs.map +1 -0
  43. package/dist/markdown/index.d.mts +2 -2
  44. package/dist/markdown/index.mjs +1 -1
  45. package/dist/{markdown-CyrHoDhP.mjs → markdown-DMHd400a.mjs} +29 -2
  46. package/dist/markdown-DMHd400a.mjs.map +1 -0
  47. package/dist/{heading-BpDXnl-7.d.mts → markdown-config-CDvh5aJ-.d.mts} +2 -10
  48. package/dist/markdown-config-CDvh5aJ-.d.mts.map +1 -0
  49. package/dist/mcp/index.d.mts +23 -0
  50. package/dist/mcp/index.d.mts.map +1 -0
  51. package/dist/mcp/index.mjs +2 -0
  52. package/dist/mcp/server.d.mts +13 -0
  53. package/dist/mcp/server.d.mts.map +1 -0
  54. package/dist/mcp/server.mjs +2 -0
  55. package/dist/runtime/index.d.mts.map +1 -1
  56. package/dist/runtime/index.mjs +4 -9
  57. package/dist/runtime/index.mjs.map +1 -1
  58. package/dist/schemas/index.d.mts +4 -3
  59. package/dist/server-BZA_iSen.mjs +203 -0
  60. package/dist/server-BZA_iSen.mjs.map +1 -0
  61. package/dist/ssg-utils/index.d.mts +51 -0
  62. package/dist/ssg-utils/index.d.mts.map +1 -0
  63. package/dist/ssg-utils/index.mjs +119 -0
  64. package/dist/ssg-utils/index.mjs.map +1 -0
  65. package/dist/{types-Cn52sdoq.d.mts → types-B-V5qemH.d.mts} +1 -1
  66. package/dist/{types-Cn52sdoq.d.mts.map → types-B-V5qemH.d.mts.map} +1 -1
  67. package/dist/vite/index.d.mts +69 -34
  68. package/dist/vite/index.d.mts.map +1 -1
  69. package/dist/vite/index.mjs +296 -228
  70. package/dist/vite/index.mjs.map +1 -1
  71. package/docs/agents/AGENTS.md.template +29 -0
  72. package/docs/agents/changelog-notes.md +15 -0
  73. package/docs/agents/errors.md +150 -0
  74. package/docs/agents/migration.md +25 -0
  75. package/docs/agents/recipes.md +50 -0
  76. package/docs/agents/usage.md +119 -0
  77. package/docs/llms-full.txt +111 -0
  78. package/docs/llms.txt +68 -0
  79. package/package.json +57 -4
  80. package/dist/assets-DXiWF_KI.mjs.map +0 -1
  81. package/dist/content-layer-DPK1EmfY.mjs.map +0 -1
  82. package/dist/css-BneO430t.mjs +0 -20
  83. package/dist/css-BneO430t.mjs.map +0 -1
  84. package/dist/heading-BpDXnl-7.d.mts.map +0 -1
  85. package/dist/index-CbOKbkjJ.d.mts.map +0 -1
  86. package/dist/loaders-Cf-BXf2L.mjs.map +0 -1
  87. package/dist/markdown-CyrHoDhP.mjs.map +0 -1
package/README.md CHANGED
@@ -29,6 +29,8 @@ const rendered = await entries[0]?.render()
29
29
  // rendered.html, rendered.headings, rendered.readTime
30
30
  ```
31
31
 
32
+ For pre-1.0 upgrade notes, see `docs/agents/migration.md`.
33
+
32
34
  ### Vite Integration
33
35
 
34
36
  ```ts
@@ -147,11 +149,12 @@ The pipeline is built with unified and processes markdown through these stages:
147
149
  ```
148
150
  remark-parse → remark-gfm → remark-math → remark-frontmatter
149
151
  → remark-github-alerts → remark-smartypants → [user remark plugins]
150
- → remark-rehype
152
+ lang-alias transform → remark-rehype
153
+ → rehype-mathjax (must run before Expressive Code)
151
154
  → rehype-expressive-code (syntax highlighting)
152
- → rehype-mathjax → rehype-slug → rehype-autolink-headings
153
- heading extraction [user rehype plugins]
154
- rehype-external-links → rehype-accessible-emojis → rehype-stringify
155
+ → rehype-slug → rehype-autolink-headings
156
+ rehype-external-links → rehype-accessible-emojis
157
+ heading extraction [user rehype plugins] → rehype-stringify
155
158
  ```
156
159
 
157
160
  ### Markdown Features
@@ -474,7 +477,28 @@ Generates: `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, skills, `llms.txt`, `llms-full
474
477
  | `@pagesmith/core/runtime` | Pre-built CSS/JS accessors |
475
478
  | `@pagesmith/core/ai` | AI assistant artifact generator |
476
479
  | `@pagesmith/core/vite` | Vite plugins (pagesmithContent, pagesmithSsg, sharedAssetsPlugin) |
480
+ | `@pagesmith/core/ssg-utils` | Shared SSG utility helpers |
477
481
  | `@pagesmith/core/create` | Project scaffolding utilities |
482
+ | `@pagesmith/core/mcp` | Core MCP server and helper utilities |
483
+
484
+ ## Further Reading
485
+
486
+ - **[REFERENCE.md](REFERENCE.md)** — complete AI reference covering the content layer API, collections, loaders, markdown pipeline, Expressive Code, validators, JSX runtime, CSS exports, and Vite plugins
487
+ - **[`@pagesmith/docs` README](../docs/README.md)** — convention-based docs site package with built-in navigation, search, and theme
488
+ - **[`@pagesmith/docs` REFERENCE.md](../docs/REFERENCE.md)** — full docs reference for AI assistants
489
+
490
+ ### AI agent guidance (shipped inside the package)
491
+
492
+ These files are available at `node_modules/@pagesmith/core/` after installation:
493
+
494
+ | File | Purpose |
495
+ |---|---|
496
+ | `REFERENCE.md` | Full API reference for content layer, collections, markdown, JSX, CSS, Vite |
497
+ | `docs/agents/usage.md` | Agent rules, integration shape, copy-paste prompts |
498
+ | `docs/agents/recipes.md` | Step-by-step recipes for common tasks |
499
+ | `docs/agents/errors.md` | Error catalog with patterns and fixes |
500
+ | `docs/llms.txt` | Compact AI context index |
501
+ | `docs/llms-full.txt` | Full AI context with all file pointers |
478
502
 
479
503
  ## License
480
504
 
package/REFERENCE.md CHANGED
@@ -5,6 +5,7 @@ Link this file from your project's CLAUDE.md or AGENTS.md to give AI assistants
5
5
  ```markdown
6
6
  <!-- In your CLAUDE.md or AGENTS.md -->
7
7
  For the full @pagesmith/core API reference, see: node_modules/@pagesmith/core/REFERENCE.md
8
+ For @pagesmith/core usage and prompts, read: node_modules/@pagesmith/core/docs/agents/usage.md
8
9
  ```
9
10
 
10
11
  ---
@@ -13,7 +14,7 @@ For the full @pagesmith/core API reference, see: node_modules/@pagesmith/core/RE
13
14
 
14
15
  `@pagesmith/core` is a file-based content toolkit for Vite. It provides schema-validated content collections, lazy markdown rendering with Expressive Code syntax highlighting, a server-side JSX runtime, CSS bundles, and Vite plugins for framework integrations.
15
16
 
16
- ESM only (`"type": "module"`). Node 18+.
17
+ ESM only (`"type": "module"`). Node 24+.
17
18
 
18
19
  ## Content Layer API
19
20
 
@@ -40,67 +41,111 @@ const rendered = await entries[0]?.render()
40
41
 
41
42
  ### ContentLayer methods
42
43
 
43
- | Method | Description |
44
- |---|---|
45
- | `createContentLayer(config)` | Create a content layer from a config object |
46
- | `layer.getCollection(name)` | Load all entries in a collection (cached) |
47
- | `layer.getEntry(collection, slug)` | Get a single entry by slug |
48
- | `layer.convert(markdown, options?)` | Convert raw markdown to HTML outside collections |
49
- | `layer.validate(collection?)` | Run all validators and return results |
50
- | `layer.invalidate(collection, slug)` | Cache-bust a single entry |
51
- | `layer.invalidateCollection(name)` | Cache-bust an entire collection |
52
- | `layer.invalidateAll()` | Cache-bust all collections |
44
+
45
+ | Method | Description |
46
+ | ----------------------------------------------- | ---------------------------------------------------- |
47
+ | `createContentLayer(config)` | Create a content layer from a config object |
48
+ | `layer.getCollection(name)` | Load all entries in a collection (cached) |
49
+ | `layer.getEntry(collection, slug)` | Get a single entry by slug |
50
+ | `layer.convert(markdown, options?)` | Convert raw markdown to HTML outside collections |
51
+ | `layer.validate(collection?)` | Run all validators and return results |
52
+ | `layer.invalidate(collection, slug)` | Cache-bust a single entry |
53
+ | `layer.invalidateCollection(name)` | Cache-bust an entire collection |
54
+ | `layer.invalidateAll()` | Cache-bust all collections |
55
+ | `layer.getCollectionNames()` | Get names of all configured collections |
56
+ | `layer.getCollectionDef(name)` | Get the definition of a collection |
57
+ | `layer.getCollections()` | Get all collection definitions |
58
+ | `layer.invalidateWhere(collection, predicate)` | Cache-bust entries matching a predicate |
59
+ | `layer.watch(callback)` | Watch collection directories for changes |
60
+ | `layer.getCacheStats()` | Get cache statistics for debugging |
61
+
53
62
 
54
63
  ### ContentEntry properties
55
64
 
56
- | Property | Type | Description |
57
- |---|---|---|
58
- | `slug` | `string` | URL-friendly identifier |
59
- | `collection` | `string` | Collection name |
60
- | `filePath` | `string` | Absolute source path |
61
- | `data` | `T` | Validated data (typed by your Zod schema) |
62
- | `rawContent` | `string` | Raw markdown body (markdown loader only) |
63
- | `render(options?)` | `Promise<RenderedContent>` | Lazy markdown-to-HTML (cached) |
64
- | `clearRenderCache()` | `void` | Force re-render on next call |
65
+
66
+ | Property | Type | Description |
67
+ | -------------------- | -------------------------- | ----------------------------------------- |
68
+ | `slug` | `string` | URL-friendly identifier |
69
+ | `collection` | `string` | Collection name |
70
+ | `filePath` | `string` | Absolute source path |
71
+ | `data` | `T` | Validated data (typed by your Zod schema) |
72
+ | `rawContent` | `string` | Raw markdown body (markdown loader only) |
73
+ | `render(options?)` | `Promise<RenderedContent>` | Lazy markdown-to-HTML (cached) |
74
+ | `clearRenderCache()` | `void` | Force re-render on next call |
75
+
65
76
 
66
77
  ### RenderedContent
67
78
 
68
- | Property | Type | Description |
69
- |---|---|---|
70
- | `html` | `string` | Rendered HTML |
79
+
80
+ | Property | Type | Description |
81
+ | ---------- | ----------- | ----------------------- |
82
+ | `html` | `string` | Rendered HTML |
71
83
  | `headings` | `Heading[]` | `{ depth, text, slug }` |
72
- | `readTime` | `number` | Estimated minutes |
84
+ | `readTime` | `number` | Estimated minutes |
85
+
73
86
 
74
87
  ## Collection Options
75
88
 
76
- | Option | Type | Description |
77
- |---|---|---|
78
- | `loader` | `string \| Loader` | `'markdown'`, `'json'`, `'json5'`, `'jsonc'`, `'yaml'`, `'toml'`, or custom |
79
- | `directory` | `string` | Directory containing collection files |
80
- | `schema` | `z.ZodType` | Zod schema for validating entry data |
81
- | `include` | `string[]` | Glob include patterns |
82
- | `exclude` | `string[]` | Glob exclude patterns |
83
- | `computed` | `Record<string, fn>` | Computed fields derived from entry data |
84
- | `validate` | `fn` | Custom validation hook (return string for error) |
85
- | `filter` | `fn` | Filter entries (return false to exclude) |
86
- | `slugify` | `fn` | Custom slug generation |
87
- | `transform` | `fn` | Pre-validation transform |
88
- | `validators` | `ContentValidator[]` | Custom content validators |
89
- | `disableBuiltinValidators` | `boolean` | Disable built-in markdown validators |
89
+
90
+ | Option | Type | Description |
91
+ | -------------------------- | -------------------- | --------------------------------------------------------------------------- |
92
+ | `loader` | `string | Loader` | `'markdown'`, `'json'`, `'json5'`, `'jsonc'`, `'yaml'`, `'toml'`, or custom |
93
+ | `directory` | `string` | Directory containing collection files |
94
+ | `schema` | `z.ZodType` | Zod schema for validating entry data |
95
+ | `include` | `string[]` | Glob include patterns |
96
+ | `exclude` | `string[]` | Glob exclude patterns |
97
+ | `computed` | `Record<string, fn>` | Computed fields derived from entry data |
98
+ | `validate` | `fn` | Custom validation hook (return string for error) |
99
+ | `filter` | `fn` | Filter entries (return false to exclude) |
100
+ | `slugify` | `fn` | Custom slug generation |
101
+ | `transform` | `fn` | Pre-validation transform |
102
+ | `validators` | `ContentValidator[]` | Custom content validators |
103
+ | `disableBuiltinValidators` | `boolean` | Disable built-in markdown validators |
104
+
90
105
 
91
106
  ## Loaders
92
107
 
93
- | Type | Extensions | Description |
94
- |---|---|---|
95
- | `markdown` | `.md` | gray-matter frontmatter + markdown body |
96
- | `json` | `.json` | JSON.parse |
97
- | `json5` | `.json` | Relaxed JSON with comments, trailing commas |
98
- | `jsonc` | `.json`, `.jsonc` | JSON with comments |
99
- | `yaml` | `.yml`, `.yaml` | YAML |
100
- | `toml` | `.toml` | TOML |
108
+
109
+ | Type | Extensions | Description |
110
+ | ---------- | ----------------- | ------------------------------------------- |
111
+ | `markdown` | `.md` | gray-matter frontmatter + markdown body |
112
+ | `json` | `.json` | JSON.parse |
113
+ | `json5` | `.json` | Relaxed JSON with comments, trailing commas |
114
+ | `jsonc` | `.json`, `.jsonc` | JSON with comments |
115
+ | `yaml` | `.yml`, `.yaml` | YAML |
116
+ | `toml` | `.toml` | TOML |
117
+
101
118
 
102
119
  Custom loaders: implement `Loader { name, kind, extensions, load(filePath) }`.
103
120
 
121
+ ## ContentLayerConfig
122
+
123
+ Top-level config passed to `defineConfig()` or `createContentLayer()`:
124
+
125
+
126
+ | Field | Type | Default | Description |
127
+ | ------------- | ----------------- | --------- | -------------------------------------------------------- |
128
+ | `collections` | `CollectionMap` | — | Named collections keyed by collection name |
129
+ | `root` | `string` | `cwd()` | Root directory for resolving relative collection paths |
130
+ | `markdown` | `MarkdownConfig` | — | Markdown processing config shared across all collections |
131
+ | `assets` | `object` | — | `{ hashFilenames?, outputDir? }` for cache-busted assets |
132
+ | `plugins` | `ContentPlugin[]` | — | Content plugins for extending processing and validation |
133
+ | `strict` | `boolean` | `false` | Throw on file load errors instead of creating dummy entries |
134
+
135
+
136
+ ### defineCollections
137
+
138
+ Helper for defining multiple collections with type inference:
139
+
140
+ ```ts
141
+ import { defineCollections, z } from '@pagesmith/core'
142
+
143
+ const collections = defineCollections({
144
+ posts: { loader: 'markdown', directory: 'content/posts', schema: z.object({ title: z.string() }) },
145
+ pages: { loader: 'markdown', directory: 'content/pages', schema: z.object({ title: z.string() }) },
146
+ })
147
+ ```
148
+
104
149
  ## Vite Plugins
105
150
 
106
151
  ### pagesmithContent
@@ -122,14 +167,16 @@ export default defineConfig({
122
167
 
123
168
  Options:
124
169
 
125
- | Option | Type | Default | Description |
126
- |---|---|---|---|
127
- | `collections` | `Collections` | | Collection definitions |
128
- | `moduleId` | `string` | `'virtual:content'` | Virtual module prefix |
129
- | `configPath` | `string` | `'./content.config.ts'` | Config file path |
130
- | `dts` | `boolean \| string` | `true` | Generate .d.ts |
131
- | `contentRoot` | `string` | `'content'` | Shared root for contentSlug |
132
- | `markdown` | `MarkdownConfig` | | Markdown pipeline config |
170
+
171
+ | Option | Type | Default | Description |
172
+ | ------------- | ------------------ | ----------------------- | --------------------------- |
173
+ | `collections` | `Collections` | | Collection definitions |
174
+ | `moduleId` | `string` | `'virtual:content'` | Virtual module prefix |
175
+ | `configPath` | `string` | `'./content.config.ts'` | Config file path |
176
+ | `dts` | `boolean | string` | `true` | Generate .d.ts |
177
+ | `contentRoot` | `string` | `'content'` | Shared root for contentSlug |
178
+ | `markdown` | `MarkdownConfig` | — | Markdown pipeline config |
179
+
133
180
 
134
181
  Import in your code:
135
182
 
@@ -158,9 +205,10 @@ Serves shared font assets (Open Sans, JetBrains Mono) bundled with `@pagesmith/c
158
205
  ```
159
206
  remark-parse → remark-gfm → remark-math → remark-frontmatter
160
207
  → remark-github-alerts → remark-smartypants → [user remark plugins]
161
- → remark-rehype
208
+ lang-alias transform → remark-rehype
209
+ → rehype-mathjax (must run before Expressive Code so math is rendered to SVG first)
162
210
  → rehype-expressive-code (dual themes, line numbers, titles, copy, collapse, mark/ins/del)
163
- → rehype-mathjax → rehype-slug → rehype-autolink-headings
211
+ → rehype-slug → rehype-autolink-headings
164
212
  → rehype-external-links → rehype-accessible-emojis
165
213
  → heading extraction → [user rehype plugins] → rehype-stringify
166
214
  ```
@@ -181,16 +229,18 @@ type MarkdownConfig = {
181
229
 
182
230
  ### Code Block Meta Syntax (Expressive Code)
183
231
 
184
- | Meta | Example | Description |
185
- |---|---|---|
186
- | `title="..."` | `` ```js title="app.js" `` | File title |
187
- | `showLineNumbers` | `` ```js showLineNumbers `` | Line numbers |
188
- | `mark={lines}` | `` ```js mark={3,5-7} `` | Highlight lines |
189
- | `ins={lines}` | `` ```js ins={4} `` | Inserted lines (green) |
190
- | `del={lines}` | `` ```js del={5} `` | Deleted lines (red) |
191
- | `collapse={lines}` | `` ```js collapse={1-5} `` | Collapsible section |
192
- | `wrap` | `` ```js wrap `` | Text wrapping |
193
- | `frame="..."` | `` ```js frame="terminal" `` | Frame style |
232
+
233
+ | Meta | Example | Description |
234
+ | ------------------ | ------------------------ | ---------------------- |
235
+ | `title="..."` | ````js title="app.js"` | File title |
236
+ | `showLineNumbers` | ````js showLineNumbers` | Line numbers |
237
+ | `mark={lines}` | ````js mark={3,5-7}` | Highlight lines |
238
+ | `ins={lines}` | ````js ins={4}` | Inserted lines (green) |
239
+ | `del={lines}` | ````js del={5}` | Deleted lines (red) |
240
+ | `collapse={lines}` | ````js collapse={1-5}` | Collapsible section |
241
+ | `wrap` | ````js wrap` | Text wrapping |
242
+ | `frame="..."` | ````js frame="terminal"` | Frame style |
243
+
194
244
 
195
245
  ### Built-in Validators
196
246
 
@@ -223,12 +273,14 @@ function Page({ title, content }: { title: string; content: string }) {
223
273
 
224
274
  ## CSS Exports
225
275
 
226
- | Import Path | Contents |
227
- |---|---|
228
- | `@pagesmith/core/css/content` | Prose typography + inline code |
229
- | `@pagesmith/core/css/standalone` | Full layout + prose + TOC |
230
- | `@pagesmith/core/css/viewport` | Responsive viewport base |
231
- | `@pagesmith/core/css/fonts` | Bundled Open Sans + JetBrains Mono |
276
+
277
+ | Import Path | Contents |
278
+ | -------------------------------- | ---------------------------------- |
279
+ | `@pagesmith/core/css/content` | Prose typography + inline code |
280
+ | `@pagesmith/core/css/standalone` | Full layout + prose + TOC |
281
+ | `@pagesmith/core/css/viewport` | Responsive viewport base |
282
+ | `@pagesmith/core/css/fonts` | Bundled Open Sans + JetBrains Mono |
283
+
232
284
 
233
285
  Code block styling is handled by Expressive Code (inline styles).
234
286
 
@@ -239,36 +291,43 @@ import { getRuntimeCSS, getRuntimeJS, getContentCSS, getContentJS } from '@pages
239
291
  ```
240
292
 
241
293
  Two tiers:
294
+
242
295
  - **Standalone** (`getRuntimeCSS/JS`) — full site with TOC highlight
243
296
  - **Content** (`getContentCSS/JS`) — markdown rendering only
244
297
 
245
298
  ## Frontmatter Schemas
246
299
 
247
- | Schema | Fields |
248
- |---|---|
249
- | `BaseFrontmatterSchema` | title, description, publishedDate, lastUpdatedOn, tags, draft |
250
- | `BlogFrontmatterSchema` | extends base + category, featured, coverImage |
251
- | `ProjectFrontmatterSchema` | extends base + gitRepo, links |
300
+
301
+ | Schema | Fields |
302
+ | -------------------------- | ------------------------------------------------------------- |
303
+ | `BaseFrontmatterSchema` | title, description, publishedDate, lastUpdatedOn, tags, draft |
304
+ | `BlogFrontmatterSchema` | extends base + category, featured, coverImage |
305
+ | `ProjectFrontmatterSchema` | extends base + gitRepo, links |
306
+
252
307
 
253
308
  ## Export Map
254
309
 
255
- | Import Path | Purpose |
256
- |---|---|
257
- | `@pagesmith/core` | Main API (defineCollection, createContentLayer, z, etc.) |
258
- | `@pagesmith/core/jsx-runtime` | h, Fragment, HtmlString |
259
- | `@pagesmith/core/markdown` | processMarkdown |
260
- | `@pagesmith/core/css` | buildCss (LightningCSS) |
261
- | `@pagesmith/core/css/content` | Content CSS file |
262
- | `@pagesmith/core/css/standalone` | Standalone CSS file |
263
- | `@pagesmith/core/css/viewport` | Viewport CSS file |
264
- | `@pagesmith/core/css/fonts` | Bundled font faces |
265
- | `@pagesmith/core/schemas` | Zod schemas and types |
266
- | `@pagesmith/core/loaders` | Loader classes and registry |
267
- | `@pagesmith/core/assets` | Asset copying and hashing |
268
- | `@pagesmith/core/runtime` | Pre-built CSS/JS accessors |
269
- | `@pagesmith/core/vite` | Vite plugins |
270
- | `@pagesmith/core/ai` | AI assistant artifact generator |
271
- | `@pagesmith/core/create` | Project scaffolding |
310
+
311
+ | Import Path | Purpose |
312
+ | -------------------------------- | -------------------------------------------------------- |
313
+ | `@pagesmith/core` | Main API (defineCollection, createContentLayer, z, etc.) |
314
+ | `@pagesmith/core/jsx-runtime` | h, Fragment, HtmlString |
315
+ | `@pagesmith/core/markdown` | processMarkdown |
316
+ | `@pagesmith/core/css` | buildCss (LightningCSS) |
317
+ | `@pagesmith/core/css/content` | Content CSS file |
318
+ | `@pagesmith/core/css/standalone` | Standalone CSS file |
319
+ | `@pagesmith/core/css/viewport` | Viewport CSS file |
320
+ | `@pagesmith/core/css/fonts` | Bundled font faces |
321
+ | `@pagesmith/core/schemas` | Zod schemas and types |
322
+ | `@pagesmith/core/loaders` | Loader classes and registry |
323
+ | `@pagesmith/core/assets` | Asset copying and hashing |
324
+ | `@pagesmith/core/runtime` | Pre-built CSS/JS accessors |
325
+ | `@pagesmith/core/vite` | Vite plugins |
326
+ | `@pagesmith/core/ssg-utils` | Shared SSG utility helpers |
327
+ | `@pagesmith/core/ai` | AI assistant artifact generator |
328
+ | `@pagesmith/core/create` | Project scaffolding |
329
+ | `@pagesmith/core/mcp` | Core MCP server and helper utilities |
330
+
272
331
 
273
332
  ## Key Rules
274
333
 
@@ -279,3 +338,13 @@ Two tiers:
279
338
  - Runtime JS provides only TOC highlighting (standalone) — copy buttons are Expressive Code
280
339
  - All exports are named (no default exports from core)
281
340
  - Code block styling is inline via Expressive Code — do NOT import separate code block CSS
341
+
342
+ ## Related Docs
343
+
344
+ - **Agent prompts and rules:** `node_modules/@pagesmith/core/docs/agents/usage.md`
345
+ - **Step-by-step recipes:** `node_modules/@pagesmith/core/docs/agents/recipes.md`
346
+ - **Error catalog:** `node_modules/@pagesmith/core/docs/agents/errors.md`
347
+ - **User README:** `node_modules/@pagesmith/core/README.md`
348
+ - **Docs package reference:** `node_modules/@pagesmith/docs/REFERENCE.md`
349
+ - **Docs package README:** `node_modules/@pagesmith/docs/README.md`
350
+
@@ -1,8 +1,8 @@
1
- //#region src/ai/index.d.ts
1
+ //#region src/ai/types.d.ts
2
2
  type AiAssistant = 'claude' | 'codex' | 'gemini';
3
3
  type AiInstallScope = 'project' | 'user';
4
4
  type AiInstallProfile = 'default' | 'docs';
5
- type AiArtifactKind = 'memory' | 'skill' | 'llms' | 'llms-full' | 'markdown-guidelines' | 'update-docs';
5
+ type AiArtifactKind = 'memory' | 'skill' | 'llms' | 'llms-full' | 'markdown-guidelines' | 'update-docs' | 'update-all-docs';
6
6
  type AiWriteMode = 'merge' | 'replace';
7
7
  type AiInstallStatus = 'written' | 'merged' | 'replaced' | 'unchanged';
8
8
  type AiArtifact = {
@@ -31,6 +31,8 @@ type AiInstallOptions = {
31
31
  skillName?: string; /** When true, return planned writes without actually writing files. */
32
32
  dryRun?: boolean;
33
33
  };
34
+ //#endregion
35
+ //#region src/ai/index.d.ts
34
36
  declare function getAiArtifactContent(assistant: AiAssistant | 'shared', kind: AiArtifactKind, options?: {
35
37
  profile?: AiInstallProfile;
36
38
  skillName?: string;
@@ -38,5 +40,5 @@ declare function getAiArtifactContent(assistant: AiAssistant | 'shared', kind: A
38
40
  declare function getAiArtifacts(options?: AiInstallOptions): AiArtifact[];
39
41
  declare function installAiArtifacts(options?: AiInstallOptions): AiInstallResult[];
40
42
  //#endregion
41
- export { AiArtifact, AiArtifactKind, AiAssistant, AiInstallOptions, AiInstallProfile, AiInstallResult, AiInstallScope, AiInstallStatus, AiWriteMode, getAiArtifactContent, getAiArtifacts, installAiArtifacts };
43
+ export { type AiArtifact, type AiArtifactKind, type AiAssistant, type AiInstallOptions, type AiInstallProfile, type AiInstallResult, type AiInstallScope, type AiInstallStatus, type AiWriteMode, getAiArtifactContent, getAiArtifacts, installAiArtifacts };
42
44
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/ai/index.ts"],"mappings":";KAIY,WAAA;AAAA,KACA,cAAA;AAAA,KACA,gBAAA;AAAA,KACA,cAAA;AAAA,KAOA,WAAA;AAAA,KACA,eAAA;AAAA,KAEA,UAAA;EACV,SAAA,GAAY,WAAA;EACZ,IAAA,EAAM,cAAA;EACN,IAAA;EACA,OAAA;EACA,IAAA,EAAM,WAAA;EACN,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,SAAA,GAAY,WAAA;EACZ,IAAA,EAAM,cAAA;EACN,IAAA;EACA,MAAA,EAAQ,eAAA;EACR,KAAA;AAAA;AAAA,KAGU,gBAAA;EACV,UAAA,GAAa,WAAA;EACb,KAAA,GAAQ,cAAA;EACR,OAAA,GAAU,gBAAA;EACV,GAAA;EACA,OAAA;EACA,WAAA;EACA,KAAA;EACA,SAAA,WA3ByB;EA6BzB,MAAA;AAAA;AAAA,iBA8sBc,oBAAA,CACd,SAAA,EAAW,WAAA,aACX,IAAA,EAAM,cAAA,EACN,OAAA;EAAW,OAAA,GAAU,gBAAA;EAAkB,SAAA;AAAA;AAAA,iBAuCzB,cAAA,CAAe,OAAA,GAAS,gBAAA,GAAwB,UAAA;AAAA,iBAiIhD,kBAAA,CAAmB,OAAA,GAAS,gBAAA,GAAwB,eAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/ai/types.ts","../../src/ai/index.ts"],"mappings":";KAAY,WAAA;AAAA,KACA,cAAA;AAAA,KACA,gBAAA;AAAA,KACA,cAAA;AAAA,KAQA,WAAA;AAAA,KACA,eAAA;AAAA,KAEA,UAAA;EACV,SAAA,GAAY,WAAA;EACZ,IAAA,EAAM,cAAA;EACN,IAAA;EACA,OAAA;EACA,IAAA,EAAM,WAAA;EACN,KAAA;AAAA;AAAA,KAGU,eAAA;EACV,SAAA,GAAY,WAAA;EACZ,IAAA,EAAM,cAAA;EACN,IAAA;EACA,MAAA,EAAQ,eAAA;EACR,KAAA;AAAA;AAAA,KAGU,gBAAA;EACV,UAAA,GAAa,WAAA;EACb,KAAA,GAAQ,cAAA;EACR,OAAA,GAAU,gBAAA;EACV,GAAA;EACA,OAAA;EACA,WAAA;EACA,KAAA;EACA,SAAA,WA3ByB;EA6BzB,MAAA;AAAA;;;iBCwBc,oBAAA,CACd,SAAA,EAAW,WAAA,aACX,IAAA,EAAM,cAAA,EACN,OAAA;EAAW,OAAA,GAAU,gBAAA;EAAkB,SAAA;AAAA;AAAA,iBA0CzB,cAAA,CAAe,OAAA,GAAS,gBAAA,GAAwB,UAAA;AAAA,iBAyIhD,kBAAA,CAAmB,OAAA,GAAS,gBAAA,GAAwB,eAAA"}