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
@@ -15,25 +15,28 @@ import type { HostCredential, TokenStore } from "./token-store.ts";
15
15
  * the root cause of the 0.5.0 "sync uses 2 GB" report.
16
16
  */
17
17
  export type GitCache = Record<string, unknown>;
18
- /** How one conflicted file differs between the two copies. */
19
- export type ConflictKind =
20
- /** Edited in both copies. */
21
- "both-edited"
22
- /** The author deleted it; the online copy edited it. */
23
- | "you-deleted"
24
- /** The online copy deleted it; the author edited it. */
25
- | "online-deleted";
26
- /** One file that changed in both the local and the online copy. */
27
- export interface ConflictFile {
28
- path: string;
29
- kind: ConflictKind;
30
- }
31
- /** Author's per-file decision for a conflicted file (ADR 0006 D5). */
32
- export interface ConflictResolution {
18
+ /**
19
+ * One image file that changed on both sides. Sync already converged (the
20
+ * NEWER side's bytes are on disk and committed — the safe default); this
21
+ * record lets a host offer a non-blocking side-by-side picker afterwards.
22
+ * Both blob oids are pinned by the merge commit's two parents, so the picker
23
+ * can never go stale.
24
+ */
25
+ export interface ImageClash {
26
+ /** Repo-relative path of the image. */
33
27
  path: string;
34
- choice: "mine" | "theirs" | "both";
28
+ /** Blob oid of the local version. */
29
+ localOid: string;
30
+ /** Blob oid of the online version. */
31
+ remoteOid: string;
32
+ /** Which side the automatic newer-wins policy kept on disk. */
33
+ kept: "local" | "online";
35
34
  }
36
- /** Outcome of a sync (or conflict-resolution) attempt. */
35
+ /** Outcome of a sync attempt. Sync always converges — there is no "conflict"
36
+ * arm: overlapping text edits land in the file inside standard git conflict
37
+ * markers (`combinedFiles`), clashing binaries keep the newer side
38
+ * (`imageClashes` for images), and the other version is always reachable in
39
+ * history. Owner ruling 2026-08-14. */
37
40
  export type SyncOutcome = {
38
41
  status: "synced";
39
42
  message: string;
@@ -43,20 +46,15 @@ export type SyncOutcome = {
43
46
  mergedRemoteChanges: boolean;
44
47
  /** True when pulling online changes changed the local working tree. */
45
48
  filesChanged?: boolean;
49
+ /** Files whose text now holds BOTH versions inside git conflict markers. */
50
+ combinedFiles?: string[];
51
+ /** Clashing images (newer kept) for the host's non-blocking picker. */
52
+ imageClashes?: ImageClash[];
46
53
  } | {
47
54
  status: "up-to-date";
48
55
  message: string;
49
56
  snapshotId?: string;
50
57
  filesChanged?: boolean;
51
- } | {
52
- status: "conflict";
53
- message: string;
54
- files: ConflictFile[];
55
- /** Local branch tip the conflict was computed against. */
56
- localId: string;
57
- /** Online tip the conflict was computed against. */
58
- remoteId: string;
59
- snapshotId?: string;
60
58
  } | {
61
59
  status: "auth";
62
60
  message: string;
@@ -71,11 +69,11 @@ export type SyncOutcome = {
71
69
  status: "error";
72
70
  message: string;
73
71
  /**
74
- * Stable machine-readable signal for the small set of known "the project
75
- * isn't set up right" failures (no remote / SSH remote / no named
76
- * branch) — set by conflict-resolution.ts's setupErrorMessage() check.
77
- * Lets a host UI route to its connect/setup surface without
78
- * string-matching `message` (which stays free to reword).
72
+ * Stable machine-readable signal so a host UI can route without
73
+ * string-matching `message` (which stays free to reword):
74
+ * "needs-connection-setup" — the project isn't set up right (no
75
+ * remote / SSH remote / no named branch); route to the connect/setup
76
+ * surface.
79
77
  */
80
78
  code?: "needs-connection-setup";
81
79
  snapshotId?: string;
@@ -83,9 +81,8 @@ export type SyncOutcome = {
83
81
  };
84
82
  /**
85
83
  * Outcome of a pull-only attempt ({@link pullChanges}): fetch + fast-forward/
86
- * merge of the online changes, NEVER a push. Conflict semantics are identical
87
- * to {@link syncProject} (abortOnConflict — the working tree is never left
88
- * with conflict markers).
84
+ * converge-merge of the online changes, NEVER a push. The merge always lands
85
+ * (see converge-merge.ts) — there is no "conflict" arm.
89
86
  */
90
87
  export type PullOutcome = {
91
88
  status: "pulled";
@@ -102,17 +99,14 @@ export type PullOutcome = {
102
99
  * from before) — the host should refresh its preview.
103
100
  */
104
101
  filesChanged: boolean;
102
+ /** Files whose text now holds BOTH versions inside git conflict markers. */
103
+ combinedFiles?: string[];
104
+ /** Clashing images (newer kept) for the host's non-blocking picker. */
105
+ imageClashes?: ImageClash[];
105
106
  } | {
106
107
  status: "up-to-date";
107
108
  message: string;
108
109
  snapshotId?: string;
109
- } | {
110
- status: "conflict";
111
- message: string;
112
- files: ConflictFile[];
113
- localId: string;
114
- remoteId: string;
115
- snapshotId?: string;
116
110
  } | {
117
111
  status: "auth";
118
112
  message: string;
@@ -193,28 +187,6 @@ export interface SyncRetryOptions {
193
187
  /** Injectable delay (tests only); defaults to a real timer. */
194
188
  sleep?: (ms: number) => Promise<void>;
195
189
  }
196
- export interface ResolveConflictsOptions {
197
- projectDir: string;
198
- resolutions: ConflictResolution[];
199
- /** The `localId` from the conflict outcome. */
200
- localId: string;
201
- /** The `remoteId` from the conflict outcome. */
202
- remoteId: string;
203
- credential?: HostCredential;
204
- tokenStore?: TokenStore;
205
- authorName?: string;
206
- authorEmail?: string;
207
- httpClient?: typeof httpNode;
208
- /**
209
- * When true, the merge is allowed to combine two commits that share no
210
- * common ancestor (unrelated histories). Set by the unrelated-histories
211
- * recovery path; regular merge conflicts leave this false (the local and
212
- * remote share a common base, so `allowUnrelatedHistories` is unnecessary).
213
- */
214
- allowUnrelatedHistories?: boolean;
215
- /** Optional log file for debugging conflict resolution steps. */
216
- logFile?: string;
217
- }
218
190
  /** Resolved project remote + credential used by every transport call. */
219
191
  export interface RemoteTransport {
220
192
  remote: string;
@@ -1,30 +1,23 @@
1
- import { conflictFilesFrom, onAuthFor } from "./transport.ts";
1
+ import { onAuthFor } from "./transport.ts";
2
2
  import type { PullOutcome, PushOutcome, SyncOutcome, SyncProjectOptions } from "./sync-types.ts";
3
- export { onAuthFor, conflictFilesFrom };
4
- export { onlineCopyPath, resolveConflicts } from "./conflict-resolution.ts";
3
+ export { onAuthFor };
5
4
  export { SYNC_SNAPSHOT_MESSAGE } from "./sync-messages.ts";
6
- export type { ConflictFile, ConflictKind, ConflictResolution, PullOutcome, PushOutcome, ResolveConflictsOptions, SyncOutcome, SyncProjectOptions, } from "./sync-types.ts";
5
+ export type { ImageClash, PullOutcome, PushOutcome, SyncOutcome, SyncProjectOptions, } from "./sync-types.ts";
7
6
  /**
8
7
  * Snapshot-first sync (ADR 0006 D5) — the composition of {@link pullChanges}
9
8
  * then {@link pushChanges}. If someone pushes between our pull and our push,
10
- * the push reports pull-first and the pair re-runs (their commits merge in on
11
- * the next pass), with a short backoff between passes. The loop is ALWAYS
12
- * bounded by `retry.attempts` (BUG 6 — a fast-moving remote no longer triggers
13
- * a FALSE race message after only two attempts); a remote that genuinely races
14
- * every pass surfaces a friendly "try again" rather than looping forever. The
15
- * snapshot-first guarantee holds on every path (the work is saved locally
16
- * before any network step). Never throws for expected outcomes — everything is
17
- * reported through the {@link SyncOutcome} union.
9
+ * the push reports pull-first and the pair re-runs (their commits converge in
10
+ * on the next pass), with a short backoff between passes. The loop is ALWAYS
11
+ * bounded by `retry.attempts`; a remote that races every pass surfaces a
12
+ * friendly "try again in a moment" rather than looping forever. Never throws
13
+ * for expected outcomes — everything is reported through {@link SyncOutcome}.
18
14
  */
19
15
  export declare function syncProject(options: SyncProjectOptions): Promise<SyncOutcome>;
20
16
  /**
21
17
  * Pull-only operation (the History tab's "Pull"): snapshot-if-needed →
22
- * fetch → fast-forward or clean merge of the online changes — NEVER a push.
23
- *
24
- * Same conflict semantics as {@link syncProject}: `abortOnConflict` keeps the
25
- * working tree completely untouched and the conflict comes back as
26
- * `{ status: "conflict", files }` for the per-file choices dialog. Serialized
27
- * on the per-repo lock; one function-scoped object cache, released on return.
18
+ * fetch → fast-forward or CONVERGE-merge of the online changes — NEVER a
19
+ * push, never a question. Serialized on the per-repo lock; one
20
+ * function-scoped object cache, released on return.
28
21
  */
29
22
  export declare function pullChanges(options: SyncProjectOptions): Promise<PullOutcome>;
30
23
  /**
@@ -1,6 +1,7 @@
1
1
  import httpNode from "isomorphic-git/http/node";
2
2
  import { type HostCredential, type TokenStore } from "./token-store.ts";
3
- import type { ConflictFile, GitCache, RemoteTransport } from "./sync-types.ts";
3
+ import type { OperationLogger } from "./operation-log.ts";
4
+ import type { GitCache, RemoteTransport } from "./sync-types.ts";
4
5
  /**
5
6
  * The git repo directory for a project dir. A project IS its git repo, so this
6
7
  * walks up to the enclosing repo root (opening a subfolder syncs the whole
@@ -47,12 +48,6 @@ export declare function failureOutcome(e: unknown, snapshotId?: string): {
47
48
  message: string;
48
49
  snapshotId?: string;
49
50
  };
50
- export declare function conflictFilesFrom(data: {
51
- filepaths: string[];
52
- bothModified: string[];
53
- deleteByUs: string[];
54
- deleteByTheirs: string[];
55
- }): ConflictFile[];
56
51
  /** Friendly setup-problem message for the expected gate errors, else null. */
57
52
  export declare function setupErrorMessage(e: unknown): string | null;
58
53
  /**
@@ -70,6 +65,18 @@ export declare function snapshotBeforeAction(args: {
70
65
  authorEmail?: string;
71
66
  cache: GitCache;
72
67
  }): Promise<string | undefined>;
68
+ /**
69
+ * Structural preflight — never touch the tree of a damaged repo. An interrupted
70
+ * merge/rebase/cherry-pick, detached HEAD, stale lock, or missing `.git` must be
71
+ * REPAIRED before any sync work: snapshot-first would otherwise commit whatever
72
+ * is on disk (e.g. the literal conflict markers a half-done native-git merge
73
+ * leaves in tracked files) and push it to every collaborator. Throwing the
74
+ * typed error routes the caller through the recover() path.
75
+ * `checkLocalChanges: false` — only the structural flags matter here.
76
+ *
77
+ * Runs INSIDE the caller's repo lock. Shared by pullChanges and pushChanges.
78
+ */
79
+ export declare function assertNoStructuralDamage(projectDir: string, logger: OperationLogger): Promise<void>;
73
80
  export declare function currentBranchOrThrow(dir: string): Promise<string>;
74
81
  /**
75
82
  * Run `fn` (a fetch that moves remote-tracking refs) with a rollback guard
@@ -29,11 +29,10 @@ export declare function locateThemeRoot(names: string[]): string | null;
29
29
  /**
30
30
  * Split print-safety findings into the one that REJECTS the import (a CSS
31
31
  * syntax/parse failure — the stylesheet is unusable) vs. WARN findings the
32
- * author should still see (remote URLs, risky print effects, paged.js crash
33
- * selectors) that import anyway. The discriminator is the rule id, not
34
- * severity: `no-remote-urls`/`no-pagedjs-crash-selectors` are `error`-severity
35
- * but the #106 spec still imports them with a warning; only `syntax-error`
36
- * refuses.
32
+ * author should still see (remote URLs, risky print effects) that import
33
+ * anyway. The discriminator is the rule id, not severity: `no-remote-urls` is
34
+ * `error`-severity but the #106 spec still imports it with a warning; only
35
+ * `syntax-error` refuses.
37
36
  */
38
37
  export declare function classifyThemeCssFindings(findings: PrintSafeWarning[]): {
39
38
  reject: PrintSafeWarning | null;
@@ -1,19 +1,22 @@
1
1
  import {
2
2
  MANIFEST_FILENAMES,
3
3
  runLint
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
- EXIT_CODES,
10
9
  UsageError,
11
10
  rejectExtraPositionals,
12
11
  rejectUnknownFlags
13
- } from "./cli-e5zhb0xs.js";
14
- import"./cli-yzrh708h.js";
15
- import"./cli-wchtvxvw.js";
16
- import"./cli-yja077f6.js";
12
+ } from "./cli-0r0tq16s.js";
13
+ import"./cli-hp9r2pzt.js";
14
+ import"./cli-c41yr7he.js";
15
+ import {
16
+ EXIT_CODES
17
+ } from "./cli-46ycxe6r.js";
18
+ import"./cli-k1065rkg.js";
19
+ import"./cli-v5mp7a6q.js";
17
20
  import"./cli-37x76zdn.js";
18
21
 
19
22
  // src/commands/lint.ts
@@ -29,6 +29,27 @@
29
29
  "enum": ["dtrpg", "book", "custom"],
30
30
  "examples": ["dtrpg", "book", "custom"]
31
31
  },
32
+ "engine": {
33
+ "type": "string",
34
+ "description": "Pagination engine. Paged.js has been removed — the Gutterpress engine (native Chromium pagination) is the only engine, and \"native\" is the only meaningful value. \"paged\" is accepted for backward-compatible manifest parsing only: it produces a one-line warning and the build proceeds natively regardless. `--engine` on the CLI is likewise an accepted-but-ignored no-op.",
35
+ "enum": ["paged", "native"],
36
+ "default": "native",
37
+ "examples": ["native"]
38
+ },
39
+ "engineStyles": {
40
+ "type": "object",
41
+ "description": "Engine-conditional stylesheets, appended AFTER `styles`. `.native` is the only list that still applies; `.paged` is accepted-but-ignored (a warning fires if it has entries) now that Paged.js has been removed.",
42
+ "properties": {
43
+ "paged": {
44
+ "type": "array",
45
+ "description": "REMOVED — Paged.js has been deleted. Accepted for backward-compatible manifest parsing only; entries here are ignored with a warning.",
46
+ "items": { "type": "string" }
47
+ },
48
+ "native": { "type": "array", "items": { "type": "string" } }
49
+ },
50
+ "additionalProperties": false,
51
+ "examples": [{ "native": ["css/native-furniture.css"] }]
52
+ },
32
53
  "targets": {
33
54
  "type": "array",
34
55
  "description": "Where the book is published (ADR 0008): publish targets whose requirements `gutterpress validate` checks the built PDF against — each target is validated separately, so one book can target several destinations. Omitting it uses the preset's default (dtrpg -> [\"dtrpg\"]; book/custom -> []).",
@@ -5,20 +5,24 @@ import {
5
5
  TARGETS,
6
6
  TARGET_IDS,
7
7
  scaffoldProject
8
- } from "./cli-k4bd06sd.js";
8
+ } from "./cli-n25qycwz.js";
9
9
  import {
10
- isToolAvailable,
11
10
  resolveGhostscript
12
- } from "./cli-najycadg.js";
11
+ } from "./cli-ra0ed2xt.js";
13
12
  import {
14
- EXIT_CODES,
15
13
  UsageError,
16
14
  rejectExtraPositionals,
17
15
  rejectUnknownFlags
18
- } from "./cli-e5zhb0xs.js";
19
- import"./cli-yzrh708h.js";
20
- import"./cli-wchtvxvw.js";
21
- import"./cli-yja077f6.js";
16
+ } from "./cli-0r0tq16s.js";
17
+ import"./cli-hp9r2pzt.js";
18
+ import {
19
+ isToolAvailable
20
+ } from "./cli-c41yr7he.js";
21
+ import {
22
+ EXIT_CODES
23
+ } from "./cli-46ycxe6r.js";
24
+ import"./cli-k1065rkg.js";
25
+ import"./cli-v5mp7a6q.js";
22
26
  import"./cli-37x76zdn.js";
23
27
 
24
28
  // src/commands/new.ts
@@ -1,17 +1,20 @@
1
1
  import {
2
2
  addNpmPlugin,
3
3
  parseNpmPluginSpec
4
- } from "./cli-k4bd06sd.js";
5
- import"./cli-najycadg.js";
4
+ } from "./cli-n25qycwz.js";
5
+ import"./cli-ra0ed2xt.js";
6
6
  import {
7
- EXIT_CODES,
8
7
  UsageError,
9
8
  rejectExtraPositionals,
10
9
  rejectUnknownFlags
11
- } from "./cli-e5zhb0xs.js";
12
- import"./cli-yzrh708h.js";
13
- import"./cli-wchtvxvw.js";
14
- import"./cli-yja077f6.js";
10
+ } from "./cli-0r0tq16s.js";
11
+ import"./cli-hp9r2pzt.js";
12
+ import"./cli-c41yr7he.js";
13
+ import {
14
+ EXIT_CODES
15
+ } from "./cli-46ycxe6r.js";
16
+ import"./cli-k1065rkg.js";
17
+ import"./cli-v5mp7a6q.js";
15
18
  import"./cli-37x76zdn.js";
16
19
 
17
20
  // src/commands/plugin.ts
@@ -2,19 +2,22 @@ import {
2
2
  executeValidation,
3
3
  publishTargetFor,
4
4
  reportMissingTools
5
- } from "./cli-k4bd06sd.js";
5
+ } from "./cli-n25qycwz.js";
6
6
  import {
7
7
  log
8
- } from "./cli-najycadg.js";
8
+ } from "./cli-ra0ed2xt.js";
9
9
  import {
10
- EXIT_CODES,
11
10
  UsageError,
12
11
  rejectExtraPositionals,
13
12
  rejectUnknownFlags
14
- } from "./cli-e5zhb0xs.js";
15
- import"./cli-yzrh708h.js";
16
- import"./cli-wchtvxvw.js";
17
- import"./cli-yja077f6.js";
13
+ } from "./cli-0r0tq16s.js";
14
+ import"./cli-hp9r2pzt.js";
15
+ import"./cli-c41yr7he.js";
16
+ import {
17
+ EXIT_CODES
18
+ } from "./cli-46ycxe6r.js";
19
+ import"./cli-k1065rkg.js";
20
+ import"./cli-v5mp7a6q.js";
18
21
  import"./cli-37x76zdn.js";
