@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92

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 (284) hide show
  1. package/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
  2. package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
  3. package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
  4. package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
  5. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
  6. package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
  7. package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
  8. package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
  9. package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
  10. package/compiler-assets/nextjs/shims/document.tsx +46 -0
  11. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -0
  12. package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
  13. package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
  14. package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
  15. package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
  16. package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
  17. package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
  18. package/compiler-assets/nextjs/shims/proxy.ts +254 -86
  19. package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
  20. package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
  21. package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
  22. package/dist/{build-operation-2JAYBSKF.js → build-operation-CJDUL4OW.js} +29 -23
  23. package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
  24. package/dist/capture-local-source-WGGDIUU2.js +258 -0
  25. package/dist/chunk-22RSSUNV.js +13 -0
  26. package/dist/chunk-3T4HVDSC.js +426 -0
  27. package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
  28. package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
  29. package/dist/chunk-5KAD7W53.js +248 -0
  30. package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
  31. package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
  32. package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
  33. package/dist/chunk-DX7PXFCM.js +2519 -0
  34. package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
  35. package/dist/chunk-EFO6AWXN.js +19 -0
  36. package/dist/chunk-IL4RJOKI.js +186 -0
  37. package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
  38. package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
  39. package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
  40. package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
  41. package/dist/compiler.d.ts +15 -2
  42. package/dist/compiler.js +111 -23
  43. package/dist/components/blocks/agent-actions.d.ts +81 -0
  44. package/dist/components/blocks/agent-actions.js +563 -0
  45. package/dist/components/blocks/toc.d.ts +43 -0
  46. package/dist/components/blocks/toc.js +136 -0
  47. package/dist/components/ui/button.d.ts +4 -0
  48. package/dist/components/ui/button.js +94 -0
  49. package/dist/compose-44GJSMXD.js +16 -0
  50. package/dist/config/createNextConfig.js +19 -3
  51. package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
  52. package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
  53. package/dist/ide-support-TG74L4FF.js +16 -0
  54. package/dist/index.d.ts +151 -95
  55. package/dist/index.js +25 -0
  56. package/dist/jsx-dev-runtime.d.ts +6 -0
  57. package/dist/jsx-dev-runtime.js +100 -0
  58. package/dist/jsx-runtime.d.ts +7 -0
  59. package/dist/jsx-runtime.js +97 -0
  60. package/dist/kernel/components/blocks/AgentActions.d.ts +37 -8
  61. package/dist/kernel/components/blocks/AgentActions.js +384 -174
  62. package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
  63. package/dist/kernel/components/blocks/agent-actions.js +563 -0
  64. package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
  65. package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
  66. package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
  67. package/dist/kernel/components/blocks/color-palette.js +4 -4
  68. package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
  69. package/dist/kernel/components/blocks/logo-block.js +1 -1
  70. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
  71. package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
  72. package/dist/kernel/components/blocks/navbar.d.ts +5 -4
  73. package/dist/kernel/components/blocks/navbar.js +79 -59
  74. package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
  75. package/dist/kernel/components/blocks/navigation-progress.js +2 -2
  76. package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
  77. package/dist/kernel/components/blocks/next-prev.js +30 -7
  78. package/dist/kernel/components/blocks/page-list.d.ts +4 -4
  79. package/dist/kernel/components/blocks/page-list.js +32 -9
  80. package/dist/kernel/components/blocks/search.d.ts +9 -15
  81. package/dist/kernel/components/blocks/search.js +16 -17
  82. package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
  83. package/dist/kernel/components/blocks/sidebar-node.js +13 -3
  84. package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
  85. package/dist/kernel/components/blocks/sidebar.js +137 -28
  86. package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
  87. package/dist/kernel/components/blocks/theme-toggle.js +5 -5
  88. package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
  89. package/dist/kernel/components/blocks/toc-client.js +495 -0
  90. package/dist/kernel/components/blocks/toc.d.ts +20 -2
  91. package/dist/kernel/components/blocks/toc.js +121 -179
  92. package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
  93. package/dist/kernel/components/mdx/components/blockquote.js +1 -1
  94. package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
  95. package/dist/kernel/components/mdx/components/callout.js +1 -1
  96. package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
  97. package/dist/kernel/components/mdx/components/code-block.js +2 -2
  98. package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
  99. package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
  100. package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
  101. package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
  102. package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
  103. package/dist/kernel/components/mdx/components/figure.js +23 -13
  104. package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
  105. package/dist/kernel/components/mdx/components/footnotes.js +1 -1
  106. package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
  107. package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
  108. package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
  109. package/dist/kernel/components/mdx/components/heading.js +6 -3
  110. package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
  111. package/dist/kernel/components/mdx/components/hr.js +2 -2
  112. package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
  113. package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
  114. package/dist/kernel/components/mdx/components/image.d.ts +2 -2
  115. package/dist/kernel/components/mdx/components/image.js +22 -17
  116. package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
  117. package/dist/kernel/components/mdx/components/inline-code.js +1 -1
  118. package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
  119. package/dist/kernel/components/mdx/components/kbd.js +2 -2
  120. package/dist/kernel/components/mdx/components/link.d.ts +6 -6
  121. package/dist/kernel/components/mdx/components/link.js +2 -2
  122. package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
  123. package/dist/kernel/components/mdx/components/paragraph.js +1 -1
  124. package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
  125. package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
  126. package/dist/kernel/components/mdx/components/table.d.ts +7 -7
  127. package/dist/kernel/components/mdx/components/table.js +2 -2
  128. package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
  129. package/dist/kernel/components/mdx/components/task-list.js +1 -1
  130. package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
  131. package/dist/kernel/components/mdx/components/video-player.js +6 -2
  132. package/dist/kernel/components/mdx/components/video.d.ts +5 -4
  133. package/dist/kernel/components/mdx/components/video.js +7 -5
  134. package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
  135. package/dist/kernel/components/mdx/error-boundary.js +2 -2
  136. package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
  137. package/dist/kernel/components/mdx/error-fallback.js +1 -1
  138. package/dist/kernel/components/mdx/mdx.d.ts +57 -16
  139. package/dist/kernel/components/mdx/mdx.js +232 -35
  140. package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
  141. package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
  142. package/dist/kernel/components/mdx/types.d.ts +1 -1
  143. package/dist/kernel/components/next-image.d.ts +12 -0
  144. package/dist/kernel/components/next-image.js +61 -0
  145. package/dist/kernel/components/ui/accordion.d.ts +7 -7
  146. package/dist/kernel/components/ui/accordion.js +1 -1
  147. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
  148. package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
  149. package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
  150. package/dist/kernel/components/ui/breadcrumb.js +4 -4
  151. package/dist/kernel/components/ui/button-group.d.ts +6 -6
  152. package/dist/kernel/components/ui/button-group.js +3 -3
  153. package/dist/kernel/components/ui/button.d.ts +59 -7
  154. package/dist/kernel/components/ui/button.js +43 -39
  155. package/dist/kernel/components/ui/card.d.ts +7 -7
  156. package/dist/kernel/components/ui/card.js +1 -1
  157. package/dist/kernel/components/ui/dialog.d.ts +10 -10
  158. package/dist/kernel/components/ui/dialog.js +1 -1
  159. package/dist/kernel/components/ui/drawer.d.ts +12 -12
  160. package/dist/kernel/components/ui/drawer.js +1 -1
  161. package/dist/kernel/components/ui/input.d.ts +2 -2
  162. package/dist/kernel/components/ui/input.js +1 -1
  163. package/dist/kernel/components/ui/kbd.d.ts +4 -4
  164. package/dist/kernel/components/ui/kbd.js +1 -1
  165. package/dist/kernel/components/ui/link.d.ts +11 -5
  166. package/dist/kernel/components/ui/link.js +2 -2
  167. package/dist/kernel/components/ui/menu.d.ts +22 -22
  168. package/dist/kernel/components/ui/menu.js +1 -1
  169. package/dist/kernel/components/ui/mod-key.d.ts +2 -3
  170. package/dist/kernel/components/ui/mod-key.js +2 -2
  171. package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
  172. package/dist/kernel/components/ui/navigation-menu.js +1 -1
  173. package/dist/kernel/components/ui/popover.d.ts +11 -11
  174. package/dist/kernel/components/ui/popover.js +1 -1
  175. package/dist/kernel/components/ui/progress.d.ts +7 -7
  176. package/dist/kernel/components/ui/progress.js +1 -1
  177. package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
  178. package/dist/kernel/components/ui/scroll-area.js +1 -1
  179. package/dist/kernel/components/ui/select.d.ts +16 -16
  180. package/dist/kernel/components/ui/select.js +1 -1
  181. package/dist/kernel/components/ui/separator.d.ts +3 -3
  182. package/dist/kernel/components/ui/separator.js +1 -1
  183. package/dist/kernel/components/ui/table.d.ts +7 -7
  184. package/dist/kernel/components/ui/table.js +1 -1
  185. package/dist/kernel/components/ui/tabs.d.ts +12 -12
  186. package/dist/kernel/components/ui/tabs.js +1 -1
  187. package/dist/kernel/components/ui/tag.d.ts +3 -3
  188. package/dist/kernel/components/ui/tag.js +1 -1
  189. package/dist/kernel/components/ui/text.d.ts +4 -4
  190. package/dist/kernel/components/ui/text.js +1 -1
  191. package/dist/kernel/components/ui/toast.d.ts +11 -11
  192. package/dist/kernel/components/ui/toast.js +1 -1
  193. package/dist/kernel/components/ui/tooltip.d.ts +9 -9
  194. package/dist/kernel/components/ui/tooltip.js +1 -1
  195. package/dist/kernel/defaults.registry.d.ts +4 -17
  196. package/dist/kernel/defaults.registry.js +4 -19
  197. package/dist/kernel/routes/agent/markdown.d.ts +7 -0
  198. package/dist/kernel/routes/agent/markdown.js +229 -54
  199. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  200. package/dist/kernel/routes/layouts/group.js +5 -7
  201. package/dist/kernel/routes/metadata/feed.d.ts +1 -2
  202. package/dist/kernel/routes/metadata/feed.js +119 -88
  203. package/dist/kernel/routes/metadata/llms.d.ts +3 -23
  204. package/dist/kernel/routes/metadata/llms.js +2 -103
  205. package/dist/kernel/routes/metadata/og-image.js +1 -1
  206. package/dist/kernel/routes/metadata/robots.d.ts +5 -3
  207. package/dist/kernel/routes/metadata/robots.js +4 -25
  208. package/dist/kernel/routes/metadata/sitemap.d.ts +36 -3
  209. package/dist/kernel/routes/metadata/sitemap.js +277 -49
  210. package/dist/kernel/routes/not-found.d.ts +34 -0
  211. package/dist/kernel/routes/not-found.js +213 -0
  212. package/dist/kernel/routes/pages/group.d.ts +5 -5
  213. package/dist/kernel/routes/pages/group.js +11 -5
  214. package/dist/kernel/routes/pages/leaf.d.ts +38 -6
  215. package/dist/kernel/routes/pages/leaf.js +21 -12
  216. package/dist/kernel/routes/pages/root.d.ts +5 -5
  217. package/dist/kernel/routes/pages/root.js +21 -6
  218. package/dist/keyboard-shortcuts.d.ts +2 -2
  219. package/dist/keyboard-shortcuts.js +1 -1
  220. package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
  221. package/dist/resolvers/manifest-resolver.d.ts +2 -2
  222. package/dist/resolvers/manifest-resolver.js +65 -35
  223. package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
  224. package/dist/search.d.ts +2 -9
  225. package/dist/search.js +9 -16
  226. package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
  227. package/dist/theme-scope.d.ts +2 -2
  228. package/dist/theme-scope.js +1 -1
  229. package/dist/types-BbqmOzLC.d.ts +168 -0
  230. package/dist/types-TjH1ek0X.d.ts +22 -0
  231. package/dist/types-sM2g9nW0.d.ts +12 -0
  232. package/dist/types.d.ts +117 -91
  233. package/dist/utils/heading-ids.js +30 -11
  234. package/dist/utils/toc-selection.d.ts +7 -0
  235. package/dist/utils/toc-selection.js +14 -0
  236. package/dist/validate-local-source-EN2GW4FR.js +16 -0
  237. package/dist/validate-publish-os-source-OEWQDB7B.js +14 -0
  238. package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
  239. package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
  240. package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
  241. package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
  242. package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
  243. package/init/seed/minimal/publish.os/blog/index.tsx +85 -0
  244. package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
  245. package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
  246. package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
  247. package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
  248. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
  249. package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
  250. package/init/seed/minimal/publish.os/publish.os.config.json +17 -2
  251. package/init/seed/minimal/publish.os/theme.css +3 -3
  252. package/init/seed/minimal/seed.json +12 -4
  253. package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
  254. package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
  255. package/package.json +48 -23
  256. package/release/app/phosphor/package.json +4 -4
  257. package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
  258. package/release/compiler/package.json +5 -3
  259. package/release/compiler/pnpm-lock.yaml.template +153 -183
  260. package/release/release.json +6 -6
  261. package/dist/button-CtzUJB8u.d.ts +0 -11
  262. package/dist/chunk-535TM4A5.js +0 -1455
  263. package/dist/chunk-B2V22WRT.js +0 -297
  264. package/dist/chunk-NECL5IBJ.js +0 -318
  265. package/dist/chunk-SVYGXXYR.js +0 -36
  266. package/dist/chunk-UF6ATARM.js +0 -1100
  267. package/dist/compose-NN23UJGC.js +0 -13
  268. package/dist/ide-support-ZNW7ODFY.js +0 -15
  269. package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
  270. package/dist/kernel/components/blocks/design-system-preview.js +0 -667
  271. package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
  272. package/dist/kernel/components/blocks/link-playground.js +0 -744
  273. package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
  274. package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
  275. package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
  276. package/dist/kernel/components/ui/theme-toggle.js +0 -53
  277. package/dist/sidebar-types-DKpR27II.d.ts +0 -25
  278. package/dist/types-BzkZty3r.d.ts +0 -147
  279. package/dist/types-CJWRG05y.d.ts +0 -76
  280. package/dist/types-CUtrppxt.d.ts +0 -69
  281. package/dist/validate-local-source-XRL2Y7XE.js +0 -14
  282. package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
  283. package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
  284. package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
