@tangle-network/agent-eval 0.11.1 → 0.13.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.
@@ -0,0 +1,594 @@
1
+ import {
2
+ callLlmJson
3
+ } from "./chunk-ITN4YOZY.js";
4
+
5
+ // src/wire/schemas.ts
6
+ import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
7
+ import { z } from "zod";
8
+ extendZodWithOpenApi(z);
9
+ var RubricDimensionSchema = z.object({
10
+ id: z.string().min(1).describe('Short stable id like "buyer_quality" \u2014 used as the key in scoring output.'),
11
+ description: z.string().min(1).describe("One-line plain-English meaning. Read by humans reviewing low scores."),
12
+ weight: z.number().min(0).default(1).describe("Relative weight in the composite score. Default 1; 0 disables."),
13
+ min: z.number().default(0).describe("Lower bound of valid score for this dimension."),
14
+ max: z.number().default(1).describe("Upper bound of valid score for this dimension.")
15
+ }).openapi("RubricDimension");
16
+ var FailureModeSchema = z.object({
17
+ id: z.string().min(1).describe('Short stable id like "ai-cadence" \u2014 used in detection lists.'),
18
+ description: z.string().min(1).describe("Plain-English description of the failure pattern.")
19
+ }).openapi("FailureMode");
20
+ var RubricSchema = z.object({
21
+ name: z.string().min(1).describe('Stable name like "anti-slop" \u2014 used by clients to invoke this rubric.'),
22
+ description: z.string().min(1).describe("What this rubric measures. Shown in /v1/rubrics listing."),
23
+ systemPrompt: z.string().min(1).describe(
24
+ 'Instructs the judging LLM. Should explain the persona (e.g. "senior engineer reviewing voice"), what to score on, and what to return.'
25
+ ),
26
+ dimensions: z.array(RubricDimensionSchema).min(1).describe("Scoring axes. The composite score is a weighted sum of these."),
27
+ failureModes: z.array(FailureModeSchema).default([]).describe("Patterns to detect; each detected mode appears in the result.failureModes list."),
28
+ wins: z.array(FailureModeSchema).default([]).describe("Positive patterns; each detected one appears in the result.wins list.")
29
+ }).openapi("Rubric");
30
+ var JudgeRequestSchema = z.object({
31
+ rubricName: z.string().optional().describe("Use a built-in rubric by name. Mutually exclusive with `rubric`."),
32
+ rubric: RubricSchema.optional().describe(
33
+ "Inline rubric definition. Mutually exclusive with `rubricName`."
34
+ ),
35
+ content: z.string().min(1).describe("The text being judged \u2014 a tweet, a blog post, a code snippet, anything stringly."),
36
+ context: z.record(z.string(), z.unknown()).optional().describe(
37
+ "Free-form metadata for the rubric to use \u2014 analytics, source URL, author, etc. Surfaced to the LLM."
38
+ ),
39
+ model: z.string().optional().describe('Override the judge model (default routes via tcloud). e.g. "claude-opus-4-7".')
40
+ }).refine((v) => Boolean(v.rubricName) !== Boolean(v.rubric), {
41
+ message: "Provide exactly one of `rubricName` or `rubric`."
42
+ }).openapi("JudgeRequest");
43
+ var JudgeResultSchema = z.object({
44
+ composite: z.number().min(0).max(1).describe("Weighted combination of dimension scores in 0..1. The single number to gate on."),
45
+ dimensions: z.record(z.string(), z.number()).describe("Per-dimension score, keyed by RubricDimension.id."),
46
+ failureModes: z.array(z.string()).default([]).describe("Failure-mode ids detected in the content (subset of rubric.failureModes ids)."),
47
+ wins: z.array(z.string()).default([]).describe("Win ids detected in the content (subset of rubric.wins ids)."),
48
+ rationale: z.string().describe("Plain-English explanation of the score. Surfaced to the human reviewer."),
49
+ rubricVersion: z.string().describe(
50
+ "Stable hash of the rubric used. Scores are only comparable across runs when this matches."
51
+ ),
52
+ model: z.string().describe("Model that produced the judgement, for reproducibility."),
53
+ durationMs: z.number().int().nonnegative().describe("End-to-end wall time for this call.")
54
+ }).openapi("JudgeResult");
55
+ var RubricInfoSchema = z.object({
56
+ name: z.string().describe("Pass this to /v1/judge as `rubricName`."),
57
+ description: z.string().describe("What this rubric measures."),
58
+ dimensions: z.array(z.object({ id: z.string(), description: z.string(), weight: z.number() })).describe("The scoring axes this rubric uses, with weights."),
59
+ failureModes: z.array(z.string()).default([]).describe("Failure-mode ids this rubric detects."),
60
+ rubricVersion: z.string().describe("Stable hash \u2014 match this to compare scores across runs.")
61
+ }).openapi("RubricInfo");
62
+ var ListRubricsResponseSchema = z.object({
63
+ rubrics: z.array(RubricInfoSchema)
64
+ }).openapi("ListRubricsResponse");
65
+ var VersionResponseSchema = z.object({
66
+ package: z.string().describe('Package name (always "@tangle-network/agent-eval").'),
67
+ version: z.string().describe("Semver of the running server. Match your client to this."),
68
+ wireVersion: z.string().describe(
69
+ "Wire-protocol semver. Bumps separately from package version when the schema changes."
70
+ ),
71
+ apiSurface: z.array(z.string()).describe("List of supported method names.")
72
+ }).openapi("VersionResponse");
73
+ var HealthResponseSchema = z.object({
74
+ status: z.literal("ok"),
75
+ uptimeSec: z.number()
76
+ }).openapi("HealthResponse");
77
+ var ErrorResponseSchema = z.object({
78
+ error: z.object({
79
+ code: z.string().describe('Machine-readable code: "validation_error", "rubric_not_found", "judge_error".'),
80
+ message: z.string().describe("Human-readable message."),
81
+ details: z.unknown().optional().describe("Optional structured detail.")
82
+ }).describe("Errors are always wrapped in this shape across all endpoints.")
83
+ }).openapi("ErrorResponse");
84
+ var WIRE_VERSION = "1.0.0";
85
+ function hashRubric(rubric) {
86
+ const stable = JSON.stringify(rubric, Object.keys(rubric).sort());
87
+ let h = 5381;
88
+ for (let i = 0; i < stable.length; i++) {
89
+ h = h * 33 ^ stable.charCodeAt(i);
90
+ }
91
+ return `${rubric.name}@${(h >>> 0).toString(16).padStart(8, "0")}`;
92
+ }
93
+
94
+ // src/wire/rubrics.ts
95
+ var ANTI_SLOP = {
96
+ name: "anti-slop",
97
+ description: "Voice and signal quality for content aimed at senior engineers. Catches AI cadence, marketing tone, and engagement-bait shapes.",
98
+ systemPrompt: `You are evaluating a piece of content written for senior engineers and technical founders.
99
+
100
+ You score three things:
101
+ - buyer_quality (0..1): would a senior engineer in the target ICP find this worth their attention? High = specific, earned, technically interesting. Low = generic, hyped, off-target.
102
+ - voice (0..1): does it read like a person who built the thing, or like AI/marketing copy?
103
+ - signal (0..1): does it contain a non-obvious detail, constraint, or claim a reader couldn't get from the public docs?
104
+
105
+ Detect failure modes (return ids matching):
106
+ - ai-cadence: rule-of-three openings, em-dash flourish, "Let me explain", "Here's the thing", AI rhythm
107
+ - marketing-tone: "We're excited to announce", "thrilled", "delighted", "game-changer", buzzword stack
108
+ - vague-claim: technical claim without a specific component, file, or measurement
109
+ - no-hook: opening doesn't earn attention from the target reader
110
+ - engagement-bait: "agree?", "thoughts?", listicles, controversy-fishing, hook-detail-pitch
111
+ - off-icp: content shape would attract motivational/grift/hype audiences instead of buyers
112
+ - stale-claim: repeats a positioning line we've used many times this month
113
+
114
+ Detect wins (return ids matching):
115
+ - specific-component: names a real file, component, or measurement
116
+ - earned-detail: shares a non-obvious detail not derivable from public docs
117
+ - constraint-articulated: names a real tradeoff and the side chosen
118
+ - honest-failure: describes a real failure mode and what was done about it
119
+
120
+ Return ONLY JSON matching the response schema. Be conservative \u2014 most content has 0-1 wins and 1-2 failure modes, not many of each.`,
121
+ dimensions: [
122
+ {
123
+ id: "buyer_quality",
124
+ description: "Would the target buyer find this worth attention?",
125
+ weight: 0.5,
126
+ min: 0,
127
+ max: 1
128
+ },
129
+ {
130
+ id: "voice",
131
+ description: "Does it sound like a builder, not AI or marketing?",
132
+ weight: 0.3,
133
+ min: 0,
134
+ max: 1
135
+ },
136
+ {
137
+ id: "signal",
138
+ description: "Non-obvious detail, constraint, or claim?",
139
+ weight: 0.2,
140
+ min: 0,
141
+ max: 1
142
+ }
143
+ ],
144
+ failureModes: [
145
+ { id: "ai-cadence", description: "AI-rhythm openings and transitions" },
146
+ { id: "marketing-tone", description: "Buzzwords, hype, corporate-PR voice" },
147
+ { id: "vague-claim", description: "Technical claim without specifics" },
148
+ { id: "no-hook", description: "Opening fails to earn attention" },
149
+ { id: "engagement-bait", description: "Listicle/controversy/agree-pattern" },
150
+ { id: "off-icp", description: "Voice attracts the wrong audience" },
151
+ { id: "stale-claim", description: "Reuses an over-used positioning line" }
152
+ ],
153
+ wins: [
154
+ { id: "specific-component", description: "Names a real file/component/number" },
155
+ { id: "earned-detail", description: "Detail not in public docs" },
156
+ { id: "constraint-articulated", description: "Names a real tradeoff" },
157
+ { id: "honest-failure", description: "Describes a real failure honestly" }
158
+ ]
159
+ };
160
+ var BUILTIN_RUBRICS = {
161
+ "anti-slop": ANTI_SLOP
162
+ };
163
+ function getBuiltinRubric(name) {
164
+ return BUILTIN_RUBRICS[name];
165
+ }
166
+ function listBuiltinRubrics() {
167
+ return Object.values(BUILTIN_RUBRICS).map((r) => ({
168
+ name: r.name,
169
+ description: r.description,
170
+ dimensions: r.dimensions.map((d) => ({
171
+ id: d.id,
172
+ description: d.description,
173
+ weight: d.weight
174
+ })),
175
+ failureModes: r.failureModes.map((f) => f.id),
176
+ rubricVersion: hashRubric(r)
177
+ }));
178
+ }
179
+
180
+ // src/wire/handlers.ts
181
+ import { readFileSync } from "fs";
182
+ import { dirname, resolve } from "path";
183
+ import { fileURLToPath } from "url";
184
+ var WireError = class extends Error {
185
+ constructor(code, message, status = 400, details) {
186
+ super(message);
187
+ this.code = code;
188
+ this.status = status;
189
+ this.details = details;
190
+ this.name = "WireError";
191
+ }
192
+ code;
193
+ status;
194
+ details;
195
+ };
196
+ function judgeOutputSchema(rubric) {
197
+ return {
198
+ name: "JudgeOutput",
199
+ schema: {
200
+ type: "object",
201
+ additionalProperties: false,
202
+ properties: {
203
+ dimensions: {
204
+ type: "object",
205
+ additionalProperties: false,
206
+ properties: Object.fromEntries(
207
+ rubric.dimensions.map((d) => [
208
+ d.id,
209
+ { type: "number", minimum: d.min, maximum: d.max }
210
+ ])
211
+ ),
212
+ required: rubric.dimensions.map((d) => d.id)
213
+ },
214
+ failureModes: {
215
+ type: "array",
216
+ items: { type: "string", enum: rubric.failureModes.map((f) => f.id) }
217
+ },
218
+ wins: {
219
+ type: "array",
220
+ items: { type: "string", enum: rubric.wins.map((w) => w.id) }
221
+ },
222
+ rationale: { type: "string" }
223
+ },
224
+ required: ["dimensions", "rationale"]
225
+ }
226
+ };
227
+ }
228
+ function compositeScore(dimensions, rubric) {
229
+ let weighted = 0;
230
+ let totalWeight = 0;
231
+ for (const dim of rubric.dimensions) {
232
+ const raw = dimensions[dim.id] ?? 0;
233
+ const range = dim.max - dim.min || 1;
234
+ const normalized = Math.max(0, Math.min(1, (raw - dim.min) / range));
235
+ weighted += normalized * dim.weight;
236
+ totalWeight += dim.weight;
237
+ }
238
+ return totalWeight > 0 ? weighted / totalWeight : 0;
239
+ }
240
+ function buildJudgePrompt(content, context) {
241
+ const ctx = context && Object.keys(context).length ? JSON.stringify(context) : "";
242
+ return [
243
+ `CONTENT TO JUDGE:`,
244
+ content,
245
+ "",
246
+ ctx ? `CONTEXT (metadata, analytics, etc.):` : "",
247
+ ctx ? ctx : ""
248
+ ].filter(Boolean).join("\n");
249
+ }
250
+ var DEFAULT_JUDGE_MODEL = "claude-sonnet-4-6";
251
+ async function handleJudge(req) {
252
+ let rubric;
253
+ if (req.rubricName) {
254
+ const found = getBuiltinRubric(req.rubricName);
255
+ if (!found) {
256
+ throw new WireError("rubric_not_found", `No built-in rubric named "${req.rubricName}".`, 404);
257
+ }
258
+ rubric = found;
259
+ } else if (req.rubric) {
260
+ rubric = req.rubric;
261
+ } else {
262
+ throw new WireError("validation_error", "Provide either `rubricName` or `rubric`.", 422);
263
+ }
264
+ const startedAt = Date.now();
265
+ const model = req.model ?? DEFAULT_JUDGE_MODEL;
266
+ const { value, result } = await callLlmJson({
267
+ model,
268
+ messages: [
269
+ { role: "system", content: rubric.systemPrompt },
270
+ { role: "user", content: buildJudgePrompt(req.content, req.context) }
271
+ ],
272
+ jsonSchema: judgeOutputSchema(rubric),
273
+ temperature: 0,
274
+ timeoutMs: 6e4
275
+ });
276
+ if (!value || typeof value !== "object" || !value.dimensions) {
277
+ throw new WireError("judge_error", "Judge returned malformed output.", 500, value);
278
+ }
279
+ const composite = compositeScore(value.dimensions, rubric);
280
+ const durationMs = Date.now() - startedAt;
281
+ return {
282
+ composite,
283
+ dimensions: value.dimensions,
284
+ failureModes: value.failureModes ?? [],
285
+ wins: value.wins ?? [],
286
+ rationale: value.rationale,
287
+ rubricVersion: hashRubric(rubric),
288
+ model: result.model,
289
+ durationMs
290
+ };
291
+ }
292
+ function handleListRubrics() {
293
+ return { rubrics: listBuiltinRubrics() };
294
+ }
295
+ var CACHED_VERSION;
296
+ function readPackageVersion() {
297
+ if (CACHED_VERSION) return CACHED_VERSION;
298
+ const here = dirname(fileURLToPath(import.meta.url));
299
+ const candidates = [
300
+ resolve(here, "..", "..", "package.json"),
301
+ // src/wire → repo root
302
+ resolve(here, "..", "package.json")
303
+ // dist → repo root
304
+ ];
305
+ for (const path of candidates) {
306
+ try {
307
+ const pkg = JSON.parse(readFileSync(path, "utf-8"));
308
+ if (pkg.version) {
309
+ CACHED_VERSION = pkg.version;
310
+ return pkg.version;
311
+ }
312
+ } catch {
313
+ }
314
+ }
315
+ return "0.0.0-unknown";
316
+ }
317
+ function handleVersion() {
318
+ return {
319
+ package: "@tangle-network/agent-eval",
320
+ version: readPackageVersion(),
321
+ wireVersion: WIRE_VERSION,
322
+ apiSurface: ["judge", "listRubrics", "version"]
323
+ };
324
+ }
325
+
326
+ // src/wire/openapi.ts
327
+ import { OpenApiGeneratorV31, OpenAPIRegistry } from "@asteasolutions/zod-to-openapi";
328
+ function buildOpenApi(packageVersion) {
329
+ const registry = new OpenAPIRegistry();
330
+ registry.register("JudgeRequest", JudgeRequestSchema);
331
+ registry.register("JudgeResult", JudgeResultSchema);
332
+ registry.register("ListRubricsResponse", ListRubricsResponseSchema);
333
+ registry.register("VersionResponse", VersionResponseSchema);
334
+ registry.register("HealthResponse", HealthResponseSchema);
335
+ registry.register("ErrorResponse", ErrorResponseSchema);
336
+ registry.registerPath({
337
+ method: "post",
338
+ path: "/v1/judge",
339
+ summary: "Score a piece of content against a rubric",
340
+ description: "Runs the judging LLM with the named (or inline) rubric and returns dimension scores, detected failure modes, wins, and a composite score in 0..1.",
341
+ request: {
342
+ body: {
343
+ content: {
344
+ "application/json": { schema: JudgeRequestSchema }
345
+ }
346
+ }
347
+ },
348
+ responses: {
349
+ 200: {
350
+ description: "Successful judgement",
351
+ content: { "application/json": { schema: JudgeResultSchema } }
352
+ },
353
+ 400: {
354
+ description: "Validation error",
355
+ content: { "application/json": { schema: ErrorResponseSchema } }
356
+ },
357
+ 404: {
358
+ description: "Rubric not found",
359
+ content: { "application/json": { schema: ErrorResponseSchema } }
360
+ },
361
+ 500: {
362
+ description: "Judge error",
363
+ content: { "application/json": { schema: ErrorResponseSchema } }
364
+ }
365
+ }
366
+ });
367
+ registry.registerPath({
368
+ method: "get",
369
+ path: "/v1/rubrics",
370
+ summary: "List built-in rubrics",
371
+ description: "Returns every rubric registered server-side, with their dimensions and stable rubricVersion hash.",
372
+ responses: {
373
+ 200: {
374
+ description: "Listing",
375
+ content: { "application/json": { schema: ListRubricsResponseSchema } }
376
+ }
377
+ }
378
+ });
379
+ registry.registerPath({
380
+ method: "get",
381
+ path: "/v1/version",
382
+ summary: "Server and wire-protocol version",
383
+ description: "Match your client version to `version`; check `wireVersion` for compatibility.",
384
+ responses: {
385
+ 200: {
386
+ description: "Version info",
387
+ content: { "application/json": { schema: VersionResponseSchema } }
388
+ }
389
+ }
390
+ });
391
+ registry.registerPath({
392
+ method: "get",
393
+ path: "/healthz",
394
+ summary: "Liveness check",
395
+ responses: {
396
+ 200: {
397
+ description: "OK",
398
+ content: { "application/json": { schema: HealthResponseSchema } }
399
+ }
400
+ }
401
+ });
402
+ const generator = new OpenApiGeneratorV31(registry.definitions);
403
+ return generator.generateDocument({
404
+ openapi: "3.1.0",
405
+ info: {
406
+ title: "@tangle-network/agent-eval \u2014 wire protocol",
407
+ version: packageVersion,
408
+ description: `HTTP and stdio RPC interface to agent-eval. The TypeScript runtime is the source of truth; this spec is the contract that cross-language clients (Python, Rust, Go) generate from.
409
+
410
+ Wire-protocol version: ${WIRE_VERSION}. Bumps on breaking changes to request/response schemas.`,
411
+ contact: { name: "Tangle Network", url: "https://github.com/tangle-network/agent-eval" },
412
+ license: { name: "MIT" }
413
+ },
414
+ servers: [{ url: "http://localhost:5005", description: "Local agent-eval serve" }]
415
+ });
416
+ }
417
+
418
+ // src/wire/server.ts
419
+ import { serve } from "@hono/node-server";
420
+ import { Hono } from "hono";
421
+ import { cors } from "hono/cors";
422
+ var STARTED_AT = Date.now();
423
+ function createApp() {
424
+ const app = new Hono();
425
+ app.use("*", cors());
426
+ app.onError((err, c) => {
427
+ if (err instanceof WireError) {
428
+ return c.json(
429
+ { error: { code: err.code, message: err.message, details: err.details } },
430
+ err.status
431
+ );
432
+ }
433
+ console.error("[agent-eval] unhandled error:", err);
434
+ return c.json(
435
+ { error: { code: "internal_error", message: "Internal server error." } },
436
+ 500
437
+ );
438
+ });
439
+ app.get(
440
+ "/healthz",
441
+ (c) => c.json({ status: "ok", uptimeSec: (Date.now() - STARTED_AT) / 1e3 })
442
+ );
443
+ app.get("/v1/version", (c) => c.json(handleVersion()));
444
+ app.get("/v1/rubrics", (c) => c.json(handleListRubrics()));
445
+ app.post("/v1/judge", async (c) => {
446
+ const raw = await c.req.json().catch(() => null);
447
+ if (raw == null) {
448
+ throw new WireError("validation_error", "Request body must be JSON.", 400);
449
+ }
450
+ const parsed = JudgeRequestSchema.safeParse(raw);
451
+ if (!parsed.success) {
452
+ throw new WireError(
453
+ "validation_error",
454
+ "Request did not match JudgeRequest schema.",
455
+ 400,
456
+ parsed.error.issues
457
+ );
458
+ }
459
+ const result = await handleJudge(parsed.data);
460
+ return c.json(result);
461
+ });
462
+ app.get("/openapi.json", (c) => c.json(buildOpenApi(handleVersion().version)));
463
+ return app;
464
+ }
465
+ function startServer(opts = {}) {
466
+ const app = createApp();
467
+ const port = opts.port ?? 5005;
468
+ const host = opts.host ?? "127.0.0.1";
469
+ return serve({ fetch: app.fetch, port, hostname: host }, ({ address, port: actualPort }) => {
470
+ console.log(`[agent-eval] serving on http://${address}:${actualPort}`);
471
+ });
472
+ }
473
+
474
+ // src/wire/rpc.ts
475
+ async function dispatchRpc(req) {
476
+ try {
477
+ switch (req.method) {
478
+ case "judge": {
479
+ const parsed = JudgeRequestSchema.safeParse(req.params);
480
+ if (!parsed.success) {
481
+ return {
482
+ error: {
483
+ code: "validation_error",
484
+ message: "params did not match JudgeRequest schema.",
485
+ details: parsed.error.issues
486
+ }
487
+ };
488
+ }
489
+ return { result: await handleJudge(parsed.data) };
490
+ }
491
+ case "listRubrics":
492
+ return { result: handleListRubrics() };
493
+ case "version":
494
+ return { result: handleVersion() };
495
+ default:
496
+ return {
497
+ error: {
498
+ code: "unknown_method",
499
+ message: `No such method: ${req.method}`
500
+ }
501
+ };
502
+ }
503
+ } catch (err) {
504
+ if (err instanceof WireError) {
505
+ return { error: { code: err.code, message: err.message, details: err.details } };
506
+ }
507
+ const message = err instanceof Error ? err.message : String(err);
508
+ return { error: { code: "internal_error", message } };
509
+ }
510
+ }
511
+ async function readAll(stream) {
512
+ const chunks = [];
513
+ for await (const chunk of stream) {
514
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
515
+ }
516
+ return Buffer.concat(chunks).toString("utf-8");
517
+ }
518
+ async function runRpcOnce(method) {
519
+ const raw = await readAll(process.stdin);
520
+ let req;
521
+ try {
522
+ const body = JSON.parse(raw);
523
+ req = method ? { method, params: body } : body;
524
+ } catch (err) {
525
+ process.stdout.write(
526
+ JSON.stringify({
527
+ error: {
528
+ code: "parse_error",
529
+ message: `stdin was not valid JSON: ${err instanceof Error ? err.message : String(err)}`
530
+ }
531
+ }) + "\n"
532
+ );
533
+ return 1;
534
+ }
535
+ const out = await dispatchRpc(req);
536
+ process.stdout.write(JSON.stringify(out) + "\n");
537
+ return "error" in out ? 1 : 0;
538
+ }
539
+ async function runRpcBatch(method) {
540
+ const raw = await readAll(process.stdin);
541
+ const lines = raw.split("\n").filter((l) => l.trim().length > 0);
542
+ let exitCode = 0;
543
+ for (const line of lines) {
544
+ let req;
545
+ try {
546
+ const body = JSON.parse(line);
547
+ req = method ? { method, params: body } : body;
548
+ } catch (err) {
549
+ process.stdout.write(
550
+ JSON.stringify({
551
+ error: {
552
+ code: "parse_error",
553
+ message: `line was not valid JSON: ${err instanceof Error ? err.message : String(err)}`
554
+ }
555
+ }) + "\n"
556
+ );
557
+ exitCode = 1;
558
+ continue;
559
+ }
560
+ const out = await dispatchRpc(req);
561
+ process.stdout.write(JSON.stringify(out) + "\n");
562
+ if ("error" in out) exitCode = 1;
563
+ }
564
+ return exitCode;
565
+ }
566
+
567
+ export {
568
+ RubricDimensionSchema,
569
+ FailureModeSchema,
570
+ RubricSchema,
571
+ JudgeRequestSchema,
572
+ JudgeResultSchema,
573
+ RubricInfoSchema,
574
+ ListRubricsResponseSchema,
575
+ VersionResponseSchema,
576
+ HealthResponseSchema,
577
+ ErrorResponseSchema,
578
+ WIRE_VERSION,
579
+ hashRubric,
580
+ BUILTIN_RUBRICS,
581
+ getBuiltinRubric,
582
+ listBuiltinRubrics,
583
+ WireError,
584
+ handleJudge,
585
+ handleListRubrics,
586
+ handleVersion,
587
+ buildOpenApi,
588
+ createApp,
589
+ startServer,
590
+ dispatchRpc,
591
+ runRpcOnce,
592
+ runRpcBatch
593
+ };
594
+ //# sourceMappingURL=chunk-OZPRSK4A.js.map