19
22
 
20
23
  // src/commands/preflight.ts
@@ -14,24 +14,20 @@ import type { ResolvedPluginConfig } from '../schema/manifest.types';
14
14
  */
15
15
  export declare function incrementalPreviewEnabled(): boolean;
16
16
  /**
17
- * Rewrite rendered book HTML for the live preview. Injects, in order:
18
- * 1. pagedjs-interface.js — defines window.previewAPI for in-iframe controls
19
- * 2. pagedjs-bridge.js — postMessage bridge for cross-origin toolbar (desktop)
20
- * 3. BREAK_INSIDE_HANDLER — polyfill for break-inside: avoid
21
- * 4. Paged.js polyfill itself, served directly from the process-wide
22
- * embedded-assets dir by the HTTP server (see http-server.ts route
23
- * for /vendor/*). We no longer copy it into the per-project tempDir
24
- * because:
25
- * - The polyfill is 904 KB and copying it per open is wasted IO
26
- * (one of the worst-case Defender scan targets on Windows).
27
- * - The per-process extracted copy is identical across opens so
28
- * serving it from a stable disk path lets the OS file-cache
29
- * and Defender hash-cache stay warm across sessions.
17
+ * Rewrite rendered book HTML for the live preview: inject the Gutterpress
18
+ * engine's viewer bundle (`/engine/gutterpress-viewer.js`, embedded the same
19
+ * way as every other preview asset — see lib/embedded-assets.ts) PLUS the
20
+ * preview-interface.js/preview-bridge.js pair, before `</head>`.
21
+ * preview-interface.js defines `window.previewAPI` for in-iframe controls;
22
+ * preview-bridge.js is the postMessage bridge for the cross-origin desktop
23
+ * toolbar — together they make the desktop's whole
24
+ * `gutterpress:cmd/reply/event` command protocol work.
30
25
  *
31
- * With `pageIsolateChapters`, each source wrapper starts on a fresh page. This
32
- * is the v0.8.3 incremental-preview invariant: a standalone source render owns
33
- * the same page boundary as that source in the live preview and can be spliced
34
- * without paginating the full document.
26
+ * `pageIsolateChapters` is reserved for the one-source render. The full book
27
+ * always paginates as one document: native preview updates use a full iframe
28
+ * swap, so forcing every source wrapper to a new page buys no incremental
29
+ * splice boundary and diverges from the PDF whenever a source file begins in
30
+ * the middle of a printed page.
35
31
  */