@@ -2,9 +2,11 @@ import {
2
2
  runtimePackageVersion
3
3
  } from "./chunk-AI2UULNX.js";
4
4
  import {
5
- AppError,
6
5
  readInstalledFrameworkLocation
7
- } from "./chunk-WDY4IK6Z.js";
6
+ } from "./chunk-5J3YUNRY.js";
7
+ import {
8
+ AppError
9
+ } from "./chunk-22RSSUNV.js";
8
10
 
9
11
  // src/lib/compiler/release/framework-selection.ts
10
12
  import { createHash } from "crypto";
@@ -1,13 +1,15 @@
1
- import {
2
- validatePublishOsSource
3
- } from "./chunk-726GV2NF.js";
4
1
  import {
5
2
  assertFrameworkSelection
6
- } from "./chunk-DLDFHU7Y.js";
3
+ } from "./chunk-NNBJZPFM.js";
4
+ import {
5
+ validatePublishOsSource
6
+ } from "./chunk-DZ3VWEV5.js";
7
7
  import {
8
- AppError,
9
8
  readInstalledFramework
10
- } from "./chunk-WDY4IK6Z.js";
9
+ } from "./chunk-5J3YUNRY.js";
10
+ import {
11
+ AppError
12
+ } from "./chunk-22RSSUNV.js";
11
13
 
