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

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 (223) hide show
  1. package/compiler-assets/nextjs/defaults/group/layout.tsx +1 -5
  2. package/compiler-assets/nextjs/defaults/group/page.tsx +31 -22
  3. package/compiler-assets/nextjs/defaults/project/next.config.mjs +19 -10
  4. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
  5. package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
  6. package/compiler-assets/nextjs/shims/document.tsx +38 -0
  7. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +2 -0
  8. package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
  9. package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
  10. package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
  11. package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
  12. package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
  13. package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
  14. package/compiler-assets/nextjs/shims/proxy.ts +126 -60
  15. package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
  16. package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
  17. package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
  18. package/dist/{build-operation-2JAYBSKF.js → build-operation-5QMLXF7N.js} +29 -23
  19. package/dist/{button-c3WGnxIj.d.ts → button-BdCScEKi.d.ts} +3 -3
  20. package/dist/capture-local-source-WGGDIUU2.js +258 -0
  21. package/dist/chunk-22RSSUNV.js +13 -0
  22. package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
  23. package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
  24. package/dist/chunk-5KAD7W53.js +248 -0
  25. package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
  26. package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
  27. package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
  28. package/dist/chunk-EFO6AWXN.js +19 -0
  29. package/dist/{chunk-726GV2NF.js → chunk-F3AGNDF4.js} +100 -67
  30. package/dist/chunk-GBPLER5H.js +426 -0
  31. package/dist/chunk-IL4RJOKI.js +186 -0
  32. package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
  33. package/dist/{chunk-VO2I7MTM.js → chunk-ORIUWJBQ.js} +8 -6
  34. package/dist/{chunk-H6XILMZX.js → chunk-OXOFRXEI.js} +1806 -831
  35. package/dist/chunk-UYGCOWRF.js +1709 -0
  36. package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
  37. package/dist/compiler.d.ts +15 -2
  38. package/dist/compiler.js +90 -21
  39. package/dist/components/blocks/agent-actions.d.ts +81 -0
  40. package/dist/components/blocks/agent-actions.js +594 -0
  41. package/dist/components/blocks/toc.d.ts +43 -0
  42. package/dist/components/blocks/toc.js +136 -0
  43. package/dist/components/ui/button.d.ts +5 -0
  44. package/dist/components/ui/button.js +94 -0
  45. package/dist/compose-CVBJRAF6.js +16 -0
  46. package/dist/config/createNextConfig.js +17 -3
  47. package/dist/{dev-operation-TZDVJCN7.js → dev-operation-OSHHWRWK.js} +121 -81
  48. package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
  49. package/dist/ide-support-CU6Z5PVR.js +16 -0
  50. package/dist/index.d.ts +40 -1
  51. package/dist/jsx-dev-runtime.d.ts +6 -0
  52. package/dist/jsx-dev-runtime.js +100 -0
  53. package/dist/jsx-runtime.d.ts +7 -0
  54. package/dist/jsx-runtime.js +97 -0
  55. package/dist/kernel/components/blocks/AgentActions.d.ts +35 -6
  56. package/dist/kernel/components/blocks/AgentActions.js +383 -142
  57. package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
  58. package/dist/kernel/components/blocks/agent-actions.js +594 -0
  59. package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
  60. package/dist/kernel/components/blocks/color-palette.js +4 -4
  61. package/dist/kernel/components/blocks/logo-block.js +1 -1
  62. package/dist/kernel/components/blocks/nav-breadcrumb.js +2 -2
  63. package/dist/kernel/components/blocks/navbar.js +17 -17
  64. package/dist/kernel/components/blocks/navigation-progress.js +2 -2
  65. package/dist/kernel/components/blocks/next-prev.js +1 -1
  66. package/dist/kernel/components/blocks/page-list.js +2 -2
  67. package/dist/kernel/components/blocks/search.d.ts +1 -1
  68. package/dist/kernel/components/blocks/search.js +16 -17
  69. package/dist/kernel/components/blocks/sidebar-node.js +1 -1
  70. package/dist/kernel/components/blocks/sidebar.js +7 -4
  71. package/dist/kernel/components/blocks/theme-toggle.d.ts +1 -1
  72. package/dist/kernel/components/blocks/theme-toggle.js +5 -5
  73. package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
  74. package/dist/kernel/components/blocks/toc-client.js +495 -0
  75. package/dist/kernel/components/blocks/toc.d.ts +19 -1
  76. package/dist/kernel/components/blocks/toc.js +121 -179
  77. package/dist/kernel/components/mdx/components/blockquote.js +1 -1
  78. package/dist/kernel/components/mdx/components/callout.js +1 -1
  79. package/dist/kernel/components/mdx/components/code-block.js +2 -2
  80. package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
  81. package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
  82. package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
  83. package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
  84. package/dist/kernel/components/mdx/components/figure.js +23 -13
  85. package/dist/kernel/components/mdx/components/footnotes.js +1 -1
  86. package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
  87. package/dist/kernel/components/mdx/components/heading.js +6 -3
  88. package/dist/kernel/components/mdx/components/hr.js +2 -2
  89. package/dist/kernel/components/mdx/components/image-zoom.js +1 -1
  90. package/dist/kernel/components/mdx/components/image.d.ts +1 -1
  91. package/dist/kernel/components/mdx/components/image.js +21 -16
  92. package/dist/kernel/components/mdx/components/inline-code.js +1 -1
  93. package/dist/kernel/components/mdx/components/kbd.js +2 -2
  94. package/dist/kernel/components/mdx/components/link.d.ts +3 -3
  95. package/dist/kernel/components/mdx/components/link.js +2 -2
  96. package/dist/kernel/components/mdx/components/paragraph.js +1 -1
  97. package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
  98. package/dist/kernel/components/mdx/components/table.js +2 -2
  99. package/dist/kernel/components/mdx/components/task-list.js +1 -1
  100. package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
  101. package/dist/kernel/components/mdx/components/video-player.js +6 -2
  102. package/dist/kernel/components/mdx/components/video.d.ts +5 -3
  103. package/dist/kernel/components/mdx/components/video.js +7 -5
  104. package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
  105. package/dist/kernel/components/mdx/error-boundary.js +2 -2
  106. package/dist/kernel/components/mdx/error-fallback.js +1 -1
  107. package/dist/kernel/components/mdx/mdx.d.ts +20 -10
  108. package/dist/kernel/components/mdx/mdx.js +231 -34
  109. package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
  110. package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
  111. package/dist/kernel/components/mdx/types.d.ts +1 -1
  112. package/dist/kernel/components/next-image.d.ts +12 -0
  113. package/dist/kernel/components/next-image.js +61 -0
  114. package/dist/kernel/components/ui/accordion.js +1 -1
  115. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +2 -2
  116. package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
  117. package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
  118. package/dist/kernel/components/ui/breadcrumb.js +4 -4
  119. package/dist/kernel/components/ui/button-group.d.ts +1 -1
  120. package/dist/kernel/components/ui/button-group.js +3 -3
  121. package/dist/kernel/components/ui/button.d.ts +56 -4
  122. package/dist/kernel/components/ui/button.js +43 -39
  123. package/dist/kernel/components/ui/card.js +1 -1
  124. package/dist/kernel/components/ui/dialog.js +1 -1
  125. package/dist/kernel/components/ui/drawer.js +1 -1
  126. package/dist/kernel/components/ui/input.d.ts +2 -2
  127. package/dist/kernel/components/ui/input.js +1 -1
  128. package/dist/kernel/components/ui/kbd.d.ts +1 -1
  129. package/dist/kernel/components/ui/kbd.js +1 -1
  130. package/dist/kernel/components/ui/link.d.ts +8 -2
  131. package/dist/kernel/components/ui/link.js +2 -2
  132. package/dist/kernel/components/ui/menu.js +1 -1
  133. package/dist/kernel/components/ui/mod-key.js +2 -2
  134. package/dist/kernel/components/ui/navigation-menu.js +1 -1
  135. package/dist/kernel/components/ui/popover.js +1 -1
  136. package/dist/kernel/components/ui/progress.js +1 -1
  137. package/dist/kernel/components/ui/scroll-area.d.ts +8 -8
  138. package/dist/kernel/components/ui/scroll-area.js +1 -1
  139. package/dist/kernel/components/ui/select.js +1 -1
  140. package/dist/kernel/components/ui/separator.js +1 -1
  141. package/dist/kernel/components/ui/table.js +1 -1
  142. package/dist/kernel/components/ui/tabs.js +1 -1
  143. package/dist/kernel/components/ui/tag.js +1 -1
  144. package/dist/kernel/components/ui/text.d.ts +1 -1
  145. package/dist/kernel/components/ui/text.js +1 -1
  146. package/dist/kernel/components/ui/toast.js +1 -1
  147. package/dist/kernel/components/ui/tooltip.js +1 -1
  148. package/dist/kernel/defaults.registry.d.ts +2 -15
  149. package/dist/kernel/defaults.registry.js +2 -17
  150. package/dist/kernel/routes/agent/markdown.d.ts +3 -0
  151. package/dist/kernel/routes/agent/markdown.js +219 -48
  152. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  153. package/dist/kernel/routes/layouts/group.js +5 -7
  154. package/dist/kernel/routes/metadata/feed.d.ts +1 -1
  155. package/dist/kernel/routes/metadata/feed.js +109 -83
  156. package/dist/kernel/routes/metadata/llms.d.ts +11 -3
  157. package/dist/kernel/routes/metadata/llms.js +154 -57
  158. package/dist/kernel/routes/metadata/og-image.js +1 -1
  159. package/dist/kernel/routes/metadata/robots.d.ts +1 -1
  160. package/dist/kernel/routes/metadata/sitemap.d.ts +22 -3
  161. package/dist/kernel/routes/metadata/sitemap.js +183 -43
  162. package/dist/kernel/routes/not-found.d.ts +34 -0
  163. package/dist/kernel/routes/not-found.js +213 -0
  164. package/dist/kernel/routes/pages/group.d.ts +2 -2
  165. package/dist/kernel/routes/pages/group.js +1 -1
  166. package/dist/kernel/routes/pages/leaf.d.ts +30 -3
  167. package/dist/kernel/routes/pages/leaf.js +5 -4
  168. package/dist/kernel/routes/pages/root.d.ts +2 -2
  169. package/dist/kernel/routes/pages/root.js +1 -1
  170. package/dist/keyboard-shortcuts.js +1 -1
  171. package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
  172. package/dist/search.js +7 -9
  173. package/dist/theme-scope.js +1 -1
  174. package/dist/{types-BzkZty3r.d.ts → types-J2w_puPF.d.ts} +1 -20
  175. package/dist/types-sM2g9nW0.d.ts +12 -0
  176. package/dist/types.d.ts +1 -0
  177. package/dist/utils/heading-ids.js +30 -11
  178. package/dist/utils/toc-selection.d.ts +7 -0
  179. package/dist/utils/toc-selection.js +14 -0
  180. package/dist/validate-local-source-SV44DBQT.js +16 -0
  181. package/dist/validate-publish-os-source-NZJF3TB2.js +14 -0
  182. package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
  183. package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
  184. package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
  185. package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
  186. package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
  187. package/init/seed/minimal/publish.os/blog/index.tsx +82 -0
  188. package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
  189. package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
  190. package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
  191. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
  192. package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
  193. package/init/seed/minimal/publish.os/publish.os.config.json +6 -2
  194. package/init/seed/minimal/publish.os/theme.css +3 -3
  195. package/init/seed/minimal/seed.json +11 -4
  196. package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
  197. package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
  198. package/package.json +45 -20
  199. package/release/app/phosphor/package.json +3 -3
  200. package/release/app/phosphor/pnpm-lock.yaml.template +88 -75
  201. package/release/compiler/package.json +5 -3
  202. package/release/compiler/pnpm-lock.yaml.template +118 -74
  203. package/release/release.json +6 -6
  204. package/dist/button-CtzUJB8u.d.ts +0 -11
  205. package/dist/chunk-535TM4A5.js +0 -1455
  206. package/dist/chunk-B2V22WRT.js +0 -297
  207. package/dist/chunk-NECL5IBJ.js +0 -318
  208. package/dist/chunk-SVYGXXYR.js +0 -36
  209. package/dist/chunk-UF6ATARM.js +0 -1100
  210. package/dist/compose-NN23UJGC.js +0 -13
  211. package/dist/ide-support-ZNW7ODFY.js +0 -15
  212. package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
  213. package/dist/kernel/components/blocks/design-system-preview.js +0 -667
  214. package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
  215. package/dist/kernel/components/blocks/link-playground.js +0 -744
  216. package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
  217. package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
  218. package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
  219. package/dist/kernel/components/ui/theme-toggle.js +0 -53
  220. package/dist/validate-local-source-XRL2Y7XE.js +0 -14
  221. package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
  222. package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
  223. package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
