gutterpress 0.9.0-alpha.2 → 0.10.0-alpha.4

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 (138) hide show
  1. package/README.md +18 -4
  2. package/dist/api/index.d.ts +11 -5
  3. package/dist/api/index.js +20 -15
  4. package/dist/assets/preview/scripts/preview-bridge.d.ts +1 -0
  5. package/dist/assets/preview/scripts/preview-interface.d.ts +1 -0
  6. package/dist/{audit-nhn2pjz3.js → audit-k1vnfwvc.js} +10 -7
  7. package/dist/{build-san7fv2z.js → build-hqmwgvdw.js} +14 -8
  8. package/dist/checks/source/index.d.ts +1 -0
  9. package/dist/checks/source/layout-markers.d.ts +3 -0
  10. package/dist/checks/source/local-ref-parser.d.ts +28 -0
  11. package/dist/{cli-e5zhb0xs.js → cli-0r0tq16s.js} +17 -24
  12. package/dist/cli-46ycxe6r.js +18 -0
  13. package/dist/cli-c41yr7he.js +241 -0
  14. package/dist/cli-hp9r2pzt.js +2343 -0
  15. package/dist/{index-yzrh708h.js → cli-k1065rkg.js} +2 -5
  16. package/dist/{cli-k4bd06sd.js → cli-n25qycwz.js} +4986 -5889
  17. package/dist/{cli-najycadg.js → cli-ra0ed2xt.js} +69 -253
  18. package/dist/{cli-506tg37g.js → cli-revgt4pr.js} +2 -1
  19. package/dist/{cli-wchtvxvw.js → cli-v5mp7a6q.js} +14 -1
  20. package/dist/cli.js +20 -18
  21. package/dist/{doctor-hrk0kxxz.js → doctor-dxms7ehm.js} +4 -2
  22. package/dist/engine/compiler/build.d.ts +139 -0
  23. package/dist/engine/compiler/postprocess.d.ts +23 -0
  24. package/dist/engine/compiler/tier2.d.ts +78 -0
  25. package/dist/engine/shared/cdp.d.ts +104 -0
  26. package/dist/engine/shared/content-value.d.ts +64 -0
  27. package/dist/engine/shared/gcpm-extract.d.ts +119 -0
  28. package/dist/engine/shared/margin-box-support.d.ts +12 -0
  29. package/dist/engine/shared/pdf-inspect.d.ts +24 -0
  30. package/dist/engine/shared/synthesis.d.ts +155 -0
  31. package/dist/engine-wa7y9av9.js +41 -0
  32. package/dist/engine-z4p9sr4h.js +40 -0
  33. package/dist/gutterpress-agent-1ctgfz92.js +576 -0
  34. package/dist/gutterpress-viewer-cem7dmr5.js +2349 -0
  35. package/dist/{index-bynn850m.js → index-05y3dnxq.js} +3049 -4015
  36. package/dist/index-9tyq9kks.js +708 -0
  37. package/dist/{cli-yzrh708h.js → index-mdefp0y5.js} +1 -1
  38. package/dist/{index-wchtvxvw.js → index-v5mp7a6q.js} +14 -1
  39. package/dist/index-xxg4zfrg.js +1907 -0
  40. package/dist/index.d.ts +3 -1
  41. package/dist/index.js +24 -17
  42. package/dist/lib/asset-inline.d.ts +36 -0
  43. package/dist/lib/browser-pool.d.ts +18 -0
  44. package/dist/lib/build-error.d.ts +1 -1
  45. package/dist/lib/build-preflight.d.ts +35 -2
  46. package/dist/lib/build-runner.d.ts +45 -17
  47. package/dist/lib/build-staging.d.ts +9 -55
  48. package/dist/lib/cli-args.d.ts +8 -0
  49. package/dist/lib/desktop.d.ts +2 -2
  50. package/dist/lib/embedded-assets.d.ts +1 -1
  51. package/dist/lib/engine.d.ts +33 -0
  52. package/dist/lib/ghostscript.d.ts +46 -1
  53. package/dist/lib/markdown/assemble.d.ts +18 -10
  54. package/dist/lib/markdown/gp-pin-scope.d.ts +1 -0
  55. package/dist/lib/markdown/gutterpress-css.d.ts +125 -0
  56. package/dist/lib/markdown/images.d.ts +26 -0
  57. package/dist/lib/markdown/index.d.ts +4 -2
  58. package/dist/lib/markdown/inline-source.d.ts +10 -0
  59. package/dist/lib/markdown/markers.d.ts +32 -0
  60. package/dist/lib/markdown/renderer.d.ts +8 -3
  61. package/dist/lib/markdown/source-range.d.ts +61 -0
  62. package/dist/lib/missing-asset-placeholder.d.ts +52 -0
  63. package/dist/lib/presets.d.ts +1 -1
  64. package/dist/lib/printsafe.d.ts +2 -3
  65. package/dist/lib/remote-auth/converge-merge.d.ts +48 -0
  66. package/dist/lib/remote-auth/image-clash.d.ts +17 -0
  67. package/dist/lib/remote-auth/recovery/classify.d.ts +55 -67
  68. package/dist/lib/remote-auth/recovery/inspect.d.ts +14 -13
  69. package/dist/lib/remote-auth/recovery/locks.d.ts +20 -0
  70. package/dist/lib/remote-auth/recovery/repair.d.ts +29 -0
  71. package/dist/lib/remote-auth/recovery/types.d.ts +8 -204
  72. package/dist/lib/remote-auth/sync-messages.d.ts +2 -3
  73. package/dist/lib/remote-auth/sync-types.d.ts +35 -63
  74. package/dist/lib/remote-auth/sync.d.ts +11 -18
  75. package/dist/lib/remote-auth/transport.d.ts +14 -7
  76. package/dist/lib/theme-import.d.ts +4 -5
  77. package/dist/{lint-96j9hrj4.js → lint-xjwm5ep8.js} +10 -7
  78. package/dist/{manifest.schema-z61rzw44.json → manifest.schema-zxgxnbg7.json} +21 -0
  79. package/dist/{new-8p38wavc.js → new-kwdwpf0j.js} +12 -8
  80. package/dist/{plugin-ees6nhkc.js → plugin-rg4tnn96.js} +10 -7
  81. package/dist/{preflight-1q6c2edh.js → preflight-3127y25z.js} +10 -7
  82. package/dist/preview/file-watcher.d.ts +13 -17
  83. package/dist/preview/lifecycle.d.ts +1 -1
  84. package/dist/{pagedjs-bridge-vn4hk9fx.js → preview-bridge-fz7vpk8m.js} +8 -0
  85. package/dist/preview-interface-435cczt5.js +1059 -0
  86. package/dist/{preview-y5a2zen1.js → preview-ncgfhqmw.js} +16 -9
  87. package/dist/preview-shell-c5mfa3q0.js +346 -0
  88. package/dist/{project-source-p0gn1wd5.js → project-source-ekcyp63q.js} +1 -1
  89. package/dist/{publish-rm9yb3wh.js → publish-pr0rwh6p.js} +10 -7
  90. package/dist/render.d.ts +3 -4
  91. package/dist/render.js +728 -64
  92. package/dist/{repair-zgq7q2g6.js → repair-8270smfw.js} +45 -79
  93. package/dist/schema/manifest.types.d.ts +38 -0
  94. package/dist/{source-provider-c1rjm2c0.js → source-provider-3tcj6qg2.js} +2 -2
  95. package/dist/source-provider-vanafrt9.js +40 -0
  96. package/dist/{theme-zz2ktzqs.css → theme-h5recz6c.css} +8 -7
  97. package/dist/{theme-570zmh2t.css → theme-j2bagrfx.css} +8 -7
  98. package/dist/{theme-nya4nqh6.css → theme-nn6d53zy.css} +8 -7
  99. package/dist/types.d.ts +7 -0
  100. package/dist/{validate-nr0xa6sa.js → validate-54e17rae.js} +10 -7
  101. package/package.json +6 -6
  102. package/dist/cli-yja077f6.js +0 -92
  103. package/dist/git-http-yrb4ag6z.js +0 -17
  104. package/dist/index-yja077f6.js +0 -92
  105. package/dist/lib/markdown/markdown-it-paged.d.ts +0 -30
  106. package/dist/lib/pagedjs-marker.d.ts +0 -42
  107. package/dist/lib/pagedjs.d.ts +0 -26
  108. package/dist/lib/pagination.d.ts +0 -149
  109. package/dist/lib/remote-auth/conflict-resolution.d.ts +0 -29
  110. package/dist/lib/remote-auth/recovery/abort-interrupted-operation.d.ts +0 -103
  111. package/dist/lib/remote-auth/recovery/backup.d.ts +0 -113
  112. package/dist/lib/remote-auth/recovery/context.d.ts +0 -47
  113. package/dist/lib/remote-auth/recovery/dispatch.d.ts +0 -28
  114. package/dist/lib/remote-auth/recovery/failsafe.d.ts +0 -33
  115. package/dist/lib/remote-auth/recovery/manual-guidance.d.ts +0 -28
  116. package/dist/lib/remote-auth/recovery/outcome-mapping.d.ts +0 -59
  117. package/dist/lib/remote-auth/recovery/policy.d.ts +0 -47
  118. package/dist/lib/remote-auth/recovery/recover-auth.d.ts +0 -42
  119. package/dist/lib/remote-auth/recovery/recover-binary-conflict.d.ts +0 -37
  120. package/dist/lib/remote-auth/recovery/recover-corrupt-index.d.ts +0 -40
  121. package/dist/lib/remote-auth/recovery/recover-detached-head.d.ts +0 -70
  122. package/dist/lib/remote-auth/recovery/recover-interrupted-cherry-pick.d.ts +0 -23
  123. package/dist/lib/remote-auth/recovery/recover-interrupted-merge.d.ts +0 -28
  124. package/dist/lib/remote-auth/recovery/recover-interrupted-rebase.d.ts +0 -39
  125. package/dist/lib/remote-auth/recovery/recover-merge-conflict.d.ts +0 -34
  126. package/dist/lib/remote-auth/recovery/recover-missing-git-dir.d.ts +0 -37
  127. package/dist/lib/remote-auth/recovery/recover-missing-objects.d.ts +0 -56
  128. package/dist/lib/remote-auth/recovery/recover-network.d.ts +0 -34
  129. package/dist/lib/remote-auth/recovery/recover-non-fast-forward.d.ts +0 -27
  130. package/dist/lib/remote-auth/recovery/recover-stale-lock.d.ts +0 -68
  131. package/dist/lib/remote-auth/recovery/recover-unrelated-histories.d.ts +0 -44
  132. package/dist/lib/remote-auth/recovery/recover-wrong-remote.d.ts +0 -35
  133. package/dist/lib/remote-auth/resolution-plan.d.ts +0 -64
  134. package/dist/paged.polyfill-n95pbxfn.js +0 -33288
  135. package/dist/pagedjs-interface-qxvzgwd7.js +0 -557
  136. package/dist/preview-shell-6dqexx1m.js +0 -581
  137. /package/dist/assets/{preview/scripts/pagedjs-bridge.d.ts → engine/gutterpress-agent.d.ts} +0 -0
  138. /package/dist/assets/{preview/scripts/pagedjs-interface.d.ts → engine/gutterpress-viewer.d.ts} +0 -0