12
14
  // src/lib/compiler/lifecycle/validate-local-source.ts
13
15
  async function validateLocalSource({
@@ -18,7 +20,8 @@ async function validateLocalSource({
18
20
  options.signal?.throwIfAborted(), options.onEvent?.({ type: "progress", message: "Validating source" });
19
21
  let validation = await validatePublishOsSource({
20
22
  publishOsDir: sourceDir,
21
- sourceIdentity: { sourceRoot }
23
+ sourceIdentity: { sourceRoot },
24
+ includeDrafts: options.request.operation === "dev"
22
25
  });
23
26
  if (options.signal?.throwIfAborted(), options.onEvent?.({
24
27
  type: "diagnostics",
@@ -1,9 +1,3 @@
1
- // src/lib/hosting/framework-paths.ts
2
- var FRAMEWORK_PREFIX = "/publishos", ASSET_PREFIX = `${FRAMEWORK_PREFIX}/assets`, SITE_API_PREFIX = `${FRAMEWORK_PREFIX}/api`, PAGEFIND_PREFIX = `${ASSET_PREFIX}/pagefind`, PAGEFIND_MODULE_URL = `${PAGEFIND_PREFIX}/pagefind.js`, PAGEFIND_ENTRY_URL = `${PAGEFIND_PREFIX}/pagefind-entry.json`, IMAGE_OPTIMIZER_PATH = `${SITE_API_PREFIX}/image`, NEXT_IMAGE_OPTIMIZER_PATH = "/_next/image", OG_SERVICE_PREFIX = `${SITE_API_PREFIX}/og`, PUBLIC_ASSET_DIRECTORY = "publishos/assets", PUBLIC_FONT_DIRECTORY = `${PUBLIC_ASSET_DIRECTORY}/_publishos/fonts`, PUBLIC_PAGEFIND_DIRECTORY = `public/${PUBLIC_ASSET_DIRECTORY}/pagefind`, FRAMEWORK_PROXY_MATCHER = `/((?!${FRAMEWORK_PREFIX.slice(1)}(?:/|$)|_next/static|_next/image|_next/webpack-hmr).*)`;
3
- function isFrameworkNamespacePath(pathname) {
4
- return pathname === FRAMEWORK_PREFIX || pathname.startsWith(`${FRAMEWORK_PREFIX}/`);
5
- }
6
-
7
1
  // src/lib/compiler/internal/path-containment.ts
8
2
  import * as systemPath from "path";
9
3
  function relativePath(parent, child, pathImplementation) {
@@ -25,9 +19,12 @@ function isDescendant(parent, child, pathImplementation = systemPath) {
25
19
  }
26
20
 
27
21
  // src/lib/compiler/source/source-paths.ts
22
+ function isOsMetadataPath(relativePath2) {
23
+ return relativePath2.split(/[\\/]/).includes(".DS_Store");
24
+ }
28
25
  function isExcludedSourcePath(relativePath2) {
29
26
  let segments = relativePath2.split(/[\\/]/);
30
- return relativePath2 === "tsconfig.json" || segments[0] === ".publish.os" || segments.includes("publish.os");
27
+ return isOsMetadataPath(relativePath2) || relativePath2 === "tsconfig.json" || segments[0] === ".publish.os" || segments.includes("publish.os");
31
28
  }
32
29
  var ROOT_FILES = /* @__PURE__ */ new Set(["publish.os.config.json", "tsconfig.json"]), RENDERER_FILES = /* @__PURE__ */ new Set([
33
30
  "layout.tsx",
@@ -37,7 +34,7 @@ var ROOT_FILES = /* @__PURE__ */ new Set(["publish.os.config.json", "tsconfig.js
37
34
  "(index)/index.tsx",
38
35
  "(page)/layout.tsx",
39
36
  "(page)/page.tsx"
40
- ]), ROOT_DIRECTORIES = ["public/", "assets/", "components/", "content/"], RESERVED_DIRECTORIES = /* @__PURE__ */ new Set([
37
+ ]), ROOT_DIRECTORIES = ["assets/", "components/", "content/"], RESERVED_DIRECTORIES = /* @__PURE__ */ new Set([
41
38
  "app",
42
39
  "pages",
43
40
  "node_modules",
@@ -74,18 +71,9 @@ function isApprovedPublishOsPath(path, groupFolders) {
74
71
  }
75
72
 
76
73
  export {
77
- FRAMEWORK_PREFIX,
78
- ASSET_PREFIX,
79
- IMAGE_OPTIMIZER_PATH,
80
- NEXT_IMAGE_OPTIMIZER_PATH,
81
- OG_SERVICE_PREFIX,
82
- PUBLIC_ASSET_DIRECTORY,
83
- PUBLIC_FONT_DIRECTORY,
84
- PUBLIC_PAGEFIND_DIRECTORY,
85
- FRAMEWORK_PROXY_MATCHER,
86
- isFrameworkNamespacePath,
87
74
  isSameOrDescendant,
88
75
  isDescendant,
76
+ isOsMetadataPath,
89
77
  isExcludedSourcePath,
90
78
  isReservedFrameworkPath,
91
79
  isApprovedPublishOsPath
@@ -1,4 +1,15 @@
1
1
  type FrameworkOperation = "validate" | "compose" | "dev" | "build";
2
+ type FrameworkPrivateComposition = {
3
+ appFiles: Array<{
4
+ path: string;
5
+ content: string;
6
+ }>;
7
+ publicPaths: string[];
8
+ sourceFiles: Array<{
9
+ path: string;
10
+ content: string;
11
+ }>;
12
+ };
2
13
  type LocalOperationContext = {
3
14
  sourceRoot: string;
4
15
  sourceDir: string;
@@ -50,13 +61,14 @@ type FrameworkRequest = {
50
61
  sourceRevision?: string;
51
62
  /** Exact caller-owned pnpm executable. Local commands never search PATH. */
52
63
  pnpmExecutable?: string;
53
- /** IDE selection is separate from runtime; preserve retains valid external Dev setup. */
64
+ /** Optional generated editor support for the selected framework. */
54
65
  ide?: {
55
66
  finalSourceRoot?: string;
56
- policy?: "preserve";
57
67
  };
58
68
  /** Local development origin, supplied after selecting an available port. */
59
69
  previewUrl?: string;
70
+ /** App files supplied by a local maintainer launcher for checkout Dev. */
71
+ privateComposition?: FrameworkPrivateComposition;
60
72
  };
61
73
  port?: number;
62
74
  portExplicit?: boolean;
@@ -109,6 +121,7 @@ type FrameworkResult = {
109
121
  code: string;
110
122
  message: string;
111
123
  fix: string;
124
+ details?: Record<string, unknown>;
112
125
  };
113
126
  };
114
127
  type RunFrameworkOptions = {
package/dist/compiler.js CHANGED
@@ -1,16 +1,19 @@
1
1
  import {
2
2
  withCheckoutPreparation
3
- } from "./chunk-DWA3ZRGW.js";
3
+ } from "./chunk-6C65KV7O.js";
4
4
  import {
5
5
  withLocalOperation
6
- } from "./chunk-B2V22WRT.js";
7
- import "./chunk-GGKFQ3MA.js";
8
- import "./chunk-7OGTPSKI.js";
9
- import "./chunk-YLTOLYWM.js";
6
+ } from "./chunk-IL4RJOKI.js";
7
+ import "./chunk-6D2E6UMD.js";
8
+ import "./chunk-7NY22B5U.js";
9
+ import "./chunk-EFO6AWXN.js";
10
+ import "./chunk-WL75GQ5M.js";
10
11
  import {
11
- AppError,
12
12
  readInstalledFramework
13
- } from "./chunk-WDY4IK6Z.js";
13
+ } from "./chunk-5J3YUNRY.js";
14
+ import {
15
+ AppError
16
+ } from "./chunk-22RSSUNV.js";
14
17
 
15
18
  // src/compiler.ts
16
19
  import { realpathSync } from "fs";
@@ -26,7 +29,7 @@ function serveCompilerIpc(options) {
26
29
  finished = !0, dispose();
27
30
  let terminal = protocolFailure ?? result;
28
31
  process.exitCode = disconnected || terminal.status === "failure" ? 1 : terminal.status === "cancelled" ? cancellationExitCode : 0, !(!process.connected || !process.send) && process.send(terminal, (error) => {
29
- error && (process.exitCode = 1), process.connected && process.disconnect();
32
+ error && (process.exitCode = 1), process.connected && process.disconnect?.();
30
33
  });
31
34
  }, cancel = (reason, exitCode = 130) => {
32
35
  if (!(finished || controller.signal.aborted)) {
@@ -40,7 +43,7 @@ function serveCompilerIpc(options) {
40
43
  () => process.exit(
41
44
  disconnected || protocolFailure ? 1 : cancellationExitCode
42
45
  ),
43
- 5e3
46
+ 1e4
44
47
  ), stopTimer.unref();
45
48
  }
46
49
  }, disconnect = () => {
@@ -114,6 +117,72 @@ function serveCompilerIpc(options) {
114
117
  process.on("message", receive), process.on("disconnect", disconnect), process.on("SIGINT", interrupt), process.on("SIGTERM", terminate);
115
118
  }
116
119
 
120
+ // src/lib/compiler/diagnostic-budget.ts
121
+ function boundedText(value, limit = 1e3) {
122
+ return value.length > limit ? `${value.slice(0, limit - 3)}...` : value;
123
+ }
124
+ function boundedDiagnostic(diagnostic) {
125
+ let { file, ...rest } = diagnostic;
126
+ return {
127
+ ...rest,
128
+ code: boundedText(diagnostic.code, 128),
129
+ message: boundedText(diagnostic.message),
130
+ ...file !== void 0 && file.length <= 4096 ? { file } : {},
131
+ ...diagnostic.correction === void 0 ? {} : { correction: boundedText(diagnostic.correction) },
132
+ ...diagnostic.sourceLine === void 0 ? {} : { sourceLine: boundedText(diagnostic.sourceLine) },
133
+ ...diagnostic.propertyPath === void 0 ? {} : { propertyPath: boundedText(diagnostic.propertyPath) }
134
+ };
135
+ }
136
+ function createDiagnosticBudget(onEvent) {
137
+ let total = 0, errors = 0, retained = [], finished = !1, priority = (diagnostic) => diagnostic.severity === "error" ? 2 : diagnostic.code === "CONTENT_STATUS_INVALID" ? 1 : 0, send = (diagnostics) => {
138
+ diagnostics.length !== 0 && onEvent?.({ type: "diagnostics", diagnostics: { diagnostics } });
139
+ };
140
+ return {
141
+ emit(event) {
142
+ if (!finished) {
143
+ if (event.type !== "diagnostics") {
144
+ onEvent?.(event);
145
+ return;
146
+ }
147
+ if (event.diagnostics.diagnostics.length === 0) {
148
+ onEvent?.(event);
149
+ return;
150
+ }
151
+ for (let diagnostic of event.diagnostics.diagnostics) {
152
+ total += 1, diagnostic.severity === "error" && (errors += 1);
153
+ let item = boundedDiagnostic(diagnostic);
154
+ if (retained.length < 100)
155
+ retained.push(item);
156
+ else {
157
+ let lowest = retained.findIndex(
158
+ (existing) => priority(existing) < priority(item)
159
+ );
160
+ lowest !== -1 && retained.splice(lowest, 1, item);
161
+ }
162
+ }
163
+ }
164
+ },
165
+ finish() {
166
+ if (finished) return;
167
+ finished = !0, retained.sort((a, b) => priority(b) - priority(a));
168
+ let selected = retained.slice(
169
+ 0,
170
+ total > 100 ? 99 : 100
171
+ );
172
+ send(selected);
173
+ let omitted = total - selected.length, omittedErrors = errors - selected.filter((item) => item.severity === "error").length;
174
+ omitted > 0 && send([
175
+ {
176
+ code: "FRAMEWORK_DIAGNOSTICS_TRUNCATED",
177
+ severity: omittedErrors > 0 ? "error" : "warning",
178
+ message: `${omitted} additional diagnostics were omitted (${omittedErrors} ${omittedErrors === 1 ? "error" : "errors"}).`,
179
+ correction: "Run the build locally to see all diagnostics."
180
+ }
181
+ ]);
182
+ }
183
+ };
184
+ }
185
+
117
186
  // src/compiler.ts
118
187
  function failure(error) {
119
188
  return { error, status: "failure", type: "result" };
@@ -149,6 +218,16 @@ async function approveComposition(options) {
149
218
  });
150
219
  }
151
220
  async function runFramework(options) {
221
+ if (options.request?.operation === "dev" || options.request?.operation === "build")
222
+ return runFrameworkOperation(options);
223
+ let budget = createDiagnosticBudget(options.onEvent);
224
+ try {
225
+ return await runFrameworkOperation({ ...options, onEvent: budget.emit });
226
+ } finally {
227
+ budget.finish();
228
+ }
229
+ }
230
+ async function runFrameworkOperation(options) {
152
231
  if (options.request?.protocol !== 1)
153
232
  return failure({
154
233
  code: "FRAMEWORK_PROTOCOL_UNSUPPORTED",
@@ -169,17 +248,18 @@ async function runFramework(options) {
169
248
  });
170
249
  try {
171
250
  if (options.signal?.throwIfAborted(), options.request.operation === "build") {
172
- let { runLocalBuild } = await import("./build-operation-2JAYBSKF.js");
251
+ let { runLocalBuild } = await import("./build-operation-CJDUL4OW.js");
173
252
  return await runLocalBuild(options);
174
253
  }
175
254
  if (options.request.operation === "dev") {
176
- let { runDevelopment } = await import("./dev-operation-TZDVJCN7.js");
255
+ let { runDevelopment } = await import("./dev-operation-WNECBHZ5.js");
177
256
  return await runDevelopment(options);
178
257
  }
179
258
  options.onEvent?.({ message: "Validating source", type: "progress" });
180
- let { validatePublishOsSource } = await import("./validate-publish-os-source-DAPZ4QGE.js"), validation = await validatePublishOsSource({
259
+ let { validatePublishOsSource } = await import("./validate-publish-os-source-OEWQDB7B.js"), validation = await validatePublishOsSource({
181
260
  publishOsDir: options.request.paths.source,
182
- sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0
261
+ sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0,
262
+ includeDrafts: options.request.operation === "compose" && !!options.request.context?.previewUrl && !options.request.context?.hostedSite
183
263
  });
184
264
  if (options.signal?.throwIfAborted(), options.onEvent?.({
185
265
  type: "diagnostics",
@@ -194,19 +274,19 @@ async function runFramework(options) {
194
274
  fix: "Correct the reported source errors, then run the command again.",
195
275
  message: "The selected source failed validation."
196
276
  });
197
- let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-X4U6Y6QC.js");
277
+ let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-ZVO323PK.js");
198
278
  if (await assertFrameworkSelection({
199
279
  context: options.request.context,
200
280
  framework,
201
281
  runtime: validation.source.config.runtime
202
282
  }), options.request.operation === "validate" && options.request.context?.ide) {
203
- let { prepareIdeSupport } = await import("./ide-support-ZNW7ODFY.js");
283
+ let source = validation.source, { prepareIdeSupport } = await import("./ide-support-TG74L4FF.js");
204
284
  await prepareIdeSupport({
285
+ frameworkOptions: options,
205
286
  publishOsDir: options.request.paths.source,
206
- finalPublishOsDir: options.request.context.ide.finalSourceRoot,
207
- source: validation.source,
208
- framework,
209
- frameworkOptions: options
287
+ finalPublishOsDir: options.request.context?.ide?.finalSourceRoot,
288
+ source,
289
+ framework
210
290
  });
211
291
  }
212
292
  if (options.request.operation === "compose") {
@@ -223,16 +303,23 @@ async function runFramework(options) {
223
303
  message: "The caller did not authorize composition."
224
304
  });
225
305
  options.signal?.throwIfAborted();
226
- let { composeFrameworkSource } = await import("./compose-NN23UJGC.js");
306
+ let { composeFrameworkSource } = await import("./compose-44GJSMXD.js");
227
307
  await composeFrameworkSource({
228
308
  request: options.request,
229
309
  source: validation.source,
230
310
  signal: options.signal,
231
311
  onProgress: (message) => options.onEvent?.({ message, type: "progress" }),
232
- onWarning: ({ code, message }) => options.onEvent?.({
312
+ onWarning: ({ code, message, file }) => options.onEvent?.({
233
313
  type: "diagnostics",
234
314
  diagnostics: {
235
- diagnostics: [{ code, message, severity: "warning" }]
315
+ diagnostics: [
316
+ {
317
+ code,
318
+ message,
319
+ severity: "warning",
320
+ ...file ? { file } : {}
321
+ }
322
+ ]
236
323
  }
237
324
  })
238
325
  });
@@ -255,7 +342,8 @@ async function runFramework(options) {
255
342
  }), failure({
256
343
  code: error.code,
257
344
  fix: error instanceof AppError && error.fix ? error.fix : frameworkRecovery(error.code),
258
- message: error.message
345
+ message: error.message,
346
+ ...error instanceof AppError && error.code === "FRAMEWORK_LOCAL_OUTPUT_REDIRECTED" && error.details ? { details: error.details } : {}
259
347
  })) : failure({
260
348
  code: "FRAMEWORK_EXECUTION_FAILED",
261
349
  fix: "Repeat the publish.os command with --debug. Send only the sanitized report path and error code to support@publish.dev.",
@@ -0,0 +1,81 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ComponentPropsWithoutRef } from 'react';
3
+ import { ButtonVariantProps } from '../../kernel/components/ui/button.js';
4
+ import 'class-variance-authority/types';
5
+ import 'class-variance-authority';
6
+
7
+ type Resolvable<T> = T | ((context: AgentActionContext) => T);
8
+ type AgentActionContext = {
9
+ pagePath: string;
10
+ pageUrl: string;
11
+ markdownPath: string;
12
+ markdownUrl: string;
13
+ markdown?: string;
14
+ sourceUrl?: string;
15
+ prompt: string;
16
+ };
17
+ type AgentActionCopyTarget = "markdown-link" | "page-link" | "page-markdown" | string;
18
+ type AgentActionConfig = {
19
+ id: string;
20
+ title: string;
21
+ icon?: ReactNode;
22
+ href?: Resolvable<string | undefined>;
23
+ target?: ComponentPropsWithoutRef<"a">["target"];
24
+ rel?: string;
25
+ openInNew?: boolean;
26
+ copy?: AgentActionCopyTarget;
27
+ disabled?: Resolvable<boolean | undefined>;
28
+ onSelect?: (context: AgentActionContext) => void | Promise<void>;
29
+ };
30
+ type AgentActionGroup = {
31
+ id: string;
32
+ title?: string;
33
+ actions: AgentActionConfig[];
34
+ };
35
+ type AgentActionsProps = ComponentPropsWithoutRef<"div"> & {
36
+ pagePath?: string;
37
+ pageUrl?: string;
38
+ markdownPath?: string;
39
+ markdownUrl?: string;
40
+ markdown?: string;
41
+ markdownRevision?: string;
42
+ siteUrl?: string;
43
+ sourceUrl?: string;
44
+ prompt?: string;
45
+ primaryAction?: AgentActionConfig;
46
+ actionGroups?: AgentActionGroup[];
47
+ buttonSize?: ButtonVariantProps["size"];
48
+ buttonVariant?: ButtonVariantProps["variant"];
49
+ menuLabel?: string;
50
+ markdownLinkLabel?: string;
51
+ showMarkdownLink?: boolean;
52
+ };
53
+ declare function AgentActionsToolbar({ className, ...props }: ComponentPropsWithoutRef<"div">): react.JSX.Element;
54
+ declare function AgentActionsMarkdownLink(): ReactNode;
55
+ declare function AgentActionsPrimaryAction({ action }: {
56
+ action?: AgentActionConfig;
57
+ }): ReactNode;
58
+ declare function AgentActionsFeedback(): react.JSX.Element;
59
+ declare function AgentActionsGroup({ title, children, }: {
60
+ title?: string;
61
+ children: ReactNode;
62
+ }): react.JSX.Element;
63
+ declare function AgentActionsItem({ action }: {
64
+ action: AgentActionConfig;
65
+ }): ReactNode;
66
+ declare function AgentActionsMenu({ children }: {
67
+ children?: ReactNode;
68
+ }): react.JSX.Element;
69
+ declare function AgentActionsRoot(props: AgentActionsProps): react.JSX.Element;
70
+ declare const AgentActions: typeof AgentActionsRoot & {
71
+ Feedback: typeof AgentActionsFeedback;
72
+ Group: typeof AgentActionsGroup;
73
+ Item: typeof AgentActionsItem;
74
+ MarkdownLink: typeof AgentActionsMarkdownLink;
75
+ Menu: typeof AgentActionsMenu;
76
+ PrimaryAction: typeof AgentActionsPrimaryAction;
77
+ Root: typeof AgentActionsRoot;
78
+ Toolbar: typeof AgentActionsToolbar;
79
+ };
80
+
81
+ export { type AgentActionConfig, type AgentActionContext, type AgentActionCopyTarget, type AgentActionGroup, AgentActions, type AgentActionsProps, AgentActionsFeedback as Feedback, AgentActionsGroup as Group, AgentActionsItem as Item, AgentActionsMarkdownLink as MarkdownLink, AgentActionsMenu as Menu, AgentActionsPrimaryAction as PrimaryAction, AgentActionsRoot as Root, AgentActionsToolbar as Toolbar };