36
32
  export declare function injectPreviewScripts(html: string, pageIsolateChapters: boolean): string;
37
33
  /**
@@ -42,7 +42,7 @@ export declare function validateInputPath(inputPath: string): Promise<void>;
42
42
  * For empty input (no-input mode), skip manifest loading entirely and
43
43
  * return a default resolved config.
44
44
  */
45
- export declare function initializeConfiguration(inputPath: string): Promise<ResolvedConfig>;
45
+ export declare function initializeConfiguration(inputPath: string, engine?: "paged" | "native"): Promise<ResolvedConfig>;
46
46
  /**
47
47
  * Restart the preview server with a new input directory.
48
48
  *
@@ -71,9 +71,17 @@
71
71
  window.addEventListener('sourceLineChanged', function (e) {
72
72
  post({ type: 'gutterpress:event', name: 'sourceLineChanged', detail: e.detail });
73
73
  });
74
+ window.addEventListener('viewportChanged', function (e) {
75
+ post({ type: 'gutterpress:event', name: 'viewportChanged', detail: e.detail });
76
+ });
74
77
  window.addEventListener('elementActivated', function (e) {
75
78
  post({ type: 'gutterpress:event', name: 'elementActivated', detail: e.detail });
76
79
  });
80
+ // docs/inline-editing-plan.md §3.1/§3.2 (protocol v4): right-click / keyboard
81
+ // context-menu target request.
82
+ window.addEventListener('contextMenuRequested', function (e) {
83
+ post({ type: 'gutterpress:event', name: 'contextMenuRequested', detail: e.detail });
84
+ });
77
85
 
78
86
  // Announce readiness as soon as previewAPI is defined.
79
87
  function announceReady() {