dsh-typst-plugin 0.1.0-alpha.0 → 0.1.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.
- package/README.en.md +86 -52
- package/README.md +93 -59
- package/cordis.patch.yml +1 -1
- package/docs/images/icon.png +0 -0
- package/lib/client.js +2088 -1136
- package/lib/client.js.map +4 -4
- package/lib/config.d.ts +66 -9
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +161 -25
- package/lib/config.js.map +1 -7
- package/lib/constants.d.ts +21 -2
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +83 -60
- package/lib/constants.js.map +1 -7
- package/lib/contract.d.ts +90 -6
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js +9 -1
- package/lib/contract.js.map +1 -7
- package/lib/diagnostic-text.d.ts +13 -0
- package/lib/diagnostic-text.d.ts.map +1 -0
- package/lib/diagnostic-text.js +28 -0
- package/lib/diagnostic-text.js.map +1 -0
- package/lib/errors.d.ts +57 -15
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +154 -79
- package/lib/errors.js.map +1 -7
- package/lib/host/facts.d.ts.map +1 -1
- package/lib/host/facts.js +133 -139
- package/lib/host/facts.js.map +1 -7
- package/lib/host/which.d.ts +20 -0
- package/lib/host/which.d.ts.map +1 -0
- package/lib/host/which.js +50 -0
- package/lib/host/which.js.map +1 -0
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -7
- package/lib/remote.d.ts +5 -4
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +153 -143
- package/lib/remote.js.map +1 -7
- package/lib/service.d.ts +28 -4
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +202 -99
- package/lib/service.js.map +1 -7
- package/lib/skills/typst.js +74 -68
- package/lib/skills/typst.js.map +1 -7
- package/lib/status-codec.js +10 -5
- package/lib/status-codec.js.map +1 -7
- package/lib/tools/registration.d.ts +4 -3
- package/lib/tools/registration.d.ts.map +1 -1
- package/lib/tools/registration.js +726 -493
- package/lib/tools/registration.js.map +1 -7
- package/lib/tools/shared.d.ts +4 -5
- package/lib/tools/shared.d.ts.map +1 -1
- package/lib/tools/shared.js +73 -64
- package/lib/tools/shared.js.map +1 -7
- package/lib/typert.d.ts +5 -3
- package/lib/typert.d.ts.map +1 -1
- package/lib/typert.js +113 -64
- package/lib/typert.js.map +1 -7
- package/lib/typst/diagnostics.d.ts.map +1 -1
- package/lib/typst/diagnostics.js +218 -152
- package/lib/typst/diagnostics.js.map +1 -7
- package/lib/typst/flags.d.ts +8 -0
- package/lib/typst/flags.d.ts.map +1 -0
- package/lib/typst/flags.js +8 -0
- package/lib/typst/flags.js.map +1 -0
- package/lib/typst/locate.d.ts +6 -13
- package/lib/typst/locate.d.ts.map +1 -1
- package/lib/typst/locate.js +138 -180
- package/lib/typst/locate.js.map +1 -7
- package/lib/typst/mainfile.d.ts +23 -4
- package/lib/typst/mainfile.d.ts.map +1 -1
- package/lib/typst/mainfile.js +131 -59
- package/lib/typst/mainfile.js.map +1 -7
- package/lib/typst/match.d.ts +9 -1
- package/lib/typst/match.d.ts.map +1 -1
- package/lib/typst/match.js +213 -157
- package/lib/typst/match.js.map +1 -7
- package/lib/typst/oneshot.d.ts +8 -5
- package/lib/typst/oneshot.d.ts.map +1 -1
- package/lib/typst/oneshot.js +76 -66
- package/lib/typst/oneshot.js.map +1 -7
- package/lib/typst/owners.d.ts +28 -0
- package/lib/typst/owners.d.ts.map +1 -0
- package/lib/typst/owners.js +98 -0
- package/lib/typst/owners.js.map +1 -0
- package/lib/typst/pdf-extract.d.ts +1 -2
- package/lib/typst/pdf-extract.d.ts.map +1 -1
- package/lib/typst/pdf-extract.js +98 -74
- package/lib/typst/pdf-extract.js.map +1 -7
- package/lib/typst/process.d.ts +73 -0
- package/lib/typst/process.d.ts.map +1 -0
- package/lib/typst/process.js +147 -0
- package/lib/typst/process.js.map +1 -0
- package/lib/typst/text.d.ts +4 -7
- package/lib/typst/text.d.ts.map +1 -1
- package/lib/typst/text.js +258 -290
- package/lib/typst/text.js.map +1 -7
- package/lib/typst/watcher.d.ts +16 -17
- package/lib/typst/watcher.d.ts.map +1 -1
- package/lib/typst/watcher.js +199 -208
- package/lib/typst/watcher.js.map +1 -7
- package/lib/wire-schemas.d.ts +8 -153
- package/lib/wire-schemas.d.ts.map +1 -1
- package/lib/wire-schemas.js +405 -361
- package/lib/wire-schemas.js.map +1 -7
- package/lib/workspace/containment.d.ts +25 -0
- package/lib/workspace/containment.d.ts.map +1 -0
- package/lib/workspace/containment.js +54 -0
- package/lib/workspace/containment.js.map +1 -0
- package/lib/workspace/session.d.ts +73 -14
- package/lib/workspace/session.d.ts.map +1 -1
- package/lib/workspace/session.js +1516 -1172
- package/lib/workspace/session.js.map +1 -7
- package/locale/en.json +8 -2
- package/locale/zh.json +8 -2
- package/package.json +36 -179
- package/release-provenance.json +137 -0
- package/lib/typst/pdfjs-worker.d.js +0 -1
- package/lib/typst/pdfjs-worker.d.js.map +0 -7
package/lib/typst/watcher.d.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The long-running `typst watch` child process: spawn, output parsing, PDF
|
|
3
|
-
* completeness polling, dependency tracking, and
|
|
4
|
-
* the ZCode typst-workbench server (0.2.0) `src/typst/watcher.ts`.
|
|
5
|
-
* half only.
|
|
3
|
+
* completeness polling, dependency tracking, and managed-range teardown.
|
|
4
|
+
* Ported from the ZCode typst-workbench server (0.2.0) `src/typst/watcher.ts`.
|
|
5
|
+
* Host half only.
|
|
6
6
|
*
|
|
7
7
|
* The watcher never edits files; it reads the PDF typst writes and reports
|
|
8
8
|
* events to its owner (the session). Ownership is enforced by identity: an
|
|
9
9
|
* event from a replaced watcher is dropped by the session's callbacks.
|
|
10
|
+
*
|
|
11
|
+
* The child is spawned through {@link ProcessRunner}, so the harness
|
|
12
|
+
* subprocess provider supplies the scrubbed environment, the managed process
|
|
13
|
+
* range, and host-exit termination. Process identity comes from that provider;
|
|
14
|
+
* this module keeps no pid file of its own.
|
|
10
15
|
* @module dsh-typst/typst/watcher
|
|
11
16
|
*/
|
|
12
|
-
|
|
17
|
+
import { type TypstFlagOptions } from "./flags.js";
|
|
18
|
+
import type { ProcessRunner } from "./process.js";
|
|
19
|
+
export interface WatcherOptions extends TypstFlagOptions {
|
|
13
20
|
typst: string;
|
|
14
21
|
version: string;
|
|
15
22
|
cwd: string;
|
|
16
|
-
/** Project sandbox root passed to Typst via `--root`. */
|
|
17
|
-
root?: string;
|
|
18
|
-
/** Extra directories searched recursively for fonts via `--font-path`. */
|
|
19
|
-
fontPaths?: string[];
|
|
20
23
|
main: string;
|
|
21
24
|
buildDir: string;
|
|
25
|
+
/** The host subprocess runner shared by the workbench. */
|
|
26
|
+
process: ProcessRunner;
|
|
27
|
+
/** Explicit environment layered after the provider's ambient scrub. */
|
|
22
28
|
env?: NodeJS.ProcessEnv;
|
|
23
29
|
toFile?: (path: string) => string;
|
|
24
30
|
log?: (message: string) => void;
|
|
@@ -29,7 +35,7 @@ export interface WatcherEvents {
|
|
|
29
35
|
outcome: "ok" | "warnings" | "error";
|
|
30
36
|
durationMs?: number;
|
|
31
37
|
diagnostics: import("../contract.js").DiagnosticView[];
|
|
32
|
-
bytes?: Uint8Array
|
|
38
|
+
bytes?: Uint8Array<ArrayBuffer>;
|
|
33
39
|
previewError?: string;
|
|
34
40
|
}): void | Promise<void>;
|
|
35
41
|
fatal(message: string): void;
|
|
@@ -40,12 +46,6 @@ export interface WatcherEvents {
|
|
|
40
46
|
expected: boolean;
|
|
41
47
|
}): void;
|
|
42
48
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Kill watch processes left behind by a previous session: every pid file in
|
|
45
|
-
* the build base whose process is still alive and is a typst binary (the
|
|
46
|
-
* command line still mentions typst).
|
|
47
|
-
*/
|
|
48
|
-
export declare function reapOrphans(base: string, log?: (message: string) => void): Promise<void>;
|
|
49
49
|
export declare class Watcher {
|
|
50
50
|
private readonly options;
|
|
51
51
|
private readonly on;
|
|
@@ -59,7 +59,6 @@ export declare class Watcher {
|
|
|
59
59
|
private parser;
|
|
60
60
|
constructor(options: WatcherOptions, on: WatcherEvents);
|
|
61
61
|
get running(): boolean;
|
|
62
|
-
get pid(): number | undefined;
|
|
63
62
|
private args;
|
|
64
63
|
start(): void;
|
|
65
64
|
/** Invalidate captures immediately when newer input starts compiling. */
|
|
@@ -69,7 +68,7 @@ export declare class Watcher {
|
|
|
69
68
|
private captureOutput;
|
|
70
69
|
/** Dependency files of the latest compile (absolute paths). */
|
|
71
70
|
deps(): Promise<string[]>;
|
|
72
|
-
/** Stop the watch process
|
|
71
|
+
/** Stop the watch process; the provider escalates TERM→KILL within grace. */
|
|
73
72
|
stop(): Promise<void>;
|
|
74
73
|
/** Synchronous teardown (process exit). */
|
|
75
74
|
killNow(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/typst/watcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/typst/watcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAehE,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,OAAO,EAAE,aAAa,CAAC;IACvB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,GAAG,CAAC,EAA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db,yEAAyE;IACzE,OAAO,CAAC,KAAK,CAAoC;IAEjD,OAAO,CAAC,MAAM;IA4Bd,iFAAiF;YACnE,aAAa;IAmC3B,+DAA+D;IACzD,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ/B,6EAA6E;IACvE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,2CAA2C;IAC3C,OAAO,IAAI,IAAI;CAIhB"}
|
package/lib/typst/watcher.js
CHANGED
|
@@ -1,219 +1,210 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The long-running `typst watch` child process: spawn, output parsing, PDF
|
|
3
|
+
* completeness polling, dependency tracking, and managed-range teardown.
|
|
4
|
+
* Ported from the ZCode typst-workbench server (0.2.0) `src/typst/watcher.ts`.
|
|
5
|
+
* Host half only.
|
|
6
|
+
*
|
|
7
|
+
* The watcher never edits files; it reads the PDF typst writes and reports
|
|
8
|
+
* events to its owner (the session). Ownership is enforced by identity: an
|
|
9
|
+
* event from a replaced watcher is dropped by the session's callbacks.
|
|
10
|
+
*
|
|
11
|
+
* The child is spawned through {@link ProcessRunner}, so the harness
|
|
12
|
+
* subprocess provider supplies the scrubbed environment, the managed process
|
|
13
|
+
* range, and host-exit termination. Process identity comes from that provider;
|
|
14
|
+
* this module keeps no pid file of its own.
|
|
15
|
+
* @module dsh-typst/typst/watcher
|
|
16
|
+
*/
|
|
17
|
+
import { rmSync } from "node:fs";
|
|
18
|
+
import { readFile, stat } from "node:fs/promises";
|
|
4
19
|
import { isAbsolute, join, resolve } from "node:path";
|
|
20
|
+
import { LIMITS } from "../constants.js";
|
|
5
21
|
import { atLeast } from "./locate.js";
|
|
6
22
|
import { parseDeps, WatchLog } from "./diagnostics.js";
|
|
7
|
-
|
|
23
|
+
import { typstFlags } from "./flags.js";
|
|
24
|
+
/** Silence window before a watch round's diagnostics are finalized. */
|
|
25
|
+
const QUIET_MS = 100;
|
|
26
|
+
/** A complete PDF has the header near the start and the marker near the end. */
|
|
8
27
|
function isCompletePdf(bytes) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
bytes.subarray(Math.max(0, bytes.length - 1024))
|
|
13
|
-
|
|
14
|
-
return head.includes("%PDF-") && tail.includes("%%EOF");
|
|
28
|
+
if (bytes.length < 16)
|
|
29
|
+
return false;
|
|
30
|
+
const head = Buffer.from(bytes.subarray(0, 1024)).toString("latin1");
|
|
31
|
+
const tail = Buffer.from(bytes.subarray(Math.max(0, bytes.length - 1024))).toString("latin1");
|
|
32
|
+
return head.includes("%PDF-") && tail.includes("%%EOF");
|
|
15
33
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
export class Watcher {
|
|
35
|
+
options;
|
|
36
|
+
on;
|
|
37
|
+
pdfPath;
|
|
38
|
+
depsPath;
|
|
39
|
+
child = null;
|
|
40
|
+
stopping = false;
|
|
41
|
+
quiet = null;
|
|
42
|
+
revision = 0;
|
|
43
|
+
tail = "";
|
|
44
|
+
parser;
|
|
45
|
+
constructor(options, on) {
|
|
46
|
+
this.options = options;
|
|
47
|
+
this.on = on;
|
|
48
|
+
this.pdfPath = join(options.buildDir, "preview.pdf");
|
|
49
|
+
this.depsPath = join(options.buildDir, "deps.txt");
|
|
50
|
+
this.parser = new WatchLog((event) => this.handle(event), options.toFile);
|
|
24
51
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function alive(pid) {
|
|
30
|
-
try {
|
|
31
|
-
process.kill(pid, 0);
|
|
32
|
-
return true;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
return error.code === "EPERM";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function reapOrphans(base, log) {
|
|
38
|
-
let entries;
|
|
39
|
-
try {
|
|
40
|
-
entries = await readdir(base, { withFileTypes: true });
|
|
41
|
-
} catch {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
for (const entry of entries) {
|
|
45
|
-
if (!entry.isDirectory()) continue;
|
|
46
|
-
const dir = join(base, entry.name);
|
|
47
|
-
const pidPath = join(dir, "watch.pid");
|
|
48
|
-
const raw = await readFile(pidPath, "utf8").catch(() => null);
|
|
49
|
-
const pid = raw !== null ? Number.parseInt(raw.trim(), 10) : Number.NaN;
|
|
50
|
-
if (Number.isInteger(pid) && alive(pid)) {
|
|
51
|
-
const cmdline = await readFile(`/proc/${pid}/cmdline`, "utf8").catch(
|
|
52
|
-
() => null
|
|
53
|
-
);
|
|
54
|
-
if (cmdline === null || cmdline.includes("typst")) {
|
|
55
|
-
log?.(`stopping typst watch ${pid} left by a previous session`);
|
|
56
|
-
try {
|
|
57
|
-
if (process.platform !== "win32") process.kill(-pid, "SIGKILL");
|
|
58
|
-
else process.kill(pid, "SIGKILL");
|
|
59
|
-
} catch {
|
|
60
|
-
}
|
|
61
|
-
}
|
|
52
|
+
get running() {
|
|
53
|
+
return !!this.child && !this.stopping;
|
|
62
54
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
child.on("close", (code, signal) => {
|
|
132
|
-
if (this.child !== child) return;
|
|
133
|
-
this.child = null;
|
|
134
|
-
this.parser.feed("\n");
|
|
135
|
-
this.parser.finalize();
|
|
136
|
-
const expected = this.stopping;
|
|
137
|
-
this.stopping = false;
|
|
138
|
-
this.on.exit({
|
|
139
|
-
code,
|
|
140
|
-
signal,
|
|
141
|
-
tail: this.tail.trim().slice(-1500),
|
|
142
|
-
expected
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/** Invalidate captures immediately when newer input starts compiling. */
|
|
147
|
-
queue = Promise.resolve();
|
|
148
|
-
handle(event) {
|
|
149
|
-
if (event.kind === "compiling") {
|
|
150
|
-
this.revision++;
|
|
151
|
-
this.on.compiling(Date.now());
|
|
152
|
-
return;
|
|
55
|
+
args() {
|
|
56
|
+
const { main, version } = this.options;
|
|
57
|
+
const deps = atLeast(version, [0, 14, 0])
|
|
58
|
+
? ["--deps", this.depsPath, "--deps-format", "json"]
|
|
59
|
+
: ["--make-deps", this.depsPath];
|
|
60
|
+
return ["watch", main, this.pdfPath, ...deps, ...typstFlags(this.options)];
|
|
61
|
+
}
|
|
62
|
+
start() {
|
|
63
|
+
if (this.child)
|
|
64
|
+
return;
|
|
65
|
+
this.stopping = false;
|
|
66
|
+
rmSync(this.pdfPath, { force: true });
|
|
67
|
+
rmSync(this.depsPath, { force: true });
|
|
68
|
+
const args = this.args();
|
|
69
|
+
this.options.log?.(`starting ${this.options.typst} ${args.join(" ")}`);
|
|
70
|
+
const child = this.options.process.spawnPiped([this.options.typst, ...args], {
|
|
71
|
+
cwd: this.options.cwd,
|
|
72
|
+
graceMs: LIMITS.stopGraceMs,
|
|
73
|
+
...(this.options.env === undefined ? {} : { env: this.options.env }),
|
|
74
|
+
});
|
|
75
|
+
this.child = child;
|
|
76
|
+
child.onOutput((text) => {
|
|
77
|
+
this.tail = (this.tail + text).slice(-4_000);
|
|
78
|
+
const pending = this.parser.feed(text);
|
|
79
|
+
if (this.quiet)
|
|
80
|
+
clearTimeout(this.quiet);
|
|
81
|
+
this.quiet = pending
|
|
82
|
+
? setTimeout(() => this.parser.finalize(), QUIET_MS)
|
|
83
|
+
: null;
|
|
84
|
+
});
|
|
85
|
+
// The output listener registers its own `done` continuation before this
|
|
86
|
+
// one, so the decoder tail is delivered before the exit event.
|
|
87
|
+
void child.done.then((outcome) => {
|
|
88
|
+
if (this.child !== child)
|
|
89
|
+
return;
|
|
90
|
+
this.child = null;
|
|
91
|
+
if (this.quiet)
|
|
92
|
+
clearTimeout(this.quiet);
|
|
93
|
+
this.quiet = null;
|
|
94
|
+
this.parser.feed("\n");
|
|
95
|
+
this.parser.finalize();
|
|
96
|
+
const expected = this.stopping;
|
|
97
|
+
this.stopping = false;
|
|
98
|
+
this.on.exit({
|
|
99
|
+
code: outcome.exitCode,
|
|
100
|
+
signal: outcome.signal,
|
|
101
|
+
tail: this.tail.trim().slice(-1500),
|
|
102
|
+
expected,
|
|
103
|
+
});
|
|
104
|
+
}, (error) => {
|
|
105
|
+
if (this.child !== child)
|
|
106
|
+
return;
|
|
107
|
+
this.child = null;
|
|
108
|
+
if (this.quiet)
|
|
109
|
+
clearTimeout(this.quiet);
|
|
110
|
+
this.quiet = null;
|
|
111
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
112
|
+
this.tail += `\n${detail}`;
|
|
113
|
+
const expected = this.stopping;
|
|
114
|
+
this.stopping = false;
|
|
115
|
+
this.on.exit({
|
|
116
|
+
code: null,
|
|
117
|
+
signal: null,
|
|
118
|
+
tail: this.tail.trim().slice(-1500),
|
|
119
|
+
expected,
|
|
120
|
+
});
|
|
121
|
+
});
|
|
153
122
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (event.outcome !== "error") {
|
|
162
|
-
try {
|
|
163
|
-
bytes = await this.captureOutput(revision);
|
|
164
|
-
} catch (error) {
|
|
165
|
-
previewError = error instanceof Error ? error.message : String(error);
|
|
123
|
+
/** Invalidate captures immediately when newer input starts compiling. */
|
|
124
|
+
queue = Promise.resolve();
|
|
125
|
+
handle(event) {
|
|
126
|
+
if (event.kind === "compiling") {
|
|
127
|
+
this.revision++;
|
|
128
|
+
this.on.compiling(Date.now());
|
|
129
|
+
return;
|
|
166
130
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
131
|
+
const revision = this.revision;
|
|
132
|
+
this.queue = this.queue
|
|
133
|
+
.then(async () => {
|
|
134
|
+
if (revision !== this.revision || this.stopping)
|
|
135
|
+
return;
|
|
136
|
+
if (event.kind === "fatal")
|
|
137
|
+
return this.on.fatal(event.message);
|
|
138
|
+
if (event.kind !== "finished")
|
|
139
|
+
return;
|
|
140
|
+
let bytes;
|
|
141
|
+
let previewError;
|
|
142
|
+
if (event.outcome !== "error") {
|
|
143
|
+
try {
|
|
144
|
+
bytes = await this.captureOutput(revision);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
previewError =
|
|
148
|
+
error instanceof Error ? error.message : String(error);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (revision !== this.revision || this.stopping)
|
|
152
|
+
return;
|
|
153
|
+
await this.on.finished({ ...event, bytes, previewError });
|
|
154
|
+
})
|
|
155
|
+
.catch((error) => this.on.fatal(String(error)));
|
|
156
|
+
}
|
|
157
|
+
/** Read a complete stable artifact only after the matching successful finish. */
|
|
158
|
+
async captureOutput(revision) {
|
|
159
|
+
for (let attempt = 0; attempt < 20; attempt++) {
|
|
160
|
+
if (revision !== this.revision || this.stopping)
|
|
161
|
+
return;
|
|
162
|
+
const before = await stat(this.pdfPath).catch(() => null);
|
|
163
|
+
if (before) {
|
|
164
|
+
if (before.size > LIMITS.pdfBytes) {
|
|
165
|
+
throw new Error(`The preview PDF is ${before.size} bytes, above the ${LIMITS.pdfBytes}-byte preview limit.`);
|
|
166
|
+
}
|
|
167
|
+
const bytes = new Uint8Array(await readFile(this.pdfPath));
|
|
168
|
+
if (bytes.length > LIMITS.pdfBytes) {
|
|
169
|
+
throw new Error(`The preview PDF is ${bytes.length} bytes, above the ${LIMITS.pdfBytes}-byte preview limit.`);
|
|
170
|
+
}
|
|
171
|
+
const after = await stat(this.pdfPath);
|
|
172
|
+
if (before.mtimeMs === after.mtimeMs &&
|
|
173
|
+
before.size === after.size &&
|
|
174
|
+
isCompletePdf(bytes))
|
|
175
|
+
return bytes;
|
|
176
|
+
}
|
|
177
|
+
await new Promise((done) => setTimeout(done, 25));
|
|
178
|
+
}
|
|
179
|
+
throw new Error("Typst finished but did not produce a complete preview PDF. Retry the preview.");
|
|
180
|
+
}
|
|
181
|
+
/** Dependency files of the latest compile (absolute paths). */
|
|
182
|
+
async deps() {
|
|
183
|
+
const text = await readFile(this.depsPath, "utf8").catch(() => "");
|
|
184
|
+
const base = this.options.root ?? this.options.cwd;
|
|
185
|
+
return parseDeps(text)
|
|
186
|
+
.filter((path) => !path.includes("*"))
|
|
187
|
+
.map((path) => (isAbsolute(path) ? path : resolve(base, path)));
|
|
188
|
+
}
|
|
189
|
+
/** Stop the watch process; the provider escalates TERM→KILL within grace. */
|
|
190
|
+
async stop() {
|
|
191
|
+
const child = this.child;
|
|
192
|
+
if (!child)
|
|
193
|
+
return;
|
|
194
|
+
this.stopping = true;
|
|
195
|
+
if (this.quiet)
|
|
196
|
+
clearTimeout(this.quiet);
|
|
197
|
+
this.quiet = null;
|
|
198
|
+
this.revision++;
|
|
199
|
+
child.terminate();
|
|
200
|
+
await child
|
|
201
|
+
.waitForExit(AbortSignal.timeout(LIMITS.stopGraceMs + 1_000))
|
|
202
|
+
.catch(() => false);
|
|
203
|
+
}
|
|
204
|
+
/** Synchronous teardown (process exit). */
|
|
205
|
+
killNow() {
|
|
206
|
+
this.stopping = true;
|
|
207
|
+
this.child?.terminate();
|
|
184
208
|
}
|
|
185
|
-
throw new Error(
|
|
186
|
-
"Typst finished but did not produce a complete preview PDF. Retry the preview."
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
/** Dependency files of the latest compile (absolute paths). */
|
|
190
|
-
async deps() {
|
|
191
|
-
const text = await readFile(this.depsPath, "utf8").catch(() => "");
|
|
192
|
-
const base = this.options.root ?? this.options.cwd;
|
|
193
|
-
return parseDeps(text).filter((path) => !path.includes("*")).map((path) => isAbsolute(path) ? path : resolve(base, path));
|
|
194
|
-
}
|
|
195
|
-
/** Stop the watch process (with its process group). */
|
|
196
|
-
async stop() {
|
|
197
|
-
const child = this.child;
|
|
198
|
-
if (!child) return;
|
|
199
|
-
this.stopping = true;
|
|
200
|
-
if (this.quiet) clearTimeout(this.quiet);
|
|
201
|
-
this.revision++;
|
|
202
|
-
const closed = new Promise(
|
|
203
|
-
(done) => child.once("close", () => done())
|
|
204
|
-
);
|
|
205
|
-
killTree(child, "SIGTERM");
|
|
206
|
-
const timer = setTimeout(() => killTree(child, "SIGKILL"), 2e3);
|
|
207
|
-
await closed;
|
|
208
|
-
clearTimeout(timer);
|
|
209
|
-
}
|
|
210
|
-
/** Synchronous teardown (process exit). */
|
|
211
|
-
killNow() {
|
|
212
|
-
if (this.child) killTree(this.child, "SIGKILL");
|
|
213
|
-
}
|
|
214
209
|
}
|
|
215
|
-
|
|
216
|
-
Watcher,
|
|
217
|
-
reapOrphans
|
|
218
|
-
};
|
|
219
|
-
//# sourceMappingURL=watcher.js.map
|
|
210
|
+
//# sourceMappingURL=watcher.js.map
|
package/lib/typst/watcher.js.map
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/typst/watcher.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The long-running `typst watch` child process: spawn, output parsing, PDF\n * completeness polling, dependency tracking, and tree teardown. Ported from\n * the ZCode typst-workbench server (0.2.0) `src/typst/watcher.ts`. Host\n * half only.\n *\n * The watcher never edits files; it reads the PDF typst writes and reports\n * events to its owner (the session). Ownership is enforced by identity: an\n * event from a replaced watcher is dropped by the session's callbacks.\n * @module dsh-typst/typst/watcher\n */\n\nimport { spawn } from \"node:child_process\";\nimport { rmSync, writeFileSync } from \"node:fs\";\nimport { readdir, readFile, rm, stat } from \"node:fs/promises\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { atLeast } from \"./locate.js\";\nimport { parseDeps, WatchLog, type WatchEvent } from \"./diagnostics.js\";\n\n/** Silence window before a watch round's diagnostics are finalized. */\nconst QUIET_MS = 25;\n\n/** A complete PDF has the header near the start and the marker near the end. */\nfunction isCompletePdf(bytes: Uint8Array): boolean {\n if (bytes.length < 16) return false;\n const head = Buffer.from(bytes.subarray(0, 1024)).toString(\"latin1\");\n const tail = Buffer.from(\n bytes.subarray(Math.max(0, bytes.length - 1024)),\n ).toString(\"latin1\");\n return head.includes(\"%PDF-\") && tail.includes(\"%%EOF\");\n}\n\nexport interface WatcherOptions {\n typst: string;\n version: string;\n cwd: string;\n /** Project sandbox root passed to Typst via `--root`. */\n root?: string;\n /** Extra directories searched recursively for fonts via `--font-path`. */\n fontPaths?: string[];\n main: string;\n buildDir: string;\n env?: NodeJS.ProcessEnv;\n toFile?: (path: string) => string;\n log?: (message: string) => void;\n}\n\nexport interface WatcherEvents {\n compiling(startedAt: number): void;\n finished(event: {\n outcome: \"ok\" | \"warnings\" | \"error\";\n durationMs?: number;\n diagnostics: import(\"../contract.js\").DiagnosticView[];\n bytes?: Uint8Array;\n previewError?: string;\n }): void | Promise<void>;\n fatal(message: string): void;\n exit(event: {\n code: number | null;\n signal: NodeJS.Signals | null;\n tail: string;\n expected: boolean;\n }): void;\n}\n\n/** Kill a child and, on POSIX, its whole process group. */\nfunction killTree(\n child: import(\"node:child_process\").ChildProcess,\n signal: NodeJS.Signals,\n): void {\n try {\n if (process.platform !== \"win32\" && child.pid !== undefined) {\n try {\n process.kill(-child.pid, signal);\n return;\n } catch {\n // No process group (spawn without detached): fall through.\n }\n }\n child.kill(signal);\n } catch {\n // Already gone.\n }\n}\n\nfunction alive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === \"EPERM\";\n }\n}\n\n/**\n * Kill watch processes left behind by a previous session: every pid file in\n * the build base whose process is still alive and is a typst binary (the\n * command line still mentions typst).\n */\nexport async function reapOrphans(\n base: string,\n log?: (message: string) => void,\n): Promise<void> {\n let entries: import(\"node:fs\").Dirent[];\n try {\n entries = await readdir(base, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n const dir = join(base, entry.name);\n const pidPath = join(dir, \"watch.pid\");\n const raw = await readFile(pidPath, \"utf8\").catch(() => null);\n const pid = raw !== null ? Number.parseInt(raw.trim(), 10) : Number.NaN;\n if (Number.isInteger(pid) && alive(pid)) {\n const cmdline = await readFile(`/proc/${pid}/cmdline`, \"utf8\").catch(\n () => null,\n );\n if (cmdline === null || cmdline.includes(\"typst\")) {\n log?.(`stopping typst watch ${pid} left by a previous session`);\n try {\n if (process.platform !== \"win32\") process.kill(-pid, \"SIGKILL\");\n else process.kill(pid, \"SIGKILL\");\n } catch {\n // Gone between the check and the kill.\n }\n }\n }\n await rm(dir, { recursive: true, force: true }).catch(() => undefined);\n }\n}\n\nexport class Watcher {\n readonly pdfPath: string;\n readonly depsPath: string;\n private child: import(\"node:child_process\").ChildProcess | null = null;\n private stopping = false;\n private quiet: NodeJS.Timeout | null = null;\n private revision = 0;\n private tail = \"\";\n private parser: WatchLog;\n\n constructor(\n private readonly options: WatcherOptions,\n private readonly on: WatcherEvents,\n ) {\n this.pdfPath = join(options.buildDir, \"preview.pdf\");\n this.depsPath = join(options.buildDir, \"deps.txt\");\n this.parser = new WatchLog((event) => this.handle(event), options.toFile);\n }\n\n get running(): boolean {\n return !!this.child && !this.stopping;\n }\n\n get pid(): number | undefined {\n return this.child?.pid;\n }\n\n private args(): string[] {\n const { main, version, root, fontPaths } = this.options;\n const deps = atLeast(version, [0, 14, 0])\n ? [\"--deps\", this.depsPath, \"--deps-format\", \"json\"]\n : [\"--make-deps\", this.depsPath];\n const rootArgs = root ? [\"--root\", root] : [];\n const fontArgs = (fontPaths ?? []).flatMap((dir) => [\"--font-path\", dir]);\n return [\"watch\", main, this.pdfPath, ...deps, ...rootArgs, ...fontArgs];\n }\n\n start(): void {\n if (this.child) return;\n this.stopping = false;\n for (const path of [this.pdfPath, this.depsPath])\n rmSync(path, { force: true });\n const args = this.args();\n this.options.log?.(`starting ${this.options.typst} ${args.join(\" \")}`);\n const child = spawn(this.options.typst, args, {\n cwd: this.options.cwd,\n env: this.options.env ?? process.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n // Its own process group: teardown ends the whole tree.\n detached: process.platform !== \"win32\",\n windowsHide: true,\n });\n this.child = child;\n if (child.pid)\n writeFileSync(\n join(this.options.buildDir, \"watch.pid\"),\n String(child.pid),\n );\n const onData = (chunk: Buffer): void => {\n const text = chunk.toString(\"utf8\");\n this.tail = (this.tail + text).slice(-4_000);\n const pending = this.parser.feed(text);\n if (this.quiet) clearTimeout(this.quiet);\n this.quiet = pending\n ? setTimeout(() => this.parser.finalize(), QUIET_MS)\n : null;\n };\n child.stdout?.on(\"data\", onData);\n child.stderr?.on(\"data\", onData);\n child.on(\"error\", (error: Error) => {\n this.tail += `\\n${error.message}`;\n });\n child.on(\"close\", (code, signal) => {\n if (this.child !== child) return;\n this.child = null;\n this.parser.feed(\"\\n\");\n this.parser.finalize();\n const expected = this.stopping;\n this.stopping = false;\n this.on.exit({\n code,\n signal,\n tail: this.tail.trim().slice(-1500),\n expected,\n });\n });\n }\n\n /** Invalidate captures immediately when newer input starts compiling. */\n private queue: Promise<void> = Promise.resolve();\n\n private handle(event: WatchEvent): void {\n if (event.kind === \"compiling\") {\n this.revision++;\n this.on.compiling(Date.now());\n return;\n }\n const revision = this.revision;\n this.queue = this.queue\n .then(async () => {\n if (revision !== this.revision || this.stopping) return;\n if (event.kind === \"fatal\") return this.on.fatal(event.message);\n if (event.kind !== \"finished\") return;\n let bytes: Uint8Array | undefined;\n let previewError: string | undefined;\n if (event.outcome !== \"error\") {\n try {\n bytes = await this.captureOutput(revision);\n } catch (error) {\n previewError =\n error instanceof Error ? error.message : String(error);\n }\n }\n if (revision !== this.revision || this.stopping) return;\n await this.on.finished({ ...event, bytes, previewError });\n })\n .catch((error) => this.on.fatal(String(error)));\n }\n\n /** Read a complete stable artifact only after the matching successful finish. */\n private async captureOutput(\n revision: number,\n ): Promise<Uint8Array | undefined> {\n for (let attempt = 0; attempt < 20; attempt++) {\n if (revision !== this.revision || this.stopping) return;\n const before = await stat(this.pdfPath).catch(() => null);\n if (before) {\n const bytes = new Uint8Array(await readFile(this.pdfPath));\n const after = await stat(this.pdfPath);\n if (\n before.mtimeMs === after.mtimeMs &&\n before.size === after.size &&\n isCompletePdf(bytes)\n )\n return bytes;\n }\n await new Promise((done) => setTimeout(done, 25));\n }\n throw new Error(\n \"Typst finished but did not produce a complete preview PDF. Retry the preview.\",\n );\n }\n\n /** Dependency files of the latest compile (absolute paths). */\n async deps(): Promise<string[]> {\n const text = await readFile(this.depsPath, \"utf8\").catch(() => \"\");\n const base = this.options.root ?? this.options.cwd;\n return parseDeps(text)\n .filter((path) => !path.includes(\"*\"))\n .map((path) => (isAbsolute(path) ? path : resolve(base, path)));\n }\n\n /** Stop the watch process (with its process group). */\n async stop(): Promise<void> {\n const child = this.child;\n if (!child) return;\n this.stopping = true;\n if (this.quiet) clearTimeout(this.quiet);\n this.revision++;\n const closed = new Promise<void>((done) =>\n child.once(\"close\", () => done()),\n );\n killTree(child, \"SIGTERM\");\n const timer = setTimeout(() => killTree(child, \"SIGKILL\"), 2_000);\n await closed;\n clearTimeout(timer);\n }\n\n /** Synchronous teardown (process exit). */\n killNow(): void {\n if (this.child) killTree(this.child, \"SIGKILL\");\n }\n}\n"],
|
|
5
|
-
"mappings": "AAYA,SAAS,aAAa;AACtB,SAAS,QAAQ,qBAAqB;AACtC,SAAS,SAAS,UAAU,IAAI,YAAY;AAC5C,SAAS,YAAY,MAAM,eAAe;AAC1C,SAAS,eAAe;AACxB,SAAS,WAAW,gBAAiC;AAGrD,MAAM,WAAW;AAGjB,SAAS,cAAc,OAA4B;AACjD,MAAI,MAAM,SAAS,GAAI,QAAO;AAC9B,QAAM,OAAO,OAAO,KAAK,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,SAAS,QAAQ;AACnE,QAAM,OAAO,OAAO;AAAA,IAClB,MAAM,SAAS,KAAK,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC;AAAA,EACjD,EAAE,SAAS,QAAQ;AACnB,SAAO,KAAK,SAAS,OAAO,KAAK,KAAK,SAAS,OAAO;AACxD;AAoCA,SAAS,SACP,OACA,QACM;AACN,MAAI;AACF,QAAI,QAAQ,aAAa,WAAW,MAAM,QAAQ,QAAW;AAC3D,UAAI;AACF,gBAAQ,KAAK,CAAC,MAAM,KAAK,MAAM;AAC/B;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;AACA,UAAM,KAAK,MAAM;AAAA,EACnB,QAAQ;AAAA,EAER;AACF;AAEA,SAAS,MAAM,KAAsB;AACnC,MAAI;AACF,YAAQ,KAAK,KAAK,CAAC;AACnB,WAAO;AAAA,EAC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