@open-press/cli 0.8.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +25 -14
  2. package/dist/cli.js +44 -195
  3. package/package.json +4 -5
  4. package/template/core/AGENTS.md +18 -14
  5. package/template/core/CHANGELOG.md +12 -9
  6. package/template/core/README.md +6 -3
  7. package/template/core/engine/cli.mjs +8 -8
  8. package/template/core/engine/commands/_shared.mjs +37 -15
  9. package/template/core/engine/commands/image.mjs +29 -0
  10. package/template/core/engine/commands/skills-sync.mjs +71 -0
  11. package/template/core/engine/commands/typecheck.mjs +63 -1
  12. package/template/core/engine/commands/upgrade.mjs +3 -3
  13. package/template/core/engine/document-export.mjs +1 -1
  14. package/template/core/engine/output/chrome-pdf.mjs +92 -0
  15. package/template/core/engine/output/static-server.mjs +48 -9
  16. package/template/core/engine/react/comment-marker.mjs +13 -13
  17. package/template/core/engine/react/document-entry.mjs +35 -28
  18. package/template/core/engine/react/document-export.mjs +309 -170
  19. package/template/core/engine/react/mdx-compile.mjs +30 -0
  20. package/template/core/engine/react/measurement-css.mjs +21 -0
  21. package/template/core/engine/react/object-entities.mjs +85 -0
  22. package/template/core/engine/react/pagination/allocator.mjs +48 -3
  23. package/template/core/engine/react/pagination.mjs +1 -1
  24. package/template/core/engine/react/pipeline/allocate.mjs +31 -65
  25. package/template/core/engine/react/pipeline/frame-measurement.mjs +4 -0
  26. package/template/core/engine/react/press-tree-inspection.mjs +172 -0
  27. package/template/core/engine/react/sources/mdx-resolver.mjs +1 -1
  28. package/template/core/engine/react/style-discovery.mjs +22 -4
  29. package/template/core/engine/runtime/config.d.mts +8 -0
  30. package/template/core/engine/runtime/config.mjs +57 -60
  31. package/template/core/engine/runtime/file-utils.mjs +9 -1
  32. package/template/core/engine/runtime/page-geometry.mjs +131 -0
  33. package/template/core/engine/runtime/source-text-tools.mjs +1 -1
  34. package/template/core/engine/runtime/source-workspace.mjs +12 -3
  35. package/template/core/engine/runtime/validation.mjs +19 -10
  36. package/template/core/openpress.config.mjs +3 -7
  37. package/template/core/package.json +3 -5
  38. package/template/core/src/openpress/app/OpenPressApp.tsx +173 -17
  39. package/template/core/src/openpress/app/OpenPressRuntime.tsx +10 -2
  40. package/template/core/src/openpress/app/WorkspaceGalleryPage.tsx +219 -0
  41. package/template/core/src/openpress/core/Frame.tsx +20 -7
  42. package/template/core/src/openpress/core/FrameContext.tsx +2 -0
  43. package/template/core/src/openpress/core/Press.tsx +25 -4
  44. package/template/core/src/openpress/core/Workspace.tsx +36 -0
  45. package/template/core/src/openpress/core/index.tsx +10 -3
  46. package/template/core/src/openpress/core/primitives.tsx +48 -1
  47. package/template/core/src/openpress/core/types.ts +86 -41
  48. package/template/core/src/openpress/core/useSource.ts +1 -1
  49. package/template/core/src/openpress/document-model/documentTypes.ts +9 -0
  50. package/template/core/src/openpress/document-model/index.ts +1 -0
  51. package/template/core/src/openpress/document-model/objectEntityModel.ts +4 -0
  52. package/template/core/src/openpress/document-model/workspaceManifestModel.ts +57 -0
  53. package/template/core/src/openpress/mdx/index.ts +15 -7
  54. package/template/core/src/openpress/reader/PageThumbnailsPanel.tsx +168 -0
  55. package/template/core/src/openpress/reader/index.ts +1 -0
  56. package/template/core/src/openpress/workbench/Workbench.tsx +120 -21
  57. package/template/core/src/openpress/workbench/actions/ExportImageControl.tsx +96 -0
  58. package/template/core/src/openpress/workbench/actions/SearchControl.tsx +3 -3
  59. package/template/core/src/openpress/workbench/actions/index.ts +1 -0
  60. package/template/core/src/openpress/workbench/inspector/useInspectorComments.ts +7 -1
  61. package/template/core/src/openpress/workbench/panels/PendingCommentsPanel.tsx +5 -1
  62. package/template/core/src/openpress/workbench/project/ProjectEntryPanel.tsx +4 -2
  63. package/template/core/src/openpress/workbench/workbenchFormatters.ts +2 -2
  64. package/template/core/src/styles/openpress/reader-runtime.css +9 -0
  65. package/template/core/src/styles/openpress/workbench-panels.css +113 -0
  66. package/template/core/src/styles/openpress/workspace-gallery.css +300 -0
  67. package/template/core/src/styles/openpress.css +1 -0
  68. package/template/core/tsconfig.json +1 -1
  69. package/template/core/engine/commands/init.mjs +0 -24
  70. package/template/core/engine/init.mjs +0 -90
  71. package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +0 -35
  72. package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +0 -50
  73. package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +0 -47
  74. package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +0 -26
  75. package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +0 -32
  76. package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +0 -76
  77. package/template/packs/academic-paper/document/components/Page.tsx +0 -60
  78. package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +0 -46
  79. package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +0 -63
  80. package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +0 -38
  81. package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +0 -111
  82. package/template/packs/academic-paper/document/design.md +0 -279
  83. package/template/packs/academic-paper/document/index.tsx +0 -123
  84. package/template/packs/academic-paper/document/media/README.md +0 -13
  85. package/template/packs/academic-paper/document/media/figure-placeholder.svg +0 -9
  86. package/template/packs/academic-paper/document/openpress.config.mjs +0 -26
  87. package/template/packs/academic-paper/document/theme/README.md +0 -11
  88. package/template/packs/academic-paper/document/theme/base/page-contract.css +0 -522
  89. package/template/packs/academic-paper/document/theme/base/print.css +0 -93
  90. package/template/packs/academic-paper/document/theme/base/typography.css +0 -333
  91. package/template/packs/academic-paper/document/theme/fonts.css +0 -3
  92. package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +0 -43
  93. package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +0 -205
  94. package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +0 -294
  95. package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +0 -149
  96. package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +0 -49
  97. package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +0 -68
  98. package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +0 -66
  99. package/template/packs/academic-paper/document/theme/shell/reader-controls.css +0 -761
  100. package/template/packs/academic-paper/document/theme/tokens.css +0 -80
  101. package/template/packs/academic-paper/openpress.config.mjs +0 -5
  102. package/template/packs/claude-document/document/chapters/01-document-shape/content/01-document-shape.mdx +0 -51
  103. package/template/packs/claude-document/document/chapters/02-review-loop/content/01-review-loop.mdx +0 -31
  104. package/template/packs/claude-document/document/components/ChapterOpenerVisual.tsx +0 -96
  105. package/template/packs/claude-document/document/components/Page.tsx +0 -37
  106. package/template/packs/claude-document/document/design.md +0 -142
  107. package/template/packs/claude-document/document/index.tsx +0 -94
  108. package/template/packs/claude-document/document/media/README.md +0 -13
  109. package/template/packs/claude-document/document/openpress.config.mjs +0 -26
  110. package/template/packs/claude-document/document/theme/README.md +0 -15
  111. package/template/packs/claude-document/document/theme/base/page-contract.css +0 -525
  112. package/template/packs/claude-document/document/theme/base/print.css +0 -93
  113. package/template/packs/claude-document/document/theme/base/typography.css +0 -612
  114. package/template/packs/claude-document/document/theme/fonts.css +0 -4
  115. package/template/packs/claude-document/document/theme/page-surfaces/back-cover.css +0 -72
  116. package/template/packs/claude-document/document/theme/page-surfaces/chapter-opener.css +0 -236
  117. package/template/packs/claude-document/document/theme/page-surfaces/cover.css +0 -309
  118. package/template/packs/claude-document/document/theme/page-surfaces/toc.css +0 -225
  119. package/template/packs/claude-document/document/theme/patterns/_chart-frame.css +0 -53
  120. package/template/packs/claude-document/document/theme/patterns/figure-grid.css +0 -68
  121. package/template/packs/claude-document/document/theme/patterns/table-utilities.css +0 -66
  122. package/template/packs/claude-document/document/theme/shell/reader-controls.css +0 -789
  123. package/template/packs/claude-document/document/theme/tokens.css +0 -89
  124. package/template/packs/claude-document/openpress.config.mjs +0 -5
  125. package/template/packs/editorial-monograph/document/chapters/01-product-and-use-cases/content/01-product-and-use-cases.mdx +0 -31
  126. package/template/packs/editorial-monograph/document/chapters/02-workflow/content/01-workflow.mdx +0 -89
  127. package/template/packs/editorial-monograph/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +0 -51
  128. package/template/packs/editorial-monograph/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +0 -39
  129. package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx +0 -76
  130. package/template/packs/editorial-monograph/document/components/Page.tsx +0 -37
  131. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/index.tsx +0 -46
  132. package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/style.css +0 -63
  133. package/template/packs/editorial-monograph/document/components/TypeSpecimen/index.tsx +0 -38
  134. package/template/packs/editorial-monograph/document/components/TypeSpecimen/style.css +0 -111
  135. package/template/packs/editorial-monograph/document/design.md +0 -279
  136. package/template/packs/editorial-monograph/document/index.tsx +0 -97
  137. package/template/packs/editorial-monograph/document/media/README.md +0 -13
  138. package/template/packs/editorial-monograph/document/openpress.config.mjs +0 -26
  139. package/template/packs/editorial-monograph/document/theme/README.md +0 -11
  140. package/template/packs/editorial-monograph/document/theme/base/page-contract.css +0 -505
  141. package/template/packs/editorial-monograph/document/theme/base/print.css +0 -93
  142. package/template/packs/editorial-monograph/document/theme/base/typography.css +0 -336
  143. package/template/packs/editorial-monograph/document/theme/fonts.css +0 -3
  144. package/template/packs/editorial-monograph/document/theme/page-surfaces/back-cover.css +0 -43
  145. package/template/packs/editorial-monograph/document/theme/page-surfaces/chapter-opener.css +0 -205
  146. package/template/packs/editorial-monograph/document/theme/page-surfaces/cover.css +0 -147
  147. package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +0 -149
  148. package/template/packs/editorial-monograph/document/theme/patterns/_chart-frame.css +0 -49
  149. package/template/packs/editorial-monograph/document/theme/patterns/figure-grid.css +0 -68
  150. package/template/packs/editorial-monograph/document/theme/patterns/table-utilities.css +0 -66
  151. package/template/packs/editorial-monograph/document/theme/shell/reader-controls.css +0 -761
  152. package/template/packs/editorial-monograph/document/theme/tokens.css +0 -80
  153. package/template/packs/editorial-monograph/openpress.config.mjs +0 -5
@@ -0,0 +1,300 @@
1
+ /* Workspace gallery — the reader's landing page for multi-Press
2
+ workspaces. Shows a card per <Press> child; clicking enters that
3
+ document's reader. Single-Press workspaces skip the gallery and
4
+ load the document directly, so this CSS is dormant until users
5
+ add a second <Press> to their <Workspace>.
6
+
7
+ Layout intent: Figma-style file grid — uniform card width, fixed
8
+ thumbnail aspect ratio (4:3), filename + meta below. Each card
9
+ loads its first page asynchronously and renders it scaled-down
10
+ inside the thumbnail slot. */
11
+
12
+ .openpress-workspace-gallery {
13
+ --workspace-bg: #10110f;
14
+ --workspace-bg-soft: #171813;
15
+ --workspace-ink: #f4f1e8;
16
+ --workspace-muted: rgba(244, 241, 232, 0.52);
17
+ --workspace-line: rgba(244, 241, 232, 0.12);
18
+ --workspace-card: #f7f5ee;
19
+ --workspace-card-ink: #141411;
20
+ --workspace-card-muted: #65635d;
21
+ --workspace-card-line: rgba(20, 20, 17, 0.1);
22
+ --workspace-card-stage: #e8e5dc;
23
+ display: grid;
24
+ gap: 2rem;
25
+ min-height: 100vh;
26
+ max-width: none;
27
+ margin: 0;
28
+ padding: 3.6rem clamp(2rem, 4vw, 4.5rem) 6rem;
29
+ font-family: var(--openpress-font-body, system-ui, sans-serif);
30
+ color: var(--workspace-ink);
31
+ background:
32
+ linear-gradient(180deg, var(--workspace-bg-soft), var(--workspace-bg) 42rem),
33
+ var(--workspace-bg);
34
+ }
35
+
36
+ .openpress-workspace-gallery__header {
37
+ display: grid;
38
+ grid-template-columns: minmax(0, 1fr) auto;
39
+ align-items: end;
40
+ justify-content: space-between;
41
+ gap: 2.5rem;
42
+ padding: 0 0 1.45rem;
43
+ border-bottom: 1px solid var(--workspace-line);
44
+ }
45
+
46
+ .openpress-workspace-gallery__headline {
47
+ display: grid;
48
+ gap: 0.75rem;
49
+ }
50
+
51
+ .openpress-workspace-gallery__eyebrow {
52
+ margin: 0;
53
+ color: var(--workspace-muted);
54
+ font-family: var(--openpress-font-mono, ui-monospace, monospace);
55
+ font-size: 0.68rem;
56
+ font-weight: 600;
57
+ letter-spacing: 0.16em;
58
+ text-transform: uppercase;
59
+ }
60
+
61
+ .openpress-workspace-gallery__header h1 {
62
+ margin: 0;
63
+ font-family: var(--openpress-font-display, var(--openpress-font-body, system-ui));
64
+ font-size: clamp(2.6rem, 5.4vw, 5.2rem);
65
+ font-weight: 720;
66
+ line-height: 0.94;
67
+ letter-spacing: -0.035em;
68
+ color: var(--workspace-ink);
69
+ }
70
+
71
+ .openpress-workspace-gallery__count {
72
+ margin: 0;
73
+ display: grid;
74
+ justify-items: end;
75
+ gap: 0.25rem;
76
+ min-width: 4.5rem;
77
+ color: var(--workspace-ink);
78
+ font-family: var(--openpress-font-mono, ui-monospace, monospace);
79
+ line-height: 1;
80
+ }
81
+
82
+ .openpress-workspace-gallery__count span {
83
+ color: var(--workspace-ink);
84
+ font-size: 2rem;
85
+ font-weight: 500;
86
+ letter-spacing: -0.04em;
87
+ }
88
+
89
+ .openpress-workspace-gallery__count small {
90
+ color: var(--workspace-muted);
91
+ font-size: 0.62rem;
92
+ font-weight: 600;
93
+ letter-spacing: 0.14em;
94
+ text-transform: uppercase;
95
+ }
96
+
97
+ .openpress-workspace-gallery__grid {
98
+ list-style: none;
99
+ margin: 0;
100
+ padding: 0;
101
+ display: grid;
102
+ align-items: start;
103
+ /* Uniform card size — Figma-style. Outer thumb is fixed 4:3, the
104
+ inner page letterboxes to its own geometry. */
105
+ grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
106
+ gap: 1.5rem;
107
+ }
108
+
109
+ .openpress-workspace-gallery__item {
110
+ display: flex;
111
+ }
112
+
113
+ .openpress-workspace-gallery__card {
114
+ appearance: none;
115
+ display: grid;
116
+ grid-template-rows: auto minmax(6.75rem, auto);
117
+ align-self: start;
118
+ width: 100%;
119
+ padding: 0;
120
+ border: 1px solid rgba(255, 255, 255, 0.08);
121
+ border-radius: 8px;
122
+ background: var(--workspace-card);
123
+ color: var(--workspace-card-ink);
124
+ text-align: left;
125
+ cursor: pointer;
126
+ overflow: hidden;
127
+ transition:
128
+ transform 160ms ease,
129
+ box-shadow 160ms ease,
130
+ border-color 160ms ease;
131
+ }
132
+
133
+ .openpress-workspace-gallery__card:hover,
134
+ .openpress-workspace-gallery__card:focus-visible {
135
+ border-color: rgba(255, 255, 255, 0.28);
136
+ transform: translateY(-2px);
137
+ box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
138
+ outline: none;
139
+ }
140
+
141
+ .openpress-workspace-gallery__thumb {
142
+ position: relative;
143
+ display: block;
144
+ width: 100%;
145
+ /* Uniform 4:3 outer slot across every card. The page itself
146
+ letterboxes inside via centered scale, so each Press shows at its
147
+ own true aspect against the gradient background. */
148
+ aspect-ratio: 4 / 3;
149
+ background:
150
+ linear-gradient(
151
+ 135deg,
152
+ color-mix(in srgb, var(--workspace-card-ink) 5%, var(--workspace-card-stage)),
153
+ var(--workspace-card-stage)
154
+ );
155
+ border-bottom: 1px solid var(--workspace-card-line);
156
+ overflow: hidden;
157
+ }
158
+
159
+ .openpress-workspace-gallery__thumb::before {
160
+ content: "";
161
+ position: absolute;
162
+ inset: 0;
163
+ pointer-events: none;
164
+ background-image:
165
+ linear-gradient(rgba(20, 20, 17, 0.05) 1px, transparent 1px),
166
+ linear-gradient(90deg, rgba(20, 20, 17, 0.05) 1px, transparent 1px);
167
+ background-size: 24px 24px;
168
+ opacity: 0.5;
169
+ }
170
+
171
+ .openpress-workspace-gallery__thumb-stage {
172
+ position: absolute;
173
+ inset: clamp(0.85rem, 6%, 1.45rem);
174
+ display: grid;
175
+ place-items: center;
176
+ }
177
+
178
+ .openpress-workspace-gallery__thumb-frame {
179
+ position: relative;
180
+ box-shadow:
181
+ 0 18px 36px rgba(20, 20, 17, 0.18),
182
+ 0 0 0 1px rgba(20, 20, 17, 0.08);
183
+ }
184
+
185
+ .openpress-workspace-gallery__thumb-stage .openpress-public-page {
186
+ display: block;
187
+ pointer-events: none;
188
+ user-select: none;
189
+ }
190
+
191
+ .openpress-workspace-gallery__thumb-placeholder {
192
+ position: absolute;
193
+ inset: clamp(0.85rem, 6%, 1.45rem);
194
+ display: grid;
195
+ place-items: center;
196
+ }
197
+
198
+ .openpress-workspace-gallery__thumb-skel {
199
+ display: block;
200
+ width: 70%;
201
+ height: 70%;
202
+ background:
203
+ repeating-linear-gradient(
204
+ 135deg,
205
+ rgba(20, 20, 17, 0.04) 0 6px,
206
+ transparent 6px 14px
207
+ ),
208
+ #fff;
209
+ border: 1px solid var(--workspace-card-line);
210
+ border-radius: 3px;
211
+ box-shadow: 0 14px 28px rgba(20, 20, 17, 0.14);
212
+ }
213
+
214
+ .openpress-workspace-gallery__thumb-placeholder[data-state="loading"] .openpress-workspace-gallery__thumb-skel {
215
+ animation: openpress-gallery-skel-pulse 1.4s ease-in-out infinite;
216
+ }
217
+
218
+ @keyframes openpress-gallery-skel-pulse {
219
+ 0%, 100% { opacity: 1; }
220
+ 50% { opacity: 0.55; }
221
+ }
222
+
223
+ .openpress-workspace-gallery__body {
224
+ display: grid;
225
+ align-content: space-between;
226
+ gap: 1.2rem;
227
+ min-height: 6.75rem;
228
+ padding: 1.1rem 1.22rem 1.15rem;
229
+ background: var(--workspace-card);
230
+ }
231
+
232
+ .openpress-workspace-gallery__title {
233
+ display: block;
234
+ color: var(--workspace-card-ink);
235
+ font-size: 1rem;
236
+ font-weight: 700;
237
+ line-height: 1.2;
238
+ white-space: nowrap;
239
+ overflow: hidden;
240
+ text-overflow: ellipsis;
241
+ }
242
+
243
+ .openpress-workspace-gallery__meta {
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ gap: 0.7rem;
248
+ flex-wrap: wrap;
249
+ color: var(--workspace-card-muted);
250
+ font-family: var(--openpress-font-mono, ui-monospace, monospace);
251
+ font-size: 0.66rem;
252
+ letter-spacing: 0.03em;
253
+ }
254
+
255
+ .openpress-workspace-gallery__slug {
256
+ max-width: 13rem;
257
+ color: color-mix(in srgb, var(--workspace-card-ink) 72%, transparent);
258
+ font-weight: 500;
259
+ overflow: hidden;
260
+ text-overflow: ellipsis;
261
+ text-transform: uppercase;
262
+ white-space: nowrap;
263
+ }
264
+
265
+ .openpress-workspace-gallery__dot {
266
+ color: color-mix(in srgb, var(--workspace-card-muted) 55%, transparent);
267
+ }
268
+
269
+ .openpress-workspace-gallery__pages,
270
+ .openpress-workspace-gallery__geom {
271
+ color: var(--workspace-card-muted);
272
+ }
273
+
274
+ .openpress-workspace-gallery__geom {
275
+ display: inline-flex;
276
+ align-items: center;
277
+ min-height: 1.35rem;
278
+ padding: 0 0.48rem;
279
+ border: 1px solid var(--workspace-card-line);
280
+ border-radius: 4px;
281
+ background: rgba(255, 255, 255, 0.36);
282
+ color: color-mix(in srgb, var(--workspace-card-ink) 76%, transparent);
283
+ font-size: 0.62rem;
284
+ white-space: nowrap;
285
+ }
286
+
287
+ @media (max-width: 720px) {
288
+ .openpress-workspace-gallery {
289
+ padding: 2.25rem 1rem 4rem;
290
+ }
291
+
292
+ .openpress-workspace-gallery__header {
293
+ display: grid;
294
+ align-items: start;
295
+ }
296
+
297
+ .openpress-workspace-gallery__grid {
298
+ grid-template-columns: 1fr;
299
+ }
300
+ }
@@ -4,6 +4,7 @@
4
4
  @import url("/openpress/components.css");
5
5
 
6
6
  @import "./openpress/app-shell.css";
7
+ @import "./openpress/workspace-gallery.css";
7
8
  @import "./openpress/workbench.css";
8
9
  @import "./openpress/workbench-panels.css";
9
10
  @import "./openpress/project-preview-panel.css";
@@ -11,7 +11,7 @@
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "module": "ESNext",
13
13
  "moduleResolution": "Bundler",
14
- "types": ["node", "vite/client"],
14
+ "types": ["node"],
15
15
  "resolveJsonModule": true,
16
16
  "isolatedModules": true,
17
17
  "noEmit": true,
@@ -1,24 +0,0 @@
1
- import { initWorkspace, listStylePackSkills } from "../init.mjs";
2
- import { formatDisplayPath, parseInitOptions } from "./_shared.mjs";
3
-
4
- export const needsWorkspace = false;
5
-
6
- export async function run({ argv }) {
7
- const options = parseInitOptions(argv);
8
- if (!options.target) {
9
- console.error("openpress init: target path is required");
10
- console.error("Usage: openpress init <target> [--skill <name>] [--force]");
11
- const available = await listStylePackSkills();
12
- if (available.length) console.error(`Style packs available: ${available.join(", ")}`);
13
- return 1;
14
- }
15
- const result = await initWorkspace(options);
16
- const displayPath = formatDisplayPath(result.targetPath);
17
- console.log(`OpenPress init: created ${displayPath} from style pack "${result.skill}".`);
18
- console.log("Next steps:");
19
- console.log(` cd ${displayPath}`);
20
- console.log(" # 填入 openpress.config.mjs 的 title / subtitle / organization");
21
- console.log(" # 改 document/index.tsx 與 document/chapters/**/*.mdx 為實際內容");
22
- console.log(" node engine/cli.mjs validate");
23
- return 0;
24
- }
@@ -1,90 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- const SELF_DIR = path.dirname(fileURLToPath(import.meta.url));
6
- const ENGINE_ROOT = path.resolve(SELF_DIR, "..");
7
- const SKILLS_DIR = path.join(ENGINE_ROOT, "skills");
8
-
9
- const DEFAULT_SKILL = "editorial-monograph";
10
-
11
- export async function initWorkspace({ target, skill = DEFAULT_SKILL, force = false }) {
12
- if (!target) throw new Error("openpress init: target path is required");
13
- const targetPath = path.resolve(target);
14
-
15
- const starterPath = path.join(SKILLS_DIR, skill, "starter");
16
- try {
17
- const stat = await fs.stat(starterPath);
18
- if (!stat.isDirectory()) {
19
- throw new Error(`openpress init: skill "${skill}" has no starter/ directory at ${starterPath}`);
20
- }
21
- } catch (error) {
22
- if (error?.code === "ENOENT") {
23
- const available = await listStylePackSkills();
24
- throw new Error(
25
- `openpress init: skill "${skill}" not found or has no starter. ` +
26
- `Available style packs: ${available.join(", ") || "(none)"}`,
27
- );
28
- }
29
- throw error;
30
- }
31
-
32
- if (!force) {
33
- try {
34
- const stat = await fs.stat(targetPath);
35
- if (stat.isDirectory()) {
36
- const entries = await fs.readdir(targetPath);
37
- if (entries.length > 0) {
38
- throw new Error(`openpress init: target ${targetPath} exists and is not empty. Pass --force to overwrite.`);
39
- }
40
- } else {
41
- throw new Error(`openpress init: target ${targetPath} exists and is not a directory.`);
42
- }
43
- } catch (error) {
44
- if (error?.code !== "ENOENT") throw error;
45
- }
46
- }
47
-
48
- await fs.mkdir(targetPath, { recursive: true });
49
- await copyDirectory(starterPath, targetPath);
50
-
51
- return { targetPath, skill };
52
- }
53
-
54
- export async function listStylePackSkills() {
55
- try {
56
- const entries = await fs.readdir(SKILLS_DIR, { withFileTypes: true });
57
- const names = [];
58
- for (const entry of entries) {
59
- if (!entry.isDirectory()) continue;
60
- const starter = path.join(SKILLS_DIR, entry.name, "starter");
61
- try {
62
- const stat = await fs.stat(starter);
63
- if (stat.isDirectory()) names.push(entry.name);
64
- } catch {
65
- // skill without starter/ is not a style pack — skip
66
- }
67
- }
68
- return names.sort();
69
- } catch (error) {
70
- if (error?.code === "ENOENT") return [];
71
- throw error;
72
- }
73
- }
74
-
75
- async function copyDirectory(source, destination) {
76
- await fs.mkdir(destination, { recursive: true });
77
- for (const entry of await fs.readdir(source, { withFileTypes: true })) {
78
- if (entry.name === ".DS_Store") continue;
79
- const sourcePath = path.join(source, entry.name);
80
- const destPath = path.join(destination, entry.name);
81
- if (entry.isDirectory()) {
82
- await copyDirectory(sourcePath, destPath);
83
- } else if (entry.isFile()) {
84
- await fs.copyFile(sourcePath, destPath);
85
- } else if (entry.isSymbolicLink()) {
86
- const link = await fs.readlink(sourcePath);
87
- await fs.symlink(link, destPath);
88
- }
89
- }
90
- }
@@ -1,35 +0,0 @@
1
- ## Introduction
2
-
3
- The purpose of this paper template is to provide a compact, readable structure for a
4
- machine-learning research manuscript written in a formal journal style.
5
-
6
- ### Background and Motivation
7
-
8
- Recent studies have shown that modern experiments produce larger datasets and richer
9
- artifact pipelines, but the writing process is often bottlenecked by repeated formatting
10
- adjustments. A lightweight drafting layer can decouple scientific reasoning from
11
- typesetting concerns and let the author focus on experimental validity first.
12
-
13
- ### Problem Statement
14
-
15
- The key challenge addressed in this draft is to keep the manuscript internally
16
- consistent while moving from scratch notes to a submission-ready narrative. The
17
- workflow should preserve section hierarchy, citation order, and figure/table integrity
18
- without requiring manual renumbering.
19
-
20
- ### Contribution
21
-
22
- This demo paper includes the following contributions:
23
-
24
- - A reproducible chapter flow (`Introduction → Methods → Results and Discussion →
25
- Conclusion`),
26
- - Consistent heading levels for major and minor sections,
27
- - Placeholder media and tables that can be swapped with real results,
28
- - A reference block and placeholder metadata for a clean handoff to final publication
29
- tooling.
30
-
31
- ### Paper Organization
32
-
33
- The paper is organized as follows: Section 2 details the methodology,
34
- Section 3 reports results and discusses representative scenarios,
35
- Section 4 summarizes conclusions and practical recommendations.
@@ -1,50 +0,0 @@
1
- ## Methods
2
-
3
- This section describes a hypothetical experimental design suitable for an applied
4
- machine-learning paper.
5
-
6
- ### Data and Problem Setup
7
-
8
- We assume a synthetic dataset with 3,200 anonymized samples collected under three
9
- operational conditions. Each sample includes paired feature vectors, timestamped
10
- metadata, and a binary outcome label. The baseline split is 70/15/15 for training,
11
- validation, and held-out test sets.
12
-
13
- ### Core Pipeline
14
-
15
- The pipeline has three stages:
16
-
17
- 1. **Preprocessing**: normalization, missing-value handling, and feature screening.
18
- 2. **Modeling**: training a compact baseline model and a comparison ablation set.
19
- 3. **Evaluation**: calibration-aware scoring and bootstrapped confidence intervals.
20
-
21
- For this draft, preprocessing includes clipping extreme values and aligning all
22
- continuous fields to SI-style unit notation.
23
-
24
- ### Equations
25
-
26
- The main objective is written as:
27
-
28
- $$
29
- \mathcal{L}(\theta) = \sum_{i=1}^{N}\left(\hat{y}_{i}(\theta)-y_{i}\right)^2
30
- $$
31
-
32
- where $\theta$ are trainable parameters and the objective is minimized on the
33
- training subset.
34
-
35
- ### Evaluation Protocol
36
-
37
- Model quality is measured by macro-averaged F1, AUROC, and an uncertainty-aware
38
- calibration score. Reproducibility is ensured by fixing the random seed and logging
39
- all preprocessing parameters.
40
-
41
- ### Implementation Notes
42
-
43
- - All runs were executed on a dual-socket compute node with two GPUs.
44
- - Checkpoints were stored every 5 epochs.
45
- - Logging followed a single JSON schema shared across all experiments.
46
-
47
- ### Validation and Quality Control
48
-
49
- Validation is automated through a script that checks missing captions, file path
50
- consistency, and reference formatting before final export.
@@ -1,47 +0,0 @@
1
- ## Results and Discussion
2
-
3
- ### Benchmark Results
4
-
5
- The synthetic experiment yields a consistent improvement trend across three datasets.
6
- Performance gains are modest but stable after hyperparameter tuning.
7
-
8
- | Metric | Baseline | Proposed | Improvement |
9
- | --- | --- | --- | --- |
10
- | Macro-F1 | 0.61 | 0.67 | +9.8% |
11
- | AUROC | 0.74 | 0.81 | +9.5% |
12
- | Calibration Error | 0.082 | 0.043 | -47.6% |
13
-
14
- The proposed model retains a similar variance profile while improving score
15
- stability in low-sample conditions.
16
-
17
- ### Representative Visualization
18
-
19
- <img
20
- src="media/figure-placeholder.svg"
21
- alt="Example of a figure placeholder"
22
- style={{ maxWidth: "420px", width: "100%", height: "auto" }}
23
- />
24
-
25
- Figure 1. Example of a result trend visualization (placeholder image).
26
-
27
- ### Error Analysis
28
-
29
- Some error cases cluster around edge classes with incomplete metadata. These cases
30
- benefit from better augmentation and a revised class-balanced loss.
31
-
32
- ### Sensitivity Study
33
-
34
- - Training set size below 40% causes a steeper drop in recall.
35
- - Early stopping thresholds above 3 epochs reduce overfitting in our setting.
36
- - Calibrated post-processing improves confidence robustness.
37
-
38
- ### Discussion
39
-
40
- The most practical takeaway is that small engineering changes in preprocessing and
41
- evaluation discipline can produce measurable gains even when architecture changes are
42
- minimal.
43
-
44
- ### Limitations
45
-
46
- This section reports synthetic results only; real-world deployment would require
47
- cross-domain validation, privacy checks, and a stronger external benchmark suite.
@@ -1,26 +0,0 @@
1
- ## Conclusions
2
-
3
- This template run shows that a simple methodology with consistent evaluation
4
- accounting can achieve reliable gains without dramatic architectural complexity.
5
-
6
- ### Key Takeaways
7
-
8
- - Keep preprocessing and metric reporting deterministic.
9
- - Use a calibrated validation protocol before reporting final headline scores.
10
- - Reserve model complexity for problems that cannot be solved with better data
11
- discipline.
12
-
13
- ### Practical Recommendations
14
-
15
- Authors are encouraged to replace each placeholder paragraph with real study details,
16
- including hardware, code provenance, and full reproducibility statements.
17
-
18
- ### Limitations and Future Work
19
-
20
- The current draft is synthetic; external generalization remains to be demonstrated.
21
- Future work should add domain transfer tests and a public benchmark release.
22
-
23
- ### Acknowledgments
24
-
25
- We thank the hypothetical reviewers and platform contributors who would have reviewed
26
- this draft in a real submission round.
@@ -1,32 +0,0 @@
1
- ## References
2
-
3
- Please number references consecutively within brackets `[1]`.
4
- Sentence punctuation follows the bracketed number.
5
-
6
- ---
7
-
8
- [1] G. Eason, B. Noble, and I. N. Sneddon, “On certain integrals of
9
- Lipschitz-Hankel type involving products of Bessel functions,” *Phil. Trans. Roy.
10
- Soc. London*, vol. A247, pp. 529–551, April 1955.
11
-
12
- [2] J. Clerk Maxwell, *A Treatise on Electricity and Magnetism*, 3rd ed., vol. 2.
13
- Oxford: Clarendon, 1892, pp. 68–73.
14
-
15
- [3] I. S. Jacobs and C. P. Bean, “Fine particles, thin films and exchange anisotropy,”
16
- in *Magnetism*, vol. III, G. T. Rado and H. Suhl, Eds. New York: Academic,
17
- 1963, pp. 271–350.
18
-
19
- [4] K. Elissa, “Title of paper if known,” unpublished.
20
-
21
- [5] R. Nicole, “Title of paper with only first word capitalized,” *J. Name Stand.
22
- Abbrev.*, in press.
23
-
24
- [6] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, “Electron spectroscopy studies
25
- on magneto-optical media and plastic substrate interface,” *IEEE Trans. J. Magn.
26
- Japan*, vol. 2, pp. 740–741, August 1987.
27
-
28
- [7] M. Young, *The Technical Writer&apos;s Handbook*. Mill Valley, CA: University
29
- Science, 1989.
30
-
31
- > Open-press is used for iteration. Remove all template placeholder text and replace
32
- > references before submission.