@@ -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";
@@ -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,54 @@ 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 emitted = 0, omitted = 0, omittedErrors = 0, pending, finished = !1, send = (diagnostics) => {
138
+ diagnostics.length !== 0 && onEvent?.({ type: "diagnostics", diagnostics: { diagnostics } });
139
+ };
140
+ return {
141
+ emit(event) {
142
+ if (finished) return;
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
+ let retained = [];
152
+ for (let diagnostic of event.diagnostics.diagnostics)
153
+ emitted < 99 ? (retained.push(boundedDiagnostic(diagnostic)), emitted += 1) : (omitted += 1, diagnostic.severity === "error" && (omittedErrors += 1), omitted === 1 && (pending = boundedDiagnostic(diagnostic)));
154
+ send(retained);
155
+ },
156
+ finish() {
157
+ finished || (finished = !0, omitted === 1 && pending && send([pending]), omitted > 1 && send([
158
+ {
159
+ code: "FRAMEWORK_DIAGNOSTICS_TRUNCATED",
160
+ severity: omittedErrors > 0 ? "error" : "warning",
161
+ message: `${omitted} additional diagnostics were omitted (${omittedErrors} ${omittedErrors === 1 ? "error" : "errors"}). Correct the reported files and repeat the command.`
162
+ }
163
+ ]));
164
+ }
165
+ };
166
+ }
167
+
117
168
  // src/compiler.ts
118
169
  function failure(error) {
119
170
  return { error, status: "failure", type: "result" };
@@ -149,6 +200,16 @@ async function approveComposition(options) {
149
200
  });
150
201
  }
151
202
  async function runFramework(options) {
203
+ if (options.request?.operation === "dev" || options.request?.operation === "build")
204
+ return runFrameworkOperation(options);
205
+ let budget = createDiagnosticBudget(options.onEvent);
206
+ try {
207
+ return await runFrameworkOperation({ ...options, onEvent: budget.emit });
208
+ } finally {
209
+ budget.finish();
210
+ }
211
+ }
212
+ async function runFrameworkOperation(options) {
152
213
  if (options.request?.protocol !== 1)
153
214
  return failure({
154
215
  code: "FRAMEWORK_PROTOCOL_UNSUPPORTED",
@@ -169,15 +230,15 @@ async function runFramework(options) {
169
230
  });
170
231
  try {
171
232
  if (options.signal?.throwIfAborted(), options.request.operation === "build") {
172
- let { runLocalBuild } = await import("./build-operation-2JAYBSKF.js");
233
+ let { runLocalBuild } = await import("./build-operation-5QMLXF7N.js");
173
234
  return await runLocalBuild(options);
174
235
  }
175
236
  if (options.request.operation === "dev") {
176
- let { runDevelopment } = await import("./dev-operation-TZDVJCN7.js");
237
+ let { runDevelopment } = await import("./dev-operation-OSHHWRWK.js");
177
238
  return await runDevelopment(options);
178
239
  }
179
240
  options.onEvent?.({ message: "Validating source", type: "progress" });
180
- let { validatePublishOsSource } = await import("./validate-publish-os-source-DAPZ4QGE.js"), validation = await validatePublishOsSource({
241
+ let { validatePublishOsSource } = await import("./validate-publish-os-source-NZJF3TB2.js"), validation = await validatePublishOsSource({
181
242
  publishOsDir: options.request.paths.source,
182
243
  sourceIdentity: options.request.paths.originalSource ? { sourceRoot: options.request.paths.originalSource } : void 0
183
244
  });
@@ -194,19 +255,19 @@ async function runFramework(options) {
194
255
  fix: "Correct the reported source errors, then run the command again.",
195
256
  message: "The selected source failed validation."
196
257
  });
197
- let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-X4U6Y6QC.js");
258
+ let framework = await readInstalledFramework(), { assertFrameworkSelection } = await import("./framework-selection-ZVO323PK.js");
198
259
  if (await assertFrameworkSelection({
199
260
  context: options.request.context,
200
261
  framework,
201
262
  runtime: validation.source.config.runtime
202
263
  }), options.request.operation === "validate" && options.request.context?.ide) {
203
- let { prepareIdeSupport } = await import("./ide-support-ZNW7ODFY.js");
264
+ let source = validation.source, { prepareIdeSupport } = await import("./ide-support-CU6Z5PVR.js");
204
265
  await prepareIdeSupport({
266
+ frameworkOptions: options,
205
267
  publishOsDir: options.request.paths.source,
206
- finalPublishOsDir: options.request.context.ide.finalSourceRoot,
207
- source: validation.source,
208
- framework,
209
- frameworkOptions: options
268
+ finalPublishOsDir: options.request.context?.ide?.finalSourceRoot,
269
+ source,
270
+ framework
210
271
  });
211
272
  }
212
273
  if (options.request.operation === "compose") {
@@ -223,16 +284,23 @@ async function runFramework(options) {
223
284
  message: "The caller did not authorize composition."
224
285
  });
225
286
  options.signal?.throwIfAborted();
226
- let { composeFrameworkSource } = await import("./compose-NN23UJGC.js");
287
+ let { composeFrameworkSource } = await import("./compose-CVBJRAF6.js");
227
288
  await composeFrameworkSource({
228
289
  request: options.request,
229
290
  source: validation.source,
230
291
  signal: options.signal,
231
292
  onProgress: (message) => options.onEvent?.({ message, type: "progress" }),
232
- onWarning: ({ code, message }) => options.onEvent?.({
293
+ onWarning: ({ code, message, file }) => options.onEvent?.({
233
294
  type: "diagnostics",
234
295
  diagnostics: {
235
- diagnostics: [{ code, message, severity: "warning" }]
296
+ diagnostics: [
297
+ {
298
+ code,
299
+ message,
300
+ severity: "warning",
301
+ ...file ? { file } : {}
302
+ }
303
+ ]
236
304
  }
237
305
  })
238
306
  });
@@ -255,7 +323,8 @@ async function runFramework(options) {
255
323
  }), failure({
256
324
  code: error.code,
257
325
  fix: error instanceof AppError && error.fix ? error.fix : frameworkRecovery(error.code),
258
- message: error.message
326
+ message: error.message,
327
+ ...error instanceof AppError && error.code === "FRAMEWORK_LOCAL_OUTPUT_REDIRECTED" && error.details ? { details: error.details } : {}
259
328
  })) : failure({
260
329
  code: "FRAMEWORK_EXECUTION_FAILED",
261
330
  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_jsx_runtime from 'react/jsx-runtime';
2
+ import { ButtonVariantProps } from '../../kernel/components/ui/button.js';
3
+ import { ReactNode, ComponentPropsWithoutRef } from 'react';
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_runtime.JSX.Element;
54
+ declare function AgentActionsMarkdownLink(): ReactNode;
55
+ declare function AgentActionsPrimaryAction({ action }: {
56
+ action?: AgentActionConfig;
57
+ }): ReactNode;
58
+ declare function AgentActionsFeedback(): react_jsx_runtime.JSX.Element;
59
+ declare function AgentActionsGroup({ title, children, }: {
60
+ title?: string;
61
+ children: ReactNode;
62
+ }): react_jsx_runtime.JSX.Element;
63
+ declare function AgentActionsItem({ action }: {
64
+ action: AgentActionConfig;
65
+ }): ReactNode;
66
+ declare function AgentActionsMenu({ children }: {
67
+ children?: ReactNode;
68
+ }): react_jsx_runtime.JSX.Element;
69
+ declare function AgentActionsRoot(props: AgentActionsProps): react_jsx_runtime.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 };