@incremental/client 0.0.0-stage → 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.md +1 -3
- package/bin/client.js +18 -0
- package/dist/src/client.d.ts +32 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +374 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/errors.d.ts +8 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +36 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types.d.ts +132 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +3 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +26 -4
package/README.md
CHANGED
package/bin/client.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `incremental-client` helper: resolves and prints the engine binary path.
|
|
3
|
+
//
|
|
4
|
+
// incremental-client engine-path
|
|
5
|
+
// incremental-client version
|
|
6
|
+
|
|
7
|
+
import { enginePath } from "@incremental/engine";
|
|
8
|
+
|
|
9
|
+
const cmd = process.argv[2];
|
|
10
|
+
|
|
11
|
+
if (cmd === "engine-path") {
|
|
12
|
+
console.log(enginePath());
|
|
13
|
+
} else if (cmd === "version") {
|
|
14
|
+
console.log("0.1.0");
|
|
15
|
+
} else {
|
|
16
|
+
console.error("usage: incremental-client <engine-path|version>");
|
|
17
|
+
process.exit(2);
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AffectedOptions, ChangeSet, CompactResult, ConnectOptions, Explanation, Hello, Observation, Plan, Stats } from "./types.js";
|
|
2
|
+
export declare const CLIENT_VERSION = "0.1.0";
|
|
3
|
+
export interface incremental {
|
|
4
|
+
readonly protocol: 1;
|
|
5
|
+
readonly pid: number | undefined;
|
|
6
|
+
hello(): Promise<Hello>;
|
|
7
|
+
observe(obs: Observation): Promise<{
|
|
8
|
+
accepted: true;
|
|
9
|
+
}>;
|
|
10
|
+
observeMany(obs: Observation[]): Promise<{
|
|
11
|
+
accepted: number;
|
|
12
|
+
}>;
|
|
13
|
+
baseline(): Promise<{
|
|
14
|
+
baseline: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
advance(to: string, expected: string | null): Promise<{
|
|
17
|
+
baseline: string;
|
|
18
|
+
}>;
|
|
19
|
+
affected(changes: ChangeSet, options: AffectedOptions): Promise<Plan>;
|
|
20
|
+
explain(task: string): Promise<Explanation>;
|
|
21
|
+
forget(task: string): Promise<{
|
|
22
|
+
forgotten: true;
|
|
23
|
+
}>;
|
|
24
|
+
stats(): Promise<Stats>;
|
|
25
|
+
compact(): Promise<CompactResult>;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare function repoRoot(): string;
|
|
29
|
+
export declare function defaultEngine(): string;
|
|
30
|
+
export declare function defaultStore(): string;
|
|
31
|
+
export declare function connect(opts?: ConnectOptions): Promise<incremental>;
|
|
32
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sources":["../../src/client.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,cAAc,UAAU,CAAC;AAUtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAGrB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACvD,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,QAAQ,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACnD,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAID,wBAAgB,QAAQ,IAAI,MAAM,CAQjC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAkBtC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AA0WD,wBAAsB,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAc7E"}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// @incremental/client: process supervision and the protocol v1 methods
|
|
2
|
+
// (plans/PLAN.md 10.1, 9.3, 9.8). The client spawns `incremental serve`, speaks
|
|
3
|
+
// one JSON object per line, matches answers by id, and runs requests one at a
|
|
4
|
+
// time in arrival order.
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { incrementalError } from "./errors.js";
|
|
11
|
+
export const CLIENT_VERSION = "0.1.0";
|
|
12
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
13
|
+
// The handshake covers process start-up, which is not a protocol request, so
|
|
14
|
+
// it has its own budget (the server-side budget of PLAN 9.8).
|
|
15
|
+
const STARTUP_TIMEOUT_MS = 10_000;
|
|
16
|
+
const CLOSE_GRACE_MS = 2_000;
|
|
17
|
+
// Methods that do not change the store. Only these are retried after the
|
|
18
|
+
// server dies mid-request; a write may or may not have happened.
|
|
19
|
+
const READ_ONLY = new Set(["hello", "baseline", "affected", "explain", "stats", "ping"]);
|
|
20
|
+
// The repository root: the nearest ancestor of this file that holds
|
|
21
|
+
// tsconfig.base.json. Falls back to the working directory outside the repo.
|
|
22
|
+
export function repoRoot() {
|
|
23
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
for (;;) {
|
|
25
|
+
if (existsSync(path.join(dir, "tsconfig.base.json")))
|
|
26
|
+
return dir;
|
|
27
|
+
const up = path.dirname(dir);
|
|
28
|
+
if (up === dir)
|
|
29
|
+
return process.cwd();
|
|
30
|
+
dir = up;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function defaultEngine() {
|
|
34
|
+
// 1. INCREMENTAL_ENGINE env var (explicit override)
|
|
35
|
+
const env = process.env.INCREMENTAL_ENGINE;
|
|
36
|
+
if (env)
|
|
37
|
+
return env;
|
|
38
|
+
// 2. Resolve via @incremental/engine package (bundled prebuilt binary).
|
|
39
|
+
// Use createRequire so this works synchronously without top-level await.
|
|
40
|
+
try {
|
|
41
|
+
const require = createRequire(import.meta.url);
|
|
42
|
+
const { enginePath } = require("@incremental/engine");
|
|
43
|
+
const resolved = enginePath();
|
|
44
|
+
if (resolved && existsSync(resolved))
|
|
45
|
+
return resolved;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// @incremental/engine not installed or cannot resolve; fall through.
|
|
49
|
+
}
|
|
50
|
+
// 3. Dev-mode fallback: core/dist/incremental relative to the incremental repo root
|
|
51
|
+
return path.join(repoRoot(), "core", "dist", "incremental");
|
|
52
|
+
}
|
|
53
|
+
export function defaultStore() {
|
|
54
|
+
return path.resolve(process.env.INCREMENTAL_STORE || path.join(repoRoot(), ".incremental"));
|
|
55
|
+
}
|
|
56
|
+
function isRecord(v) {
|
|
57
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
58
|
+
}
|
|
59
|
+
function isExitedError(e) {
|
|
60
|
+
return e instanceof incrementalError && isRecord(e.data) && e.data.reason === "exited";
|
|
61
|
+
}
|
|
62
|
+
// A plan is never returned partially: all fields of PLAN 9.6 must be present.
|
|
63
|
+
function checkPlan(v) {
|
|
64
|
+
const complete = isRecord(v) &&
|
|
65
|
+
Array.isArray(v.tasks) &&
|
|
66
|
+
Array.isArray(v.unobserved) &&
|
|
67
|
+
Array.isArray(v.ignored) &&
|
|
68
|
+
Array.isArray(v.deleted_tasks) &&
|
|
69
|
+
"fallback" in v &&
|
|
70
|
+
"confidence" in v &&
|
|
71
|
+
"graph_version" in v;
|
|
72
|
+
if (!complete) {
|
|
73
|
+
throw new incrementalError("internal", "the server answered affected with an incomplete plan", {
|
|
74
|
+
reason: "partial_plan",
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return v;
|
|
78
|
+
}
|
|
79
|
+
class IncrementalClient {
|
|
80
|
+
protocol = 1;
|
|
81
|
+
command;
|
|
82
|
+
store;
|
|
83
|
+
root;
|
|
84
|
+
timeoutMs;
|
|
85
|
+
restart;
|
|
86
|
+
current = null;
|
|
87
|
+
started = false;
|
|
88
|
+
closed = false;
|
|
89
|
+
nextId = 1;
|
|
90
|
+
chain = Promise.resolve();
|
|
91
|
+
constructor(command, store, root, timeoutMs, restart) {
|
|
92
|
+
this.command = command;
|
|
93
|
+
this.store = store;
|
|
94
|
+
this.root = root;
|
|
95
|
+
this.timeoutMs = timeoutMs;
|
|
96
|
+
this.restart = restart;
|
|
97
|
+
}
|
|
98
|
+
get pid() {
|
|
99
|
+
return this.current?.proc.pid;
|
|
100
|
+
}
|
|
101
|
+
// Requests run one at a time, in the order they were called.
|
|
102
|
+
enqueue(task) {
|
|
103
|
+
const result = this.chain.then(task);
|
|
104
|
+
this.chain = result.then(() => undefined, () => undefined);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
hello() {
|
|
108
|
+
return this.enqueue(async () => {
|
|
109
|
+
const run = await this.ensure();
|
|
110
|
+
if (run.hello === null)
|
|
111
|
+
throw new incrementalError("internal", "no handshake", { reason: "bad_handshake" });
|
|
112
|
+
return run.hello;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
observe(obs) {
|
|
116
|
+
return this.request("observe", { observation: obs });
|
|
117
|
+
}
|
|
118
|
+
observeMany(obs) {
|
|
119
|
+
return this.request("observe_many", { observations: obs });
|
|
120
|
+
}
|
|
121
|
+
baseline() {
|
|
122
|
+
return this.request("baseline");
|
|
123
|
+
}
|
|
124
|
+
advance(to, expected) {
|
|
125
|
+
return this.request("advance", { to, expected });
|
|
126
|
+
}
|
|
127
|
+
affected(changes, options) {
|
|
128
|
+
const opts = {
|
|
129
|
+
baseline: options.baseline,
|
|
130
|
+
context: options.context,
|
|
131
|
+
verify: options.verify ?? false,
|
|
132
|
+
policy: options.policy ?? "balanced",
|
|
133
|
+
};
|
|
134
|
+
if (options.env !== undefined)
|
|
135
|
+
opts.env = options.env;
|
|
136
|
+
if (options.config !== undefined)
|
|
137
|
+
opts.config = options.config;
|
|
138
|
+
if (options.declared_tasks !== undefined)
|
|
139
|
+
opts.declared_tasks = options.declared_tasks;
|
|
140
|
+
return this.request("affected", { changes, options: opts }).then(checkPlan);
|
|
141
|
+
}
|
|
142
|
+
explain(task) {
|
|
143
|
+
return this.request("explain", { task });
|
|
144
|
+
}
|
|
145
|
+
forget(task) {
|
|
146
|
+
return this.request("forget", { task });
|
|
147
|
+
}
|
|
148
|
+
stats() {
|
|
149
|
+
return this.request("stats");
|
|
150
|
+
}
|
|
151
|
+
compact() {
|
|
152
|
+
return this.request("compact");
|
|
153
|
+
}
|
|
154
|
+
close() {
|
|
155
|
+
return this.enqueue(async () => {
|
|
156
|
+
this.closed = true;
|
|
157
|
+
const run = this.current;
|
|
158
|
+
if (run === null)
|
|
159
|
+
return;
|
|
160
|
+
this.current = null;
|
|
161
|
+
try {
|
|
162
|
+
await this.send(run, "shutdown", undefined, this.timeoutMs);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// The server may already be gone; the kill below covers a hang.
|
|
166
|
+
}
|
|
167
|
+
const timer = setTimeout(() => this.kill(run), CLOSE_GRACE_MS);
|
|
168
|
+
await run.exited;
|
|
169
|
+
clearTimeout(timer);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
// Called once by connect(), before any other request.
|
|
173
|
+
async init() {
|
|
174
|
+
await this.enqueue(async () => {
|
|
175
|
+
await this.ensure();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
request(method, params) {
|
|
179
|
+
return this.enqueue(() => this.exchange(method, params));
|
|
180
|
+
}
|
|
181
|
+
// Sends one request; on a server death, read-only requests are sent again
|
|
182
|
+
// once to a restarted server.
|
|
183
|
+
async exchange(method, params) {
|
|
184
|
+
for (let attempt = 0;; attempt++) {
|
|
185
|
+
const run = await this.ensure();
|
|
186
|
+
try {
|
|
187
|
+
return await this.send(run, method, params, this.timeoutMs);
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
const retry = isExitedError(e) &&
|
|
191
|
+
READ_ONLY.has(method) &&
|
|
192
|
+
this.restart &&
|
|
193
|
+
attempt === 0 &&
|
|
194
|
+
!this.closed;
|
|
195
|
+
if (!retry)
|
|
196
|
+
throw e;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// The running server, starting one (with hello) when there is none.
|
|
201
|
+
async ensure() {
|
|
202
|
+
if (this.closed)
|
|
203
|
+
throw new incrementalError("internal", "the client is closed", { reason: "closed" });
|
|
204
|
+
if (this.current !== null)
|
|
205
|
+
return this.current;
|
|
206
|
+
if (this.started && !this.restart) {
|
|
207
|
+
throw new incrementalError("internal", "the server exited and restart is disabled", {
|
|
208
|
+
reason: "exited",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return this.start();
|
|
212
|
+
}
|
|
213
|
+
async start() {
|
|
214
|
+
const run = this.spawnRun();
|
|
215
|
+
this.current = run;
|
|
216
|
+
this.started = true;
|
|
217
|
+
let hello;
|
|
218
|
+
try {
|
|
219
|
+
hello = await this.send(run, "hello", { protocol: 1, client: { name: "incremental-node", version: CLIENT_VERSION } }, STARTUP_TIMEOUT_MS);
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
this.kill(run);
|
|
223
|
+
throw e;
|
|
224
|
+
}
|
|
225
|
+
if (!isRecord(hello) || typeof hello.protocol !== "number") {
|
|
226
|
+
this.kill(run);
|
|
227
|
+
throw new incrementalError("internal", "the server answered hello with no protocol", {
|
|
228
|
+
reason: "bad_handshake",
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (hello.protocol !== 1) {
|
|
232
|
+
this.kill(run);
|
|
233
|
+
throw new incrementalError("protocol_mismatch", "the server does not speak protocol 1", hello);
|
|
234
|
+
}
|
|
235
|
+
run.hello = hello;
|
|
236
|
+
return run;
|
|
237
|
+
}
|
|
238
|
+
spawnRun() {
|
|
239
|
+
const [cmd = "", ...args] = this.command;
|
|
240
|
+
const proc = spawn(cmd, [...args, "--store", this.store, "--root", this.root], {
|
|
241
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
242
|
+
});
|
|
243
|
+
let signalExit = () => undefined;
|
|
244
|
+
const exited = new Promise((resolve) => {
|
|
245
|
+
signalExit = resolve;
|
|
246
|
+
});
|
|
247
|
+
const run = {
|
|
248
|
+
proc,
|
|
249
|
+
buf: "",
|
|
250
|
+
pending: new Map(),
|
|
251
|
+
fatal: null,
|
|
252
|
+
stderr: "",
|
|
253
|
+
done: false,
|
|
254
|
+
hello: null,
|
|
255
|
+
exited,
|
|
256
|
+
signalExit,
|
|
257
|
+
};
|
|
258
|
+
// A write after the server died fails with EPIPE; the "close" event
|
|
259
|
+
// rejects whatever was pending, so the error itself is ignored here.
|
|
260
|
+
proc.stdin.on("error", () => undefined);
|
|
261
|
+
proc.stdout.setEncoding("utf8");
|
|
262
|
+
proc.stdout.on("data", (chunk) => this.onStdout(run, chunk));
|
|
263
|
+
proc.stderr.setEncoding("utf8");
|
|
264
|
+
proc.stderr.on("data", (chunk) => {
|
|
265
|
+
run.stderr = (run.stderr + chunk).slice(-4000);
|
|
266
|
+
});
|
|
267
|
+
proc.on("error", (err) => {
|
|
268
|
+
run.fatal ??= { code: "internal", message: `cannot run the engine: ${err.message}` };
|
|
269
|
+
this.finish(run, null, null);
|
|
270
|
+
});
|
|
271
|
+
proc.on("close", (code, signal) => this.finish(run, code, signal));
|
|
272
|
+
return run;
|
|
273
|
+
}
|
|
274
|
+
onStdout(run, chunk) {
|
|
275
|
+
run.buf += chunk;
|
|
276
|
+
let nl = run.buf.indexOf("\n");
|
|
277
|
+
while (nl >= 0) {
|
|
278
|
+
const line = run.buf.slice(0, nl).trim();
|
|
279
|
+
run.buf = run.buf.slice(nl + 1);
|
|
280
|
+
if (line.length > 0)
|
|
281
|
+
this.onLine(run, line);
|
|
282
|
+
nl = run.buf.indexOf("\n");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
onLine(run, line) {
|
|
286
|
+
let msg;
|
|
287
|
+
try {
|
|
288
|
+
msg = JSON.parse(line);
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
return; // not a protocol line; stderr keeps the diagnostics
|
|
292
|
+
}
|
|
293
|
+
if (!isRecord(msg))
|
|
294
|
+
return;
|
|
295
|
+
if (typeof msg.id === "number") {
|
|
296
|
+
const p = run.pending.get(msg.id);
|
|
297
|
+
if (p === undefined)
|
|
298
|
+
return; // answer to a request that already timed out
|
|
299
|
+
run.pending.delete(msg.id);
|
|
300
|
+
clearTimeout(p.timer);
|
|
301
|
+
if (isRecord(msg.error)) {
|
|
302
|
+
p.reject(new incrementalError(String(msg.error.code), String(msg.error.message), msg.error.data));
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
p.resolve(msg.result);
|
|
306
|
+
}
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (msg.id === undefined && isRecord(msg.error)) {
|
|
310
|
+
run.fatal = {
|
|
311
|
+
code: String(msg.error.code),
|
|
312
|
+
message: String(msg.error.message),
|
|
313
|
+
data: msg.error.data,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
send(run, method, params, timeoutMs) {
|
|
318
|
+
return new Promise((resolve, reject) => {
|
|
319
|
+
const id = this.nextId++;
|
|
320
|
+
const timer = setTimeout(() => {
|
|
321
|
+
run.pending.delete(id);
|
|
322
|
+
reject(new incrementalError("timeout", `${method} did not answer within ${timeoutMs} ms`, {
|
|
323
|
+
partial: false,
|
|
324
|
+
timeoutMs,
|
|
325
|
+
method,
|
|
326
|
+
}));
|
|
327
|
+
// The server may still be working on this request. Stop it so that the
|
|
328
|
+
// next request starts from a fresh server.
|
|
329
|
+
this.kill(run);
|
|
330
|
+
}, timeoutMs);
|
|
331
|
+
run.pending.set(id, { method, resolve, reject, timer });
|
|
332
|
+
const line = params === undefined ? { id, method } : { id, method, params };
|
|
333
|
+
run.proc.stdin.write(`${JSON.stringify(line)}\n`);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
kill(run) {
|
|
337
|
+
if (this.current === run)
|
|
338
|
+
this.current = null;
|
|
339
|
+
if (!run.done)
|
|
340
|
+
run.proc.kill("SIGKILL");
|
|
341
|
+
}
|
|
342
|
+
finish(run, code, signal) {
|
|
343
|
+
if (run.done)
|
|
344
|
+
return;
|
|
345
|
+
run.done = true;
|
|
346
|
+
if (this.current === run)
|
|
347
|
+
this.current = null;
|
|
348
|
+
for (const p of run.pending.values()) {
|
|
349
|
+
clearTimeout(p.timer);
|
|
350
|
+
p.reject(run.fatal !== null
|
|
351
|
+
? new incrementalError(run.fatal.code, run.fatal.message, run.fatal.data)
|
|
352
|
+
: new incrementalError("internal", `the server exited before answering ${p.method}`, {
|
|
353
|
+
reason: "exited",
|
|
354
|
+
exitCode: code,
|
|
355
|
+
signal,
|
|
356
|
+
stderr: run.stderr.trim(),
|
|
357
|
+
}));
|
|
358
|
+
}
|
|
359
|
+
run.pending.clear();
|
|
360
|
+
run.signalExit();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Starts a server for the store and completes the handshake. Rejects with a
|
|
364
|
+
// incrementalError (for example store_missing) when the server cannot start.
|
|
365
|
+
export async function connect(opts = {}) {
|
|
366
|
+
const command = opts.command ?? [defaultEngine(), "serve"];
|
|
367
|
+
if (command.length === 0) {
|
|
368
|
+
throw new incrementalError("invalid_params", "command must name the server executable");
|
|
369
|
+
}
|
|
370
|
+
const client = new IncrementalClient(command, path.resolve(opts.store || defaultStore()), path.resolve(opts.root ?? process.cwd()), opts.timeoutMs ?? DEFAULT_TIMEOUT_MS, opts.restart ?? true);
|
|
371
|
+
await client.init();
|
|
372
|
+
return client;
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,gFAAgF;AAChF,8EAA8E;AAC9E,yBAAyB;AACzB,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,M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,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,yCAAyC,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAClC,OAAO,EACP,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC,EAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,EACxC,IAAI,CAAC,SAAS,IAAI,kBAAkB,EACpC,IAAI,CAAC,OAAO,IAAI,IAAI,CACrB,CAAC;IACF,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ErrorCode = "invalid_params" | "unknown_method" | "protocol_mismatch" | "store_missing" | "store_corrupt" | "lock_busy" | "baseline_conflict" | "timeout" | "internal";
|
|
2
|
+
export declare class incrementalError extends Error {
|
|
3
|
+
readonly code: ErrorCode;
|
|
4
|
+
readonly data: unknown;
|
|
5
|
+
constructor(code: string, message: string, data?: unknown);
|
|
6
|
+
}
|
|
7
|
+
export declare function isIncrementalError(e: unknown): e is incrementalError;
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sources":["../../src/errors.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,WAAW,GACX,mBAAmB,GACnB,SAAS,GACT,UAAU,CAAC;AAgBf,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAUxD;CACF;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,gBAAgB,CAEpE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const CODES = new Set([
|
|
2
|
+
"invalid_params",
|
|
3
|
+
"unknown_method",
|
|
4
|
+
"protocol_mismatch",
|
|
5
|
+
"store_missing",
|
|
6
|
+
"store_corrupt",
|
|
7
|
+
"lock_busy",
|
|
8
|
+
"baseline_conflict",
|
|
9
|
+
"timeout",
|
|
10
|
+
"internal",
|
|
11
|
+
]);
|
|
12
|
+
// Every rejection of the client is a incrementalError. A code the client does
|
|
13
|
+
// not know is reported as "internal"; the engine's own code is kept in data.
|
|
14
|
+
export class incrementalError extends Error {
|
|
15
|
+
code;
|
|
16
|
+
data;
|
|
17
|
+
constructor(code, message, data) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "incrementalError";
|
|
20
|
+
if (CODES.has(code)) {
|
|
21
|
+
this.code = code;
|
|
22
|
+
this.data = data;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.code = "internal";
|
|
26
|
+
this.data = { engineCode: code, ...(isRecord(data) ? data : {}) };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function isIncrementalError(e) {
|
|
31
|
+
return e instanceof incrementalError;
|
|
32
|
+
}
|
|
33
|
+
function isRecord(v) {
|
|
34
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../src/errors.ts"],"names":[],"mappings":"AAYA,MAAM,KAAK,GAAwB,IAAI,GAAG,CAAY;IACpD,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,WAAW;IACX,mBAAmB;IACnB,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH,8EAA8E;AAC9E,6EAA6E;AAC7E,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,IAAI,CAAY;IAChB,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,OAAe,EAAE,IAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,IAAiB,CAAC;YAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAAC,CAAU;IAC3C,OAAO,CAAC,YAAY,gBAAgB,CAAC;AACvC,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { connect, defaultEngine, defaultStore, repoRoot, CLIENT_VERSION } from "./client.js";
|
|
2
|
+
export type { incremental } from "./client.js";
|
|
3
|
+
export { incrementalError, isIncrementalError } from "./errors.js";
|
|
4
|
+
export type { ErrorCode } from "./errors.js";
|
|
5
|
+
export type * from "./types.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @incremental/client: the Node/TypeScript binding of incremental Protocol v1.
|
|
2
|
+
export { connect, defaultEngine, defaultStore, repoRoot, CLIENT_VERSION } from "./client.js";
|
|
3
|
+
export { incrementalError, isIncrementalError } from "./errors.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7F,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export interface Hello {
|
|
2
|
+
protocol: 1;
|
|
3
|
+
engine: {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
};
|
|
7
|
+
capabilities: string[];
|
|
8
|
+
store: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Context {
|
|
11
|
+
lockfile: string;
|
|
12
|
+
tsconfig: string;
|
|
13
|
+
pkgjson: string;
|
|
14
|
+
runner: string;
|
|
15
|
+
node: string;
|
|
16
|
+
fmt: number;
|
|
17
|
+
caps: {
|
|
18
|
+
probes: boolean;
|
|
19
|
+
dirs: boolean;
|
|
20
|
+
env: boolean;
|
|
21
|
+
verify?: boolean;
|
|
22
|
+
};
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export type Input = {
|
|
26
|
+
kind: "file";
|
|
27
|
+
path: string;
|
|
28
|
+
hash: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "dir";
|
|
31
|
+
path: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "probe";
|
|
34
|
+
path: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "declared";
|
|
37
|
+
path: string;
|
|
38
|
+
hash: string;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "env";
|
|
41
|
+
name: string;
|
|
42
|
+
value_hash: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "env_all";
|
|
45
|
+
snapshot?: Record<string, string>;
|
|
46
|
+
};
|
|
47
|
+
export type Output = Record<string, unknown>;
|
|
48
|
+
export type Outcome = "pass" | "fail" | "error" | "none";
|
|
49
|
+
export interface Observation {
|
|
50
|
+
task: string;
|
|
51
|
+
baseline: string;
|
|
52
|
+
dirty: boolean;
|
|
53
|
+
context: Context;
|
|
54
|
+
inputs: Input[];
|
|
55
|
+
outputs: Output[];
|
|
56
|
+
outcome: Outcome;
|
|
57
|
+
duration_ms?: number;
|
|
58
|
+
}
|
|
59
|
+
export type ChangeStatus = "modified" | "added" | "deleted" | "renamed";
|
|
60
|
+
export interface Change {
|
|
61
|
+
path: string;
|
|
62
|
+
status: ChangeStatus;
|
|
63
|
+
old_path?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ChangeSet {
|
|
66
|
+
baseline: string;
|
|
67
|
+
head?: string;
|
|
68
|
+
changes: Change[];
|
|
69
|
+
}
|
|
70
|
+
export interface Config {
|
|
71
|
+
ignore?: string[];
|
|
72
|
+
globalInputs?: string[];
|
|
73
|
+
fallbackContextKeys?: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface AffectedOptions {
|
|
76
|
+
baseline: string;
|
|
77
|
+
context: Context;
|
|
78
|
+
verify?: boolean;
|
|
79
|
+
policy?: "balanced" | "conservative";
|
|
80
|
+
env?: Record<string, string>;
|
|
81
|
+
config?: Config;
|
|
82
|
+
declared_tasks?: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface PlanTask {
|
|
85
|
+
id: string;
|
|
86
|
+
reasons: string[];
|
|
87
|
+
}
|
|
88
|
+
export interface Fallback {
|
|
89
|
+
action: string;
|
|
90
|
+
reason: string;
|
|
91
|
+
}
|
|
92
|
+
export interface Plan {
|
|
93
|
+
protocol: 1;
|
|
94
|
+
baseline: string;
|
|
95
|
+
graph_version: string;
|
|
96
|
+
verify: boolean;
|
|
97
|
+
tasks: PlanTask[];
|
|
98
|
+
unobserved: string[];
|
|
99
|
+
ignored: string[];
|
|
100
|
+
deleted_tasks: string[];
|
|
101
|
+
total_tasks: number;
|
|
102
|
+
skipped: number;
|
|
103
|
+
fallback: Fallback | null;
|
|
104
|
+
confidence: "high" | "medium" | "n/a";
|
|
105
|
+
}
|
|
106
|
+
export interface Explanation {
|
|
107
|
+
task: string;
|
|
108
|
+
observed: boolean;
|
|
109
|
+
outcome?: Outcome;
|
|
110
|
+
dirty?: boolean;
|
|
111
|
+
baseline?: string;
|
|
112
|
+
inputs?: number;
|
|
113
|
+
certificate: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface Stats {
|
|
116
|
+
tasks: number;
|
|
117
|
+
observations: number;
|
|
118
|
+
baseline: string | null;
|
|
119
|
+
graph_version: string;
|
|
120
|
+
}
|
|
121
|
+
export interface CompactResult {
|
|
122
|
+
before_bytes: number;
|
|
123
|
+
after_bytes: number;
|
|
124
|
+
}
|
|
125
|
+
export interface ConnectOptions {
|
|
126
|
+
store?: string;
|
|
127
|
+
command?: string[];
|
|
128
|
+
timeoutMs?: number;
|
|
129
|
+
restart?: boolean;
|
|
130
|
+
root?: string;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sources":["../../src/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AAK,CAAC,EAAE,MAAM,CAAC;IAIf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,oFAAoF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incremental/client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Node.js client for the Incremental Compute Engine protocol v1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"incremental-client": "./bin/client.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/src",
|
|
13
|
+
"bin/"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc-rs -b",
|
|
17
|
+
"test": "tsc-rs -b && node --test dist/tests/*.test.js"
|
|
18
|
+
},
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.0.0"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "22.20.5",
|
|
26
|
+
"tsc-rs": "0.8.0"
|
|
27
|
+
}
|
|
28
|
+
}
|