@pipelex/sdk 0.46.1 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +20 -9
  2. package/dist/cli/script.d.ts +1 -1
  3. package/dist/cli/source.d.ts +8 -7
  4. package/dist/cli/source.js +11 -5
  5. package/dist/cli/source.js.map +1 -1
  6. package/dist/client.d.ts +455 -237
  7. package/dist/client.js +1067 -522
  8. package/dist/client.js.map +1 -1
  9. package/dist/errors.d.ts +49 -19
  10. package/dist/errors.js +50 -21
  11. package/dist/errors.js.map +1 -1
  12. package/dist/hooks/bundle-gather.d.ts +28 -40
  13. package/dist/hooks/bundle-gather.js +55 -230
  14. package/dist/hooks/bundle-gather.js.map +1 -1
  15. package/dist/hooks/claude-mthds-check.d.ts +7 -5
  16. package/dist/hooks/claude-mthds-check.js +8 -53
  17. package/dist/hooks/claude-mthds-check.js.map +1 -1
  18. package/dist/hooks/validate-stage.d.ts +27 -0
  19. package/dist/hooks/validate-stage.js +57 -0
  20. package/dist/hooks/validate-stage.js.map +1 -0
  21. package/dist/index.d.ts +7 -7
  22. package/dist/index.js +6 -3
  23. package/dist/index.js.map +1 -1
  24. package/dist/method-trees.d.ts +344 -0
  25. package/dist/method-trees.js +876 -0
  26. package/dist/method-trees.js.map +1 -0
  27. package/dist/models.d.ts +162 -59
  28. package/dist/prepare-inputs.d.ts +46 -27
  29. package/dist/prepare-inputs.js +123 -42
  30. package/dist/prepare-inputs.js.map +1 -1
  31. package/dist/product-models.d.ts +97 -75
  32. package/dist/runs.d.ts +5 -3
  33. package/dist/runs.js.map +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.js +1 -1
  36. package/docs/architecture.md +20 -21
  37. package/docs/cli.md +1 -1
  38. package/docs/crate-routes.md +42 -20
  39. package/docs/errors.md +7 -6
  40. package/docs/hook-bundle.md +1 -1
  41. package/docs/input-preparation.md +15 -40
  42. package/docs/method-trees.md +199 -0
  43. package/docs/run-results.md +5 -2
  44. package/package.json +2 -2
  45. package/dist/bundle-resources.d.ts +0 -62
  46. package/dist/bundle-resources.js +0 -165
  47. package/dist/bundle-resources.js.map +0 -1
  48. package/dist/method-source.d.ts +0 -19
  49. package/dist/method-source.js +0 -50
  50. package/dist/method-source.js.map +0 -1
  51. package/docs/bundle-resources.md +0 -107
@@ -1,58 +1,46 @@
1
1
  /**
2
- * Bundle gathering for the validate stage: the multi-file set sent to
3
- * `POST /v1/validate` around an edited `.mthds` file.
2
+ * The method tree the validate stage sends to `POST /v1/validate` around an edited `.mthds` file.
4
3
  *
5
- * Mirrors what the plxt-era hook's `-L "$PARENT_DIR/"` did through the Python
6
- * runtime (`pipelex/libraries/library_utils.py`): a recursive `.mthds` scan of
7
- * the edited file's parent directory, skipping the runtime's excluded dirs.
8
- * Capped, because an under-supplied bundle can produce a FALSE invalid verdict
9
- * (missing cross-file refs) — on overflow the caller must treat validate as
10
- * unavailable rather than risk a wrong block.
4
+ * It is the tree a run of the method would send: the edited file's directory listed by the `mthds`
5
+ * package's lister, under the MTHDS standard's membership rule and Manifest Discovery, so it is
6
+ * rooted at the nearest `METHODS.toml` at or above that directory, else at the directory itself,
7
+ * and holds every file the rule keeps — every bundle of the method, and every file a step reads,
8
+ * such as a `PipeDocGen` step's `template_file`, under its tree path. The client sends it inline
9
+ * when small and by hash otherwise, uploading the files the API lacks.
11
10
  *
12
- * It also gathers the files the bundle's steps read, a `PipeDocGen` step's
13
- * `template_file`, read beside the `.mthds` file whose step names it and sent as
14
- * the request's `resources` under the path the step names, as the runtime reads
15
- * a bundle loaded from disk: without them the server could only answer that the
16
- * template file was not supplied, which would block every edit of such a bundle.
11
+ * Capped, because the hook should not send a large tree on every edit, and because a tree it
12
+ * cannot list whole would risk a wrong verdict: on any of the caps, on a tree the standard refuses
13
+ * (a symbolic link or a special file in it, an unreadable directory), and on an edited file the
14
+ * tree does not hold (one the membership rule keeps out), the caller treats validate as
15
+ * unavailable rather than risk a wrong block.
17
16
  */
18
- import type { MthdsFile } from "../client.js";
17
+ import type { MethodTreeSource } from "mthds/protocol";
18
+ /** The hook's own bounds on the tree it sends, whatever the deployment would take. */
19
19
  export interface GatherCaps {
20
+ /** How many files the tree may hold. */
20
21
  maxFiles: number;
22
+ /** How large one file of it may be, in bytes. */
23
+ maxFileBytes: number;
24
+ /** How large all its files together may be, in bytes. */
21
25
  maxTotalBytes: number;
22
- /** How many template files the gather sends at most; the server's default limit when omitted. */
23
- maxResourceFiles?: number;
24
- /** How large one template file may be; the server's default limit when omitted. */
25
- maxResourceFileBytes?: number;
26
- /** How many bytes of template files the gather sends at most; the server's default when omitted. */
27
- maxResourceBytes?: number;
28
26
  }
29
27
  export declare const DEFAULT_GATHER_CAPS: GatherCaps;
30
28
  /**
31
- * The gathered bundle, or why there is none to send. `resources` maps the path a
32
- * step names to the template file's bytes. `conflict` is one path naming two
33
- * different files beside two `.mthds` files of the bundle, or a file beside one
34
- * and nothing beside the other: the request keys a file by its path alone, so it
35
- * cannot say what loading each file from disk would find, and validate is
36
- * unavailable rather than a wrong verdict.
29
+ * The gathered tree, or why there is none to send: `overflow` for a tree past one of the caps,
30
+ * `unreadable` for a directory the standard's lister refuses to list, and `outside` for an edited
31
+ * file the tree does not hold.
37
32
  */
38
33
  export type GatherResult = {
39
34
  ok: true;
40
- files: MthdsFile[];
41
- resources: Record<string, Uint8Array>;
35
+ tree: MethodTreeSource;
42
36
  } | {
43
37
  ok: false;
44
- reason: "overflow" | "unreadable" | "conflict";
38
+ reason: "overflow" | "unreadable" | "outside";
45
39
  };
46
40
  /**
47
- * Gather the `.mthds` files under the edited file's parent directory, the
48
- * edited file first (absent any `main_pipe`, the server's primary blueprint is
49
- * the first content — make that the file being edited). Contents are read
50
- * fresh from disk, so a format write-back is already reflected.
51
- */
52
- export declare function gatherBundle(editedFilePath: string, caps?: GatherCaps): GatherResult;
53
- /**
54
- * The paths of the template files the steps of one `.mthds` file name: each
55
- * `PipeDocGen` pipe's `template_file`. A file that does not parse names none, the
56
- * server giving its verdict on it.
41
+ * List the method tree around the edited file: its directory, listed under the standard's
42
+ * membership rule and the hook's caps. The files are read when the client sends them, so a format
43
+ * write-back made before this call is reflected, and a file changed after it is refused by the
44
+ * tree's own check of its hash rather than sent stale.
57
45
  */
58
- export declare function templateFilesNamedBy(mthdsContent: string): string[];
46
+ export declare function gatherMethodTree(editedFilePath: string, caps?: GatherCaps): Promise<GatherResult>;
@@ -1,252 +1,77 @@
1
1
  /**
2
- * Bundle gathering for the validate stage: the multi-file set sent to
3
- * `POST /v1/validate` around an edited `.mthds` file.
2
+ * The method tree the validate stage sends to `POST /v1/validate` around an edited `.mthds` file.
4
3
  *
5
- * Mirrors what the plxt-era hook's `-L "$PARENT_DIR/"` did through the Python
6
- * runtime (`pipelex/libraries/library_utils.py`): a recursive `.mthds` scan of
7
- * the edited file's parent directory, skipping the runtime's excluded dirs.
8
- * Capped, because an under-supplied bundle can produce a FALSE invalid verdict
9
- * (missing cross-file refs) — on overflow the caller must treat validate as
10
- * unavailable rather than risk a wrong block.
4
+ * It is the tree a run of the method would send: the edited file's directory listed by the `mthds`
5
+ * package's lister, under the MTHDS standard's membership rule and Manifest Discovery, so it is
6
+ * rooted at the nearest `METHODS.toml` at or above that directory, else at the directory itself,
7
+ * and holds every file the rule keeps — every bundle of the method, and every file a step reads,
8
+ * such as a `PipeDocGen` step's `template_file`, under its tree path. The client sends it inline
9
+ * when small and by hash otherwise, uploading the files the API lacks.
11
10
  *
12
- * It also gathers the files the bundle's steps read, a `PipeDocGen` step's
13
- * `template_file`, read beside the `.mthds` file whose step names it and sent as
14
- * the request's `resources` under the path the step names, as the runtime reads
15
- * a bundle loaded from disk: without them the server could only answer that the
16
- * template file was not supplied, which would block every edit of such a bundle.
11
+ * Capped, because the hook should not send a large tree on every edit, and because a tree it
12
+ * cannot list whole would risk a wrong verdict: on any of the caps, on a tree the standard refuses
13
+ * (a symbolic link or a special file in it, an unreadable directory), and on an edited file the
14
+ * tree does not hold (one the membership rule keeps out), the caller treats validate as
15
+ * unavailable rather than risk a wrong block.
17
16
  */
18
- import { readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
19
- import { dirname, join, relative, resolve, sep } from "node:path";
20
- import { parse as parseToml } from "smol-toml";
21
- import { bundleResourcePathRefusal, canonicalBundleResourcePath } from "../bundle-resources.js";
22
- /** Mirror of pipelex's `scan_config.excluded_dirs` (dot-dirs are skipped wholesale). */
23
- const EXCLUDED_DIRS = new Set([
24
- "venv",
25
- "env",
26
- "virtualenv",
27
- "__pycache__",
28
- "node_modules",
29
- "results",
30
- ]);
31
- /** The server's default bounds on the files a request sends with its bundle. */
32
- const DEFAULT_MAX_RESOURCE_FILES = 32;
33
- const DEFAULT_MAX_RESOURCE_FILE_BYTES = 5 * 1024 * 1024;
34
- const DEFAULT_MAX_RESOURCE_BYTES = 10 * 1024 * 1024;
17
+ import { realpathSync } from "node:fs";
18
+ import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
19
+ import { listDirectoryTree } from "../method-trees.js";
35
20
  export const DEFAULT_GATHER_CAPS = {
36
- maxFiles: 50,
37
- maxTotalBytes: 2 * 1024 * 1024,
38
- maxResourceFiles: DEFAULT_MAX_RESOURCE_FILES,
39
- maxResourceFileBytes: DEFAULT_MAX_RESOURCE_FILE_BYTES,
40
- maxResourceBytes: DEFAULT_MAX_RESOURCE_BYTES,
21
+ maxFiles: 100,
22
+ maxFileBytes: 5 * 1024 * 1024,
23
+ maxTotalBytes: 12 * 1024 * 1024,
41
24
  };
42
25
  /**
43
- * Recursively collect `.mthds` paths under `dir`. Throws if any directory in
44
- * the tree can't be read: a silently-skipped subtree would drop cross-file
45
- * refs and risk a FALSE invalid verdict, so the caller must treat an
46
- * unreadable scan as `unreadable` (validate unavailable), not as a smaller
47
- * bundle. The caps guard the opposite failure (over-supply), never this one.
26
+ * List the method tree around the edited file: its directory, listed under the standard's
27
+ * membership rule and the hook's caps. The files are read when the client sends them, so a format
28
+ * write-back made before this call is reflected, and a file changed after it is refused by the
29
+ * tree's own check of its hash rather than sent stale.
48
30
  */
49
- function walkMthdsFiles(dir, collected) {
50
- const entries = readdirSync(dir, { withFileTypes: true });
51
- for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
52
- if (entry.name.startsWith(".") || EXCLUDED_DIRS.has(entry.name)) {
53
- continue;
54
- }
55
- const full = join(dir, entry.name);
56
- if (entry.isDirectory()) {
57
- walkMthdsFiles(full, collected);
58
- }
59
- else if (entry.isFile() && entry.name.endsWith(".mthds")) {
60
- collected.push(full);
61
- }
62
- }
63
- }
64
- /**
65
- * Gather the `.mthds` files under the edited file's parent directory, the
66
- * edited file first (absent any `main_pipe`, the server's primary blueprint is
67
- * the first content — make that the file being edited). Contents are read
68
- * fresh from disk, so a format write-back is already reflected.
69
- */
70
- export function gatherBundle(editedFilePath, caps = DEFAULT_GATHER_CAPS) {
31
+ export async function gatherMethodTree(editedFilePath, caps = DEFAULT_GATHER_CAPS) {
71
32
  const editedAbs = resolve(editedFilePath);
72
- const parentDir = dirname(editedAbs);
73
- const paths = [];
74
- try {
75
- walkMthdsFiles(parentDir, paths);
76
- }
77
- catch {
78
- return { ok: false, reason: "unreadable" };
79
- }
80
- const ordered = [editedAbs, ...paths.filter((path) => resolve(path) !== editedAbs)];
81
- if (ordered.length > caps.maxFiles) {
82
- return { ok: false, reason: "overflow" };
83
- }
84
- let totalBytes = 0;
85
- for (const path of ordered) {
86
- try {
87
- totalBytes += statSync(path).size;
88
- }
89
- catch {
90
- return { ok: false, reason: "unreadable" };
91
- }
92
- }
93
- if (totalBytes > caps.maxTotalBytes) {
94
- return { ok: false, reason: "overflow" };
95
- }
96
- const files = [];
97
- for (const path of ordered) {
98
- try {
99
- files.push({ content: readFileSync(path, "utf-8"), uri: relative(parentDir, path) });
100
- }
101
- catch {
102
- return { ok: false, reason: "unreadable" };
103
- }
104
- }
105
- const gathered = gatherTemplateFiles(parentDir, ordered, files, caps);
106
- if (!gathered.ok)
107
- return gathered;
108
- return { ok: true, files, resources: gathered.resources };
109
- }
110
- /**
111
- * The paths of the template files the steps of one `.mthds` file name: each
112
- * `PipeDocGen` pipe's `template_file`. A file that does not parse names none, the
113
- * server giving its verdict on it.
114
- */
115
- export function templateFilesNamedBy(mthdsContent) {
116
- let document;
33
+ let tree;
117
34
  try {
118
- document = parseToml(mthdsContent);
35
+ tree = await listDirectoryTree(dirname(editedAbs), {
36
+ maxFileCount: caps.maxFiles,
37
+ maxFileSize: caps.maxFileBytes,
38
+ maxTotalSize: caps.maxTotalBytes,
39
+ }, "validate");
119
40
  }
120
- catch {
121
- return [];
41
+ catch (err) {
42
+ return { ok: false, reason: isLimitExceeded(err) ? "overflow" : "unreadable" };
122
43
  }
123
- const pipes = isRecord(document) ? document["pipe"] : undefined;
124
- if (!isRecord(pipes))
125
- return [];
126
- const named = [];
127
- for (const pipe of Object.values(pipes)) {
128
- if (isRecord(pipe) &&
129
- pipe["type"] === "PipeDocGen" &&
130
- typeof pipe["template_file"] === "string") {
131
- named.push(pipe["template_file"]);
132
- }
44
+ const treePath = treePathOf(editedAbs, tree.root);
45
+ if (treePath === undefined || !tree.files.some((file) => file.path === treePath)) {
46
+ return { ok: false, reason: "outside" };
133
47
  }
134
- return named;
48
+ return { ok: true, tree };
135
49
  }
136
- /**
137
- * Read the template files the gathered `.mthds` files name, each beside the file
138
- * whose step names it, keyed by the path the step names, as the runtime reads a
139
- * bundle loaded from disk. A path the server would refuse is left out, and so is a
140
- * file that is not there beside any `.mthds` file naming it, for the server to say
141
- * the step's file was not supplied.
142
- *
143
- * Validate is unavailable rather than a wrong verdict when the request cannot carry
144
- * what loading the bundle from disk would find: a file that leads out of the
145
- * bundle's directory through a link is never read (`unreadable`), and one path that
146
- * names different files beside different `.mthds` files, or a file beside one and
147
- * nothing beside another, is a `conflict`. Every size is checked against the caps
148
- * before any file is read, the bytes compared to tell two files apart included, so
149
- * the hook never holds more than the caps allow (`overflow`).
150
- */
151
- function gatherTemplateFiles(parentDir, paths, files, caps) {
152
- const maxFiles = caps.maxResourceFiles ?? DEFAULT_MAX_RESOURCE_FILES;
153
- const maxFileBytes = caps.maxResourceFileBytes ?? DEFAULT_MAX_RESOURCE_FILE_BYTES;
154
- const maxBytes = caps.maxResourceBytes ?? DEFAULT_MAX_RESOURCE_BYTES;
155
- let root;
50
+ /** The edited file's tree path under `root`, or `undefined` when it lies outside it. */
51
+ function treePathOf(editedAbs, root) {
52
+ if (root === null)
53
+ return undefined;
54
+ let real;
156
55
  try {
157
- root = realpathSync(parentDir);
56
+ real = realpathSync(editedAbs);
158
57
  }
159
58
  catch {
160
- return { ok: false, reason: "unreadable" };
161
- }
162
- // Each path a step names, once, with the file it names beside the first `.mthds` file
163
- // naming it, or `null` when there is none there.
164
- const located = new Map();
165
- let fileCount = 0;
166
- let totalBytes = 0;
167
- for (const [index, mthdsPath] of paths.entries()) {
168
- for (const named of templateFilesNamedBy(files[index].content)) {
169
- if (bundleResourcePathRefusal(named) !== undefined)
170
- continue;
171
- const key = canonicalBundleResourcePath(named);
172
- const found = locateRegularFile(join(dirname(mthdsPath), key));
173
- if (found !== null) {
174
- if (!found.real.startsWith(root + sep))
175
- return { ok: false, reason: "unreadable" };
176
- if (found.size > maxFileBytes)
177
- return { ok: false, reason: "overflow" };
178
- }
179
- if (!located.has(key)) {
180
- located.set(key, found);
181
- if (found === null)
182
- continue;
183
- fileCount += 1;
184
- if (fileCount > maxFiles)
185
- return { ok: false, reason: "overflow" };
186
- totalBytes += found.size;
187
- if (totalBytes > maxBytes)
188
- return { ok: false, reason: "overflow" };
189
- continue;
190
- }
191
- const known = located.get(key);
192
- if (known === null || found === null) {
193
- if (known !== found)
194
- return { ok: false, reason: "conflict" };
195
- continue;
196
- }
197
- if (!sameFileContent(known, found))
198
- return { ok: false, reason: "conflict" };
199
- }
200
- }
201
- const resources = Object.create(null);
202
- let readBytes = 0;
203
- for (const [key, found] of located) {
204
- if (found === null)
205
- continue;
206
- try {
207
- const bytes = readFileSync(found.real);
208
- // A file that grew since it was measured is held to the caps as read.
209
- readBytes += bytes.length;
210
- if (bytes.length > maxFileBytes || readBytes > maxBytes) {
211
- return { ok: false, reason: "overflow" };
212
- }
213
- resources[key] = bytes;
214
- }
215
- catch {
216
- return { ok: false, reason: "unreadable" };
217
- }
218
- }
219
- return { ok: true, resources };
220
- }
221
- /** The regular file at `path`, link resolved, or `null` when there is none there. */
222
- function locateRegularFile(path) {
223
- try {
224
- const real = realpathSync(path);
225
- const stats = statSync(real);
226
- return stats.isFile() ? { real, size: stats.size } : null;
59
+ return undefined;
227
60
  }
228
- catch {
229
- return null;
230
- }
231
- }
232
- /**
233
- * Whether two files hold the same bytes. Their sizes were measured and held to the
234
- * per-file cap before this reads either, so a comparison reads at most two files of
235
- * that size; files of different sizes differ unread, and an unreadable one holds none.
236
- */
237
- function sameFileContent(left, right) {
238
- if (left.real === right.real)
239
- return true;
240
- if (left.size !== right.size)
241
- return false;
242
- try {
243
- return Buffer.compare(readFileSync(left.real), readFileSync(right.real)) === 0;
244
- }
245
- catch {
246
- return false;
61
+ const relativePath = relative(root, real);
62
+ if (relativePath === "" ||
63
+ relativePath === ".." ||
64
+ relativePath.startsWith(`..${sep}`) ||
65
+ isAbsolute(relativePath)) {
66
+ return undefined;
247
67
  }
68
+ return relativePath.split(sep).join("/").normalize("NFC");
248
69
  }
249
- function isRecord(value) {
250
- return typeof value === "object" && value !== null && !Array.isArray(value);
70
+ /** Whether a listing failed on one of the caps: the lister's `limit_exceeded`. */
71
+ function isLimitExceeded(err) {
72
+ const cause = err instanceof Error ? err.cause : undefined;
73
+ return (typeof cause === "object" &&
74
+ cause !== null &&
75
+ cause.code === "limit_exceeded");
251
76
  }
252
77
  //# sourceMappingURL=bundle-gather.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-gather.js","sourceRoot":"","sources":["../../src/hooks/bundle-gather.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,E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CAAC;IACpC,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,IACE,YAAY,KAAK,EAAE;QACnB,YAAY,KAAK,IAAI;QACrB,YAAY,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,UAAU,CAAC,YAAY,CAAC,EACxB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,kFAAkF;AAClF,SAAS,eAAe,CAAC,GAAY;IACnC,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA4B,CAAC,IAAI,KAAK,gBAAgB,CACxD,CAAC;AACJ,CAAC"}
@@ -27,11 +27,13 @@
27
27
  * Failure posture (fail-open, per the networked-hook plan):
28
28
  * - no `.mthds` in the payload / unparseable stdin → pass silently
29
29
  * - WASM engine fails to load → no file is checked; the note above is still sent
30
- * - validate unavailable (no `PIPELEX_API_KEY`, network error, timeout, any
31
- * non-2xx, bundle-gather overflow, a template file leading out of the bundle's
32
- * directory, or one path naming two different template files, or a file beside
33
- * one `.mthds` file and nothing beside another) → the local lint/format
34
- * verdicts already applied; the validate stage passes silently
30
+ * - validate unavailable (no `PIPELEX_API_KEY`, network error, the stage's
31
+ * 10-second deadline over the handshake, the blob route, the uploads and the
32
+ * validation together, any non-2xx, a method tree past the hook's caps, one
33
+ * the standard's lister refuses, such as one holding a symbolic link, an
34
+ * edited file the tree does not hold, or a file of the tree that failed to
35
+ * upload) → the local lint/format verdicts already applied; the validate
36
+ * stage passes silently (`validate-stage.ts`)
35
37
  *
36
38
  * The hook always exits 0; a block/deny is expressed on stdout, never via the
37
39
  * exit code.
@@ -27,11 +27,13 @@
27
27
  * Failure posture (fail-open, per the networked-hook plan):
28
28
  * - no `.mthds` in the payload / unparseable stdin → pass silently
29
29
  * - WASM engine fails to load → no file is checked; the note above is still sent
30
- * - validate unavailable (no `PIPELEX_API_KEY`, network error, timeout, any
31
- * non-2xx, bundle-gather overflow, a template file leading out of the bundle's
32
- * directory, or one path naming two different template files, or a file beside
33
- * one `.mthds` file and nothing beside another) → the local lint/format
34
- * verdicts already applied; the validate stage passes silently
30
+ * - validate unavailable (no `PIPELEX_API_KEY`, network error, the stage's
31
+ * 10-second deadline over the handshake, the blob route, the uploads and the
32
+ * validation together, any non-2xx, a method tree past the hook's caps, one
33
+ * the standard's lister refuses, such as one holding a symbolic link, an
34
+ * edited file the tree does not hold, or a file of the tree that failed to
35
+ * upload) → the local lint/format verdicts already applied; the validate
36
+ * stage passes silently (`validate-stage.ts`)
35
37
  *
36
38
  * The hook always exits 0; a block/deny is expressed on stdout, never via the
37
39
  * exit code.
@@ -39,10 +41,7 @@
39
41
  import { readFileSync, writeFileSync } from "node:fs";
40
42
  import { resolve as resolvePath } from "node:path";
41
43
  import { decideAfterLint, decideAfterValidate, encodeOutcome, extractCodexMthdsTargets, extractMthdsFilePath, extractVibeMthdsFilePath, mergeOutcomes, selectCodexTargets, uncheckedShellPatchNote, } from "./check-core.js";
42
- import { gatherBundle } from "./bundle-gather.js";
43
- import { createHookClient } from "./validate-client.js";
44
- /** Per-request ceiling on the one network call — well under the hook's overall timeout. */
45
- const VALIDATE_TIMEOUT_MS = 10_000;
44
+ import { runValidateStage } from "./validate-stage.js";
46
45
  async function readStdin() {
47
46
  const chunks = [];
48
47
  for await (const chunk of process.stdin) {
@@ -118,50 +117,6 @@ async function loadEngine() {
118
117
  /* eslint-enable no-console */
119
118
  return engine;
120
119
  }
121
- /**
122
- * Run the networked validate stage. Every no-verdict condition maps to
123
- * `unavailable` — a machine consumer branches on the structured verdict,
124
- * never on transport.
125
- */
126
- async function runValidateStage(filePath) {
127
- if (!process.env.PIPELEX_API_KEY) {
128
- return { status: "unavailable" };
129
- }
130
- const gathered = gatherBundle(filePath);
131
- if (!gathered.ok) {
132
- return { status: "unavailable" };
133
- }
134
- try {
135
- const client = createHookClient();
136
- // The client owns the ceiling: on timeout it aborts the fetch itself, so the
137
- // request does not keep running after the hook has given up on it.
138
- const result = await client.validateFiles(gathered.files, {
139
- allowSignatures: true,
140
- resources: gathered.resources,
141
- timeoutMs: VALIDATE_TIMEOUT_MS,
142
- });
143
- if (result.is_valid === true) {
144
- return {
145
- status: "valid",
146
- pendingSignatures: Array.isArray(result.pending_signatures)
147
- ? result.pending_signatures
148
- : [],
149
- };
150
- }
151
- if (result.is_valid === false) {
152
- return {
153
- status: "invalid",
154
- message: result.message,
155
- validationErrors: Array.isArray(result.validation_errors) ? result.validation_errors : [],
156
- renderedMarkdown: result.rendered_markdown,
157
- };
158
- }
159
- return { status: "unavailable" }; // no discriminant — no verdict
160
- }
161
- catch {
162
- return { status: "unavailable" };
163
- }
164
- }
165
120
  /** Synchronous fd-1 write — the process exits right after, an async write could truncate. */
166
121
  function emit(outcome, platform) {
167
122
  const encoded = encodeOutcome(outcome, platform);
@@ -1 +1 @@
1
- {"version":3,"file":"claude-mthds-check.js","sourceRoot":"","sources":["../../src/hooks/claude-mthds-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,eAAe,EACf,mBAAmB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`POST /v1/validate`, `allow_signatures: true`), held to one deadline over the whole
4
+ * stage, so the hook never outlasts its harness's patience whatever the network does.
5
+ */
6
+ import type { PipelexApiClient } from "../client.js";
7
+ import type { ValidateStage } from "./check-core.js";
8
+ /**
9
+ * The deadline over the whole validate stage, well under the hook's overall timeout: the version
10
+ * handshake, the blob route, the uploads of the files the API lacks (a tree up to the gatherer's
11
+ * caps, 12 MiB) and the validation itself all run under it.
12
+ */
13
+ export declare const VALIDATE_TIMEOUT_MS = 10000;
14
+ /** What the stage may be handed instead of what it builds from the environment. */
15
+ export interface ValidateStageOptions {
16
+ /** The client to validate through; by default the hook's, given a `PIPELEX_API_KEY`. */
17
+ readonly client?: Pick<PipelexApiClient, "validate">;
18
+ /** The stage's deadline, `VALIDATE_TIMEOUT_MS` by default. */
19
+ readonly timeoutMs?: number;
20
+ }
21
+ /**
22
+ * Run the networked validate stage on `filePath`. Every no-verdict condition maps to
23
+ * `unavailable` — no API key, a tree the gatherer refuses, the deadline running out, any failure
24
+ * of the client — so a machine consumer branches on the structured verdict, never on transport,
25
+ * and the lint and format verdicts the hook already applied stand.
26
+ */
27
+ export declare function runValidateStage(filePath: string, options?: ValidateStageOptions): Promise<ValidateStage>;