package/README.md CHANGED
@@ -69,7 +69,7 @@ uses its bundled browser for standard PDF export.
69
69
  # Build a PDF from a project directory
70
70
  gutterpress build ./my-book
71
71
 
72
- # Live preview server (Paged.js + websocket-driven full-reload on file change)
72
+ # Live native-engine preview (automatic updates over WebSocket)
73
73
  gutterpress preview ./my-book
74
74
 
75
75
  # Custom output path
@@ -163,7 +163,13 @@ gutterpress new <name> --preset <id> [options]
163
163
 
164
164
  ### `gutterpress preview`
165
165
 
166
- Live HTML preview server by default (serves `book.html`, triggers full-reload via WebSocket on file change — pure JS rendering, no external tools). Pass `--format pdf` or `--format pdfx` for a one-shot build-and-open instead of the live server. `--manifest` applies only to those one-shot PDF/PDF-X modes; live HTML preview discovers the project manifest from its input directory.
166
+ Live HTML preview server by default. A single Markdown edit is rendered and
167
+ spliced as one chapter over WebSocket; CSS, manifest, multi-file, deletion, and
168
+ other structural changes reload the full document. This path is pure JS and
169
+ needs no external tools. Pass `--format pdf` or `--format pdfx` for a one-shot
170
+ build-and-open instead. `--manifest` applies only to those one-shot PDF/PDF-X
171
+ modes; live HTML preview discovers the project manifest from its input
172
+ directory.
167
173
 
168
174
  ```sh
169
175
  gutterpress preview [input-dir] [options]
@@ -184,6 +190,7 @@ gutterpress preview [input-dir] [options]
184
190
  --skip-lint Skip CSS linting (pdf|pdfx only)
185
191
  --skip-pre-validate Skip pre-build validation (pdf|pdfx only)
186
192
  --skip-post-validate Skip post-build PDF/X validation (pdfx only)
193
+ --engine <name> native (default) | paged (deprecated) [overrides the manifest's engine: field; applies to the live preview AND --format pdf|pdfx]
187
194
  ```
188
195
 
189
196
  ### `gutterpress build`
@@ -203,6 +210,7 @@ gutterpress build [input-dir] [options]
203
210
  --skip-lint Skip the CSS print-safety pass (default: lint runs for pdf/pdfx)
204
211
  --skip-pre-validate Skip pre-build validation
205
212
  --skip-post-validate Skip post-build PDF/X validation
213
+ --engine <name> native (default) | paged (deprecated) [overrides the manifest's engine: field; native = the Gutterpress engine, native Chromium pagination]
206
214
  ```
207
215
 
208
216
  ### `gutterpress publish`
@@ -236,7 +244,9 @@ gutterpress publish --provider itch ./my-book
236
244
 
237
245
  ### `gutterpress lint`
238
246
 
239
- Run Gutterpress's print-safety CSS checks (postcss-based: remote URLs, rasterizing effects, Paged.js crash-prone selectors) against the project's CSS files.
247
+ Run Gutterpress's PostCSS-based print-safety checks, including remote URLs,
248
+ rasterizing effects, and source-level page-containment risks, against the
249
+ project's CSS files.
240
250
 
241
251
  ```sh
242
252
  gutterpress lint [files] [options]
@@ -246,7 +256,11 @@ gutterpress lint [files] [options]
246
256
 
247
257
  `files` is a positional: either a project directory containing `manifest.yaml` (its configured stylesheets are linted), or a glob pattern for CSS files to lint directly. There is no `--files` flag — pass the directory/glob as the positional.
248
258
 
249
- Common print-unsafe patterns the plugin flags: remote `url(...)` references in CSS, paged.js-crashing `:is()`-with-sibling selectors, properties with no print equivalent.
259
+ Common findings include remote `url(...)` references, effects that rasterize
260
+ print text, and declarations on core page wrappers that could clip or trap
261
+ out-of-flow art. The source-level containment check is an early signal; the
262
+ build-time `engine.layer.trapped` diagnostic inspects the authoritative live
263
+ ancestor chain.
250
264
 
251
265
  ### `gutterpress validate`
252
266
 
@@ -10,7 +10,8 @@
10
10
  * const { url, stop } = await startPreviewServer({ input: "./book", installSignalHandlers: false });
11
11
  * await runBuild({ inputDir: "./book", format: "pdf", outDir: "./out", rawArgs: {} });
12
12
  */
13
- export { runBuild, splitOutPath, BuildError, type BuildFormat, type PdfxFlavor, type BuildRunnerOptions, type BuildRunnerResult, type SplitOutPath, type PdfRenderer, type PdfRenderInput, } from "../lib/build-runner";
13
+ export { runBuild, splitOutPath, BuildError, type BuildFormat, type PdfxFlavor, type BuildRunnerOptions, type BuildRunnerResult, type SplitOutPath, type EngineBrowser, type EngineSession, } from "../lib/build-runner";
14
+ export { DEFAULT_PRINT_OPTS, readyProbeExpr } from "../engine/shared/cdp";
14
15
  export { startPreviewServer, type PreviewServerHandle, type StartPreviewServerOptions, } from "../server";
15
16
  export type { PreviewServerOptions } from "../types";
16
17
  export { loadManifestWithPath, resolveConfig, MANIFEST_FILENAMES, hasProjectManifest, } from "../lib/manifest";
@@ -60,8 +61,9 @@ export { GenericTokenAuthProvider, connectGenericHost, knownForgeTokenUrl, norma
60
61
  export type { GenericTokenConnectInput, GenericHostCallbacks, GenericAuthOptions, } from "../lib/remote-auth/generic-auth.ts";
61
62
  export { diagnoseProjectRemote, parseRemoteOrigin, forgeKindForHost, } from "../lib/remote-auth/diagnose.ts";
62
63
  export type { ProjectRemoteDiagnosis, DiagnoseProjectRemoteOptions, RemoteProtocol, RemoteGuidanceId, ForgeKind, } from "../lib/remote-auth/diagnose.ts";
63
- export { syncProject, pullChanges, pushChanges, resolveConflicts, onlineCopyPath, SYNC_SNAPSHOT_MESSAGE, } from "../lib/remote-auth/sync.ts";
64
- export type { SyncOutcome, PullOutcome, PushOutcome, SyncProjectOptions, ResolveConflictsOptions, ConflictFile, ConflictKind, ConflictResolution, } from "../lib/remote-auth/sync.ts";
64
+ export { syncProject, pullChanges, pushChanges, SYNC_SNAPSHOT_MESSAGE, } from "../lib/remote-auth/sync.ts";
65
+ export type { SyncOutcome, PullOutcome, PushOutcome, SyncProjectOptions, ImageClash, } from "../lib/remote-auth/sync.ts";
66
+ export { keepImageVersion, readImageVersion } from "../lib/remote-auth/image-clash.ts";
65
67
  export type { SnapshotEntry, InitVersionHistoryOptions, SnapshotOptions, RestoreSnapshotOptions, RestoreVersionOptions, RestoreVersionResult, SourceProvider, } from "../lib/source-provider.ts";
66
68
  export { runPublish, resolvePublishRequest, } from "../lib/publish/run-publish.ts";
67
69
  export type { RunPublishOptions, RunPublishResult, } from "../lib/publish/run-publish.ts";
@@ -74,7 +76,11 @@ export { PublishSelectionsStore } from "../lib/publish/selections.ts";
74
76
  export type { PublishAccountSelection } from "../lib/publish/selections.ts";
75
77
  export { readPublishSettings, setPublishProviderConfig, } from "../lib/publish/manifest-publish.ts";
76
78
  export type { PublishProvider, PublishProviderId, PublishProviderInfo, PublishProviderKind, PublishConfigField, PublishArtifact, PublishArtifactFormat, PublishAuthStatus, PublishDeps, PublishListingMetadata, PublishOutcome, PublishProduct, PublishProject, PublishRequest, PreflightIssue, CommandRunner, CommandResult, } from "../lib/publish/types.ts";
77
- export { recover, classifyGitError, classifyFromHealth, inspectRepo, buildRecoveryContext, preflightStructuralReason, buildPreflightDiagnostics, verifyRepoReadable, isUnbornRepo, RepoNeedsRecoveryError, isRepoNeedsRecoveryError, } from "../lib/remote-auth/recovery/dispatch.ts";
79
+ export { repairRepo } from "../lib/remote-auth/recovery/repair.ts";
80
+ export type { RepairOptions, RepairResult } from "../lib/remote-auth/recovery/repair.ts";
81
+ export { classifyFromHealth, isLikelyRepoCorruption, RepoNeedsRecoveryError, isRepoNeedsRecoveryError, STALE_LOCK_MIN_AGE_MS, } from "../lib/remote-auth/recovery/classify.ts";
82
+ export type { RepairNeed } from "../lib/remote-auth/recovery/classify.ts";
83
+ export { inspectRepo, preflightStructuralReason, buildPreflightDiagnostics, verifyRepoReadable, isUnbornRepo, } from "../lib/remote-auth/recovery/inspect.ts";
84
+ export type { RepoHealth } from "../lib/remote-auth/recovery/types.ts";
78
85
  export { resolveLogger, shortOid } from "../lib/remote-auth/operation-log.ts";
79
86
  export type { OperationLogger, LogData } from "../lib/remote-auth/operation-log.ts";
80
- export type { RecoverFn, RecoveryContext, RecoveryResult, SyncErrorKind, RecoveryRisk, ManualGuidance, RepoHealth, RecoveryBackup, RepairConfirmation, ConfirmationGate, FaultInjector, FaultPoint, } from "../lib/remote-auth/recovery/dispatch.ts";
package/dist/api/index.js CHANGED
@@ -8,7 +8,6 @@ import {
8
8
  AUTO_SYNC_MIN_MINUTES,
9
9
  BUILT_IN_TEMPLATE_IDS,
10
10
  BUILT_IN_THEME_IDS,
11
- BuildError,
12
11
  FileTokenStore,
13
12
  GITHUB_HOST,
14
13
  GenericTokenAuthProvider,
@@ -21,6 +20,7 @@ import {
21
20
  RECOMMENDED_PLUGINS,
22
21
  RepoNeedsRecoveryError,
23
22
  SNIPPETS_DIR,
23
+ STALE_LOCK_MIN_AGE_MS,
24
24
  SYNC_SNAPSHOT_MESSAGE,
25
25
  TARGETS,
26
26
  TARGET_IDS,
@@ -33,9 +33,7 @@ import {
33
33
  autoSnapshotDelayMs,
34
34
  autoSyncDelayMs,
35
35
  buildPreflightDiagnostics,
36
- buildRecoveryContext,
37
36
  classifyFromHealth,
38
- classifyGitError,
39
37
  cloneRepository,
40
38
  connectGenericHost,
41
39
  connectPublishProvider,
@@ -58,9 +56,11 @@ import {
58
56
  inspectRepo,
59
57
  isAppHeartbeatFresh,
60
58
  isGitInternalPath,
59
+ isLikelyRepoCorruption,
61
60
  isRepoNeedsRecoveryError,
62
61
  isSshRemoteUrl,
63
62
  isUnbornRepo,
63
+ keepImageVersion,
64
64
  knownForgeTokenUrl,
65
65
  listBuiltInTemplates,
66
66
  listBuiltInThemes,
@@ -77,7 +77,6 @@ import {
77
77
  loadManifestWithPath,
78
78
  migrateUrlCredential,
79
79
  normalizeForgeHost,
80
- onlineCopyPath,
81
80
  parseRemoteOrigin,
82
81
  preflightStructuralReason,
83
82
  provenancePath,
@@ -88,19 +87,19 @@ import {
88
87
  pullChanges,
89
88
  pushChanges,
90
89
  readAppHeartbeat,
90
+ readImageVersion,
91
91
  readManifestFields,
92
92
  readProjectProvenance,
93
93
  readPublishSettings,
94
94
  readSnippet,
95
95
  readThemeCss,
96
- recover,
97
96
  redactCredential,
98
97
  removeAppHeartbeat,
99
98
  removeProjectTheme,
99
+ repairRepo,
100
100
  resolveActiveStyles,
101
101
  resolveBuiltInTheme,
102
102
  resolveConfig,
103
- resolveConflicts,
104
103
  resolveGitHubClientId,
105
104
  resolvePublishRequest,
106
105
  revertTheme,
@@ -123,7 +122,12 @@ import {
123
122
  validateProjectPlugins,
124
123
  verifyRepoReadable,
125
124
  writeAppHeartbeat
126
- } from "../index-bynn850m.js";
125
+ } from "../index-05y3dnxq.js";
126
+ import {
127
+ BuildError,
128
+ DEFAULT_PRINT_OPTS,
129
+ readyProbeExpr
130
+ } from "../index-9tyq9kks.js";
127
131
  import {
128
132
  AUTO_SNAPSHOT_MESSAGE,
129
133
  HISTORY_PAGE_LIMIT,
@@ -133,15 +137,14 @@ import {
133
137
  resolveLogger,
134
138
  restoreVersionWithBackup,
135
139
  shortOid
136
- } from "../index-yzrh708h.js";
140
+ } from "../index-mdefp0y5.js";
137
141
  import {
138
142
  capabilitiesFor,
139
143
  detectProjectSource,
140
144
  findEnclosingRepoDir,
141
145
  repoRootForSource,
142
146
  repoSubPath
143
- } from "../index-wchtvxvw.js";
144
- import"../index-yja077f6.js";
147
+ } from "../index-v5mp7a6q.js";
145
148
  import"../index-37x76zdn.js";
146
149
  export {
147
150
  writeAppHeartbeat,
@@ -169,21 +172,22 @@ export {
169
172
  resolvePublishRequest,
170
173
  resolveLogger,
171
174
  resolveGitHubClientId,
172
- resolveConflicts,
173
175
  resolveConfig,
174
176
  resolveBuiltInTheme,
175
177
  resolveActiveStyles,
176
178
  repoSubPath,
177
179
  repoRootForSource,
180
+ repairRepo,
178
181
  removeProjectTheme,
179
182
  removeAppHeartbeat,
180
183
  redactCredential,
181
- recover,
184
+ readyProbeExpr,
182
185
  readThemeCss,
183
186
  readSnippet,
184
187
  readPublishSettings,
185
188
  readProjectProvenance,
186
189
  readManifestFields,
190
+ readImageVersion,
187
191
  readAppHeartbeat,
188
192
  pushChanges,
189
193
  pullChanges,
@@ -195,7 +199,6 @@ export {
195
199
  provenancePath,
196
200
  preflightStructuralReason,
197
201
  parseRemoteOrigin,
198
- onlineCopyPath,
199
202
  normalizeForgeHost,
200
203
  migrateUrlCredential,
201
204
  loadManifestWithPath,
@@ -212,10 +215,12 @@ export {
212
215
  listBuiltInThemes,
213
216
  listBuiltInTemplates,
214
217
  knownForgeTokenUrl,
218
+ keepImageVersion,
215
219
  isUnbornRepo,
216
220
  isSshRemoteUrl,
217
221
  isRepoNeedsRecoveryError,
218
222
  isNoChangesError,
223
+ isLikelyRepoCorruption,
219
224
  isGitInternalPath,
220
225
  isAppHeartbeatFresh,
221
226
  inspectRepo,
@@ -240,10 +245,8 @@ export {
240
245
  connectPublishProvider,
241
246
  connectGenericHost,
242
247
  cloneRepository,
243
- classifyGitError,
244
248
  classifyFromHealth,
245
249
  capabilitiesFor,
246
- buildRecoveryContext,
247
250
  buildPreflightDiagnostics,
248
251
  autoSyncDelayMs,
249
252
  autoSnapshotDelayMs,
@@ -256,6 +259,7 @@ export {
256
259
  TARGET_IDS,
257
260
  TARGETS,
258
261
  SYNC_SNAPSHOT_MESSAGE,
262
+ STALE_LOCK_MIN_AGE_MS,
259
263
  SNIPPETS_DIR,
260
264
  RepoNeedsRecoveryError,
261
265
  RESTORE_BACKUP_MESSAGE,
@@ -270,6 +274,7 @@ export {
270
274
  GenericTokenAuthProvider,
271
275
  GITHUB_HOST,
272
276
  FileTokenStore,
277
+ DEFAULT_PRINT_OPTS,
273
278
  BuildError,
274
279
  BUILT_IN_THEME_IDS,
275
280
  BUILT_IN_TEMPLATE_IDS,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,21 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-k4bd06sd.js";
3
+ } from "./cli-n25qycwz.js";
4
4
  import {
5
5
  log
6
- } from "./cli-najycadg.js";
6
+ } from "./cli-ra0ed2xt.js";
7
7
  import {
8
- EXIT_CODES,
9
8
  UsageError,
10
9
  rejectExtraPositionals,
11
10
  rejectUnknownFlags
12
- } from "./cli-e5zhb0xs.js";
13
- import"./cli-yzrh708h.js";
14
- import"./cli-wchtvxvw.js";
15
- import"./cli-yja077f6.js";
11
+ } from "./cli-0r0tq16s.js";
12
+ import"./cli-hp9r2pzt.js";
13
+ import"./cli-c41yr7he.js";
14
+ import {
15
+ EXIT_CODES
16
+ } from "./cli-46ycxe6r.js";
17
+ import"./cli-k1065rkg.js";
18
+ import"./cli-v5mp7a6q.js";
16
19
  import"./cli-37x76zdn.js";
17
20
 
18
21
  // src/commands/audit.ts
@@ -1,21 +1,25 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-k4bd06sd.js";
4
+ } from "./cli-n25qycwz.js";
5
5
  import {
6
6
  log
7
- } from "./cli-najycadg.js";
7
+ } from "./cli-ra0ed2xt.js";
8
8
  import {
9
- BuildError,
10
9
  UsageError,
10
+ parseEngine,
11
11
  parseFormat,
12
12
  parsePdfxFlavor,
13
13
  rejectExtraPositionals,
14
14
  rejectUnknownFlags
15
- } from "./cli-e5zhb0xs.js";
16
- import"./cli-yzrh708h.js";
17
- import"./cli-wchtvxvw.js";
18
- import"./cli-yja077f6.js";
15
+ } from "./cli-0r0tq16s.js";
16
+ import"./cli-hp9r2pzt.js";
17
+ import"./cli-c41yr7he.js";
18
+ import {
19
+ BuildError
20
+ } from "./cli-46ycxe6r.js";
21
+ import"./cli-k1065rkg.js";
22
+ import"./cli-v5mp7a6q.js";
19
23
  import"./cli-37x76zdn.js";
20
24
 
21
25
  // src/commands/build.ts
@@ -32,7 +36,8 @@ var commandArgs = {
32
36
  "strip-annotations": { type: "boolean", description: "Strip PDF annotations for PDF/X compliance" },
33
37
  "skip-lint": { type: "boolean", description: "Skip CSS linting (default: lint runs for pdf/pdfx)" },
34
38
  "skip-pre-validate": { type: "boolean", description: "Skip pre-build validation" },
35
- "skip-post-validate": { type: "boolean", description: "Skip post-build PDF/X validation" }
39
+ "skip-post-validate": { type: "boolean", description: "Skip post-build PDF/X validation" },
40
+ engine: { type: "string", description: "Pagination engine. Paged.js has been removed; native is the only engine. This flag is accepted but ignored (a warning fires for --engine paged)." }
36
41
  };
37
42
  var build_default = defineCommand({
38
43
  meta: {
@@ -61,6 +66,7 @@ var build_default = defineCommand({
61
66
  skipLint: !!args["skip-lint"],
62
67
  skipPreValidate: !!args["skip-pre-validate"],
63
68
  skipPostValidate: !!args["skip-post-validate"],
69
+ engine: parseEngine(args.engine),
64
70
  rawArgs: args
65
71
  });
66
72
  } catch (error) {
@@ -4,3 +4,4 @@ import "./stylelint";
4
4
  import "./local-refs";
5
5
  import "./accessibility-alt-text";
6
6
  import "./accessibility-heading-order";
7
+ import "./layout-markers";
@@ -0,0 +1,3 @@
1
+ import type { Check } from "../types";
2
+ declare const check: Check;
3
+ export default check;
@@ -0,0 +1,28 @@
1
+ import type { LoadedPlugin } from "../../lib/markdown/renderer";
2
+ export type RenderedRefKind = "image" | "link";
3
+ export interface RenderedLocalRef {
4
+ ref: string;
5
+ kind: RenderedRefKind;
6
+ /** One-based source line of the rendered link/image occurrence. */
7
+ line: number;
8
+ }
9
+ /**
10
+ * Extract only links and images the shipped Gutterpress grammar actually
11
+ * renders, with their original source lines.
12
+ *
13
+ * Complexity is O(source + tokens + refs × log(lines-per-inline)). Keeping
14
+ * correlation local to each parser-defined block is important because it
15
+ * prevents an unmatched delimiter/comment/tag from pairing across a
16
+ * blank/block boundary.
17
+ * Markdown-it normalizes CRLF and lone CR to LF before building token maps, so
18
+ * line counts remain exact for all three newline spellings.
19
+ */
20
+ export type RenderedLocalRefCollector = (content: string) => RenderedLocalRef[];
21
+ /**
22
+ * Build one parser-aligned collector for a validation run.
23
+ *
24
+ * Custom plugins are applied exactly as they are for the book renderer before
25
+ * the inline State is instrumented. Reusing the returned closure across all
26
+ * source files avoids loading/applying a project plugin once per chapter.
27
+ */
28
+ export declare function createRenderedLocalRefCollector(customPlugins?: LoadedPlugin[]): RenderedLocalRefCollector;
@@ -1,15 +1,17 @@
1
+ import {
2
+ EXIT_CODES
3
+ } from "./cli-46ycxe6r.js";
1
4
  // package.json
2
5
  var package_default = {
3
6
  name: "gutterpress",
4
- version: "0.9.0-alpha.2",
5
- description: "Markdown-to-PDF converter for professional print layout using Paged.js and Ghostscript.",
7
+ version: "0.10.0-alpha.4",
8
+ description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
6
9
  author: "itlackey",
7
10
  license: "MPL-2.0",
8
11
  keywords: [
9
12
  "markdown",
10
13
  "pdf",
11
14
  "print",
12
- "pagedjs",
13
15
  "ghostscript",
14
16
  "book",
15
17
  "publishing",
@@ -49,11 +51,13 @@ var package_default = {
49
51
  "LICENSE"
50
52
  ],
51
53
  scripts: {
52
- "build:library": "rimraf dist && bun build src/index.ts src/api/index.ts --target=node --packages=external --splitting --outdir=dist && bun build src/render.ts --target=node --packages=external --outdir=dist && node scripts/check-render-pure.mjs && tsc -p tsconfig.build.json",
54
+ "build:library": "bun scripts/build-engine-bundles.mjs && rimraf dist && bun build src/index.ts src/api/index.ts --target=node --packages=external --splitting --outdir=dist && bun build src/render.ts --target=node --packages=external --outdir=dist && node scripts/check-render-pure.mjs && tsc -p tsconfig.build.json",
53
55
  build: "bun run build:library && bun build src/cli.ts --target=node --packages=external --splitting --outdir=dist",
54
56
  prepublishOnly: "bun run build",
55
57
  test: "bun test",
56
- typecheck: "tsc --noEmit"
58
+ typecheck: "tsc --noEmit",
59
+ "typecheck:engine-browser": "tsc --noEmit -p src/engine/browser.tsconfig.json",
60
+ "parity:gate": "bun scripts/native-parity-gate.ts"
57
61
  },
58
62
  engines: {
59
63
  bun: ">=1.0.0",
@@ -95,30 +99,12 @@ var package_default = {
95
99
  "@types/node": "^22.0.0",
96
100
  "@types/semver": "^7.7.1",
97
101
  "@types/ws": "^8.5.13",
98
- pagedjs: "^0.4.3",
99
102
  playwright: "^1.60.0",
100
103
  rimraf: "^6.0.0",
101
104
  typescript: "^5"
102
105
  }
103
106
  };
104
107
 
105
- // src/lib/build-error.ts
106
- var EXIT_CODES = {
107
- OK: 0,
108
- FINDINGS: 1,
109
- USAGE: 2,
110
- PIPELINE: 3
111
- };
112
-
113
- class BuildError extends Error {
114
- exitCode;
115
- constructor(message, exitCode = EXIT_CODES.PIPELINE, options) {
116
- super(message, options);
117
- this.name = "BuildError";
118
- this.exitCode = exitCode;
119
- }
120
- }
121
-
122
108
  // src/constants.ts
123
109
  var NETWORK = {
124
110
  DEFAULT_PORT: 3579
@@ -268,6 +254,13 @@ function parsePdfxFlavor(raw, format) {
268
254
  return raw;
269
255
  throw new UsageError(`Invalid --pdfx-flavor value: "${raw}". Expected "x1a" or "x3".`);
270
256
  }
257
+ function parseEngine(raw) {
258
+ if (raw === undefined)
259
+ return;
260
+ if (raw === "paged" || raw === "native")
261
+ return raw;
262
+ throw new UsageError(`Unknown --engine "${String(raw)}". Expected: paged | native`);
263
+ }
271
264
  function resolvePort(raw) {
272
265
  if (raw === undefined)
273
266
  return NETWORK.DEFAULT_PORT;
@@ -281,4 +274,4 @@ function resolvePort(raw) {
281
274
  return n;
282
275
  }
283
276
 
284
- export { package_default, DEBOUNCE, EXIT_CODES, BuildError, UsageError, rejectUnknownFlags, rejectExtraPositionals, parseFormat, parsePdfxFlavor, resolvePort };
277
+ export { package_default, DEBOUNCE, UsageError, rejectUnknownFlags, rejectExtraPositionals, parseFormat, parsePdfxFlavor, parseEngine, resolvePort };
@@ -0,0 +1,18 @@
1
+ // src/lib/build-error.ts
2
+ var EXIT_CODES = {
3
+ OK: 0,
4
+ FINDINGS: 1,
5
+ USAGE: 2,
6
+ PIPELINE: 3
7
+ };
8
+
9
+ class BuildError extends Error {
10
+ exitCode;
11
+ constructor(message, exitCode = EXIT_CODES.PIPELINE, options) {
12
+ super(message, options);
13
+ this.name = "BuildError";
14
+ this.exitCode = exitCode;
15
+ }
16
+ }
17
+
18
+ export { EXIT_CODES, BuildError };