@velum-labs/routekit-eval-core 1.0.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Velum Labs
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @velum-labs/routekit-eval-core
2
+
3
+ Effect execution and aggregation for RouteKit evaluations. Candidate and judge
4
+ calls use a dedicated token, explicit model IDs, attribution metadata, and a
5
+ policy-bypass header so evaluation cannot recursively invoke the auto-router.
6
+ The online request path never imports this package.
@@ -0,0 +1,2 @@
1
+ export type { EvalEgressOptions } from "./egress.js";
2
+ export { type RoutingModelAvailability, type RoutingScoreConstraints, type RoutingScoreResult, RoutingScoringError, type RoutingScoringErrorCode, type ScoreRoutingCandidatesInput, scoreRoutingCandidates } from "./routing-score.js";
@@ -0,0 +1 @@
1
+ export { RoutingScoringError, scoreRoutingCandidates } from "./routing-score.js";
@@ -0,0 +1,15 @@
1
+ import { type EvalRole } from "@velum-labs/routekit-eval-contracts";
2
+ import { Effect } from "effect";
3
+ import { HttpClient } from "effect/unstable/http";
4
+ export type EvalEgressOptions = {
5
+ gatewayUrl: string;
6
+ token: string;
7
+ };
8
+ export declare function completeEvalChat(input: {
9
+ egress: EvalEgressOptions;
10
+ model: string;
11
+ role: EvalRole;
12
+ runId: string;
13
+ caseId: string;
14
+ prompt: string;
15
+ }): Effect.Effect<string, Error, HttpClient.HttpClient>;
package/dist/egress.js ADDED
@@ -0,0 +1,46 @@
1
+ import { assertExplicitEvalModel, EVAL_ATTRIBUTION_HEADER, EVAL_POLICY_BYPASS_HEADER } from "@velum-labs/routekit-eval-contracts";
2
+ import { RouteKitFailure, toRouteKitFailure } from "@velum-labs/routekit-runtime/effect";
3
+ import { Effect } from "effect";
4
+ import { HttpClient, HttpClientRequest } from "effect/unstable/http";
5
+ function completionText(payload) {
6
+ if (typeof payload !== "object" || payload === null)
7
+ return "";
8
+ const choices = payload.choices;
9
+ if (!Array.isArray(choices) || choices[0] === undefined)
10
+ return "";
11
+ const message = choices[0].message;
12
+ return typeof message?.content === "string" ? message.content : "";
13
+ }
14
+ export function completeEvalChat(input) {
15
+ const url = `${input.egress.gatewayUrl.replace(/\/$/, "")}/v1/chat/completions`;
16
+ const request = HttpClientRequest.post(url).pipe(HttpClientRequest.setHeaders({
17
+ authorization: `Bearer ${input.egress.token}`,
18
+ "content-type": "application/json",
19
+ [EVAL_POLICY_BYPASS_HEADER]: "1",
20
+ [EVAL_ATTRIBUTION_HEADER]: JSON.stringify({
21
+ purpose: "eval",
22
+ role: input.role,
23
+ runId: input.runId,
24
+ caseId: input.caseId
25
+ })
26
+ }), HttpClientRequest.bodyText(JSON.stringify({
27
+ model: input.model,
28
+ messages: [{ role: "user", content: input.prompt }],
29
+ stream: false
30
+ })));
31
+ return Effect.gen(function* () {
32
+ yield* Effect.try({
33
+ try: () => assertExplicitEvalModel(input.model, input.role),
34
+ catch: (cause) => toRouteKitFailure(cause)
35
+ });
36
+ const client = yield* HttpClient.HttpClient;
37
+ const response = yield* client.execute(request);
38
+ if (response.status < 200 || response.status >= 300) {
39
+ return yield* new RouteKitFailure({
40
+ message: `${input.role} call failed (${response.status})`
41
+ });
42
+ }
43
+ const payload = yield* response.json;
44
+ return completionText(payload);
45
+ });
46
+ }
@@ -0,0 +1,2 @@
1
+ export type { EvalEgressOptions } from "./egress.js";
2
+ export { type RoutingModelAvailability, type RoutingScoreConstraints, type RoutingScoreResult, RoutingScoringError, type RoutingScoringErrorCode, type ScoreRoutingCandidatesInput, scoreRoutingCandidates } from "./routing-score.js";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { RoutingScoringError, scoreRoutingCandidates } from "./routing-score.js";
@@ -0,0 +1,41 @@
1
+ import type { PublishedRoutingActivation, RequestDecomposition, RequestRoutingRequirements, RoutingCandidateDecision, RoutingEndpoint, RoutingObjectivePolicy } from "@velum-labs/routekit-eval-contracts";
2
+ export type RoutingModelAvailability = Readonly<{
3
+ model: string;
4
+ served: boolean;
5
+ endpoints: readonly RoutingEndpoint[];
6
+ supportsTools: boolean;
7
+ supportsVision: boolean;
8
+ maxInputTokens?: number;
9
+ maxOutputTokens?: number;
10
+ }>;
11
+ export type RoutingScoreConstraints = Readonly<{
12
+ /** Per-dimension conservative quality floors, applied before aggregation. */
13
+ minimumDimensionQuality?: Readonly<Record<string, number>>;
14
+ /** Maximum weighted failure rate for a candidate. */
15
+ maximumFailureRate?: number;
16
+ }>;
17
+ export type ScoreRoutingCandidatesInput = Readonly<{
18
+ snapshot: PublishedRoutingActivation;
19
+ decomposition: RequestDecomposition;
20
+ requirements: RequestRoutingRequirements;
21
+ objective: RoutingObjectivePolicy;
22
+ availableModels: readonly RoutingModelAvailability[];
23
+ constraints?: RoutingScoreConstraints;
24
+ }>;
25
+ export type RoutingScoreResult = Readonly<{
26
+ candidates: readonly RoutingCandidateDecision[];
27
+ selectedModel: string;
28
+ fallbackModels: readonly string[];
29
+ }>;
30
+ export type RoutingScoringErrorCode = "invalid_input" | "no_eligible_models";
31
+ export declare class RoutingScoringError extends Error {
32
+ readonly code: RoutingScoringErrorCode;
33
+ readonly candidates: readonly RoutingCandidateDecision[];
34
+ constructor(code: RoutingScoringErrorCode, message: string, candidates?: readonly RoutingCandidateDecision[]);
35
+ }
36
+ /**
37
+ * Deterministically rank candidate models from a semantic decomposition and a
38
+ * published model-by-dimension evidence matrix. This function performs no I/O and
39
+ * never treats missing or partially unpriced cost as zero.
40
+ */
41
+ export declare function scoreRoutingCandidates(input: ScoreRoutingCandidatesInput): RoutingScoreResult;
@@ -0,0 +1,429 @@
1
+ import { REQUEST_DECOMPOSITION_TOLERANCE } from "@velum-labs/routekit-eval-contracts";
2
+ const VECTOR_TOLERANCE = REQUEST_DECOMPOSITION_TOLERANCE;
3
+ export class RoutingScoringError extends Error {
4
+ code;
5
+ candidates;
6
+ constructor(code, message, candidates = []) {
7
+ super(message);
8
+ this.name = "RoutingScoringError";
9
+ this.code = code;
10
+ this.candidates = candidates;
11
+ }
12
+ }
13
+ function invalid(message) {
14
+ throw new RoutingScoringError("invalid_input", message);
15
+ }
16
+ function finiteUnit(value, label) {
17
+ if (!Number.isFinite(value) || value < 0 || value > 1) {
18
+ invalid(`${label} must be a finite number between zero and one`);
19
+ }
20
+ }
21
+ function unique(values, label) {
22
+ if (new Set(values).size !== values.length)
23
+ invalid(`${label} must not contain duplicates`);
24
+ }
25
+ function compareModelIds(left, right) {
26
+ return left < right ? -1 : left > right ? 1 : 0;
27
+ }
28
+ function compareNumberAscending(left, right) {
29
+ if (left === undefined)
30
+ return right === undefined ? 0 : 1;
31
+ if (right === undefined)
32
+ return -1;
33
+ return left - right;
34
+ }
35
+ function compareNumberDescending(left, right) {
36
+ if (left === undefined)
37
+ return right === undefined ? 0 : 1;
38
+ if (right === undefined)
39
+ return -1;
40
+ return right - left;
41
+ }
42
+ function activeWeights(input) {
43
+ if (input.snapshot.basisDigest !== input.decomposition.basisDigest) {
44
+ invalid("dimension definition digest does not match the routing snapshot");
45
+ }
46
+ const dimensionIds = input.snapshot.dimensions.map((dimension) => dimension.id);
47
+ unique(dimensionIds, "snapshot dimension IDs");
48
+ unique(input.snapshot.candidateModels, "snapshot candidate models");
49
+ if (dimensionIds.length === 0)
50
+ invalid("routing snapshot must contain at least one dimension");
51
+ if (input.snapshot.candidateModels.length === 0) {
52
+ invalid("routing snapshot must contain at least one candidate model");
53
+ }
54
+ const weights = new Map();
55
+ for (const entry of input.decomposition.weights) {
56
+ finiteUnit(entry.weight, `weight for dimension ${entry.dimensionId}`);
57
+ if (weights.has(entry.dimensionId))
58
+ invalid(`duplicate decomposition dimension: ${entry.dimensionId}`);
59
+ if (!dimensionIds.includes(entry.dimensionId))
60
+ invalid(`unknown decomposition dimension: ${entry.dimensionId}`);
61
+ weights.set(entry.dimensionId, entry.weight);
62
+ }
63
+ for (const dimensionId of dimensionIds) {
64
+ if (!weights.has(dimensionId))
65
+ invalid(`missing decomposition dimension: ${dimensionId}`);
66
+ }
67
+ finiteUnit(input.decomposition.unknownWeight, "unknown weight");
68
+ const total = [...weights.values()].reduce((sum, weight) => sum + weight, 0);
69
+ if (Math.abs(total + input.decomposition.unknownWeight - 1) > VECTOR_TOLERANCE) {
70
+ invalid("dimension weights and unknown weight must sum to one");
71
+ }
72
+ if (total <= VECTOR_TOLERANCE)
73
+ invalid("routing requires at least one covered dimension");
74
+ return dimensionIds.flatMap((dimensionId) => {
75
+ const weight = weights.get(dimensionId) ?? 0;
76
+ return weight > VECTOR_TOLERANCE ? [{ dimensionId, weight: weight / total }] : [];
77
+ });
78
+ }
79
+ function validateInput(input) {
80
+ const active = activeWeights(input);
81
+ const availableIds = input.availableModels.map((model) => model.model);
82
+ unique(availableIds, "available model IDs");
83
+ const floors = input.constraints?.minimumDimensionQuality ?? {};
84
+ const knownDimensions = new Set(input.snapshot.dimensions.map((dimension) => dimension.id));
85
+ for (const [dimensionId, floor] of Object.entries(floors)) {
86
+ if (!knownDimensions.has(dimensionId))
87
+ invalid(`quality floor refers to unknown dimension: ${dimensionId}`);
88
+ finiteUnit(floor, `quality floor for dimension ${dimensionId}`);
89
+ }
90
+ const maximumFailureRate = input.constraints?.maximumFailureRate;
91
+ if (maximumFailureRate !== undefined) {
92
+ finiteUnit(maximumFailureRate, "maximum failure rate");
93
+ }
94
+ switch (input.objective.kind) {
95
+ case "highest-quality":
96
+ break;
97
+ case "lowest-cost":
98
+ case "lowest-latency":
99
+ case "pareto":
100
+ finiteUnit(input.objective.minimumQuality, "minimum quality");
101
+ break;
102
+ case "balanced": {
103
+ finiteUnit(input.objective.minimumQuality, "minimum quality");
104
+ const { quality, cost, latency } = input.objective.weights;
105
+ finiteUnit(quality, "balanced quality weight");
106
+ finiteUnit(cost, "balanced cost weight");
107
+ finiteUnit(latency, "balanced latency weight");
108
+ if (Math.abs(quality + cost + latency - 1) > VECTOR_TOLERANCE) {
109
+ invalid("balanced objective weights must sum to one");
110
+ }
111
+ break;
112
+ }
113
+ default: {
114
+ const unreachable = input.objective;
115
+ invalid(`unsupported routing objective: ${String(unreachable)}`);
116
+ }
117
+ }
118
+ return active;
119
+ }
120
+ function capabilityReasons(availability, requirements) {
121
+ if (availability === undefined || !availability.served)
122
+ return ["model_not_served"];
123
+ const reasons = [];
124
+ if (!availability.endpoints.includes(requirements.endpoint)) {
125
+ reasons.push(`endpoint_not_supported:${requirements.endpoint}`);
126
+ }
127
+ if (requirements.requiresTools && !availability.supportsTools) {
128
+ reasons.push("tools_not_supported");
129
+ }
130
+ if (requirements.requiresVision && !availability.supportsVision) {
131
+ reasons.push("vision_not_supported");
132
+ }
133
+ // Numeric limits are optional basis assertions. A known insufficient
134
+ // limit excludes the model; absent metadata must not be misrepresented as
135
+ // proof that an otherwise served model is incapable.
136
+ if (requirements.inputTokens !== undefined &&
137
+ availability.maxInputTokens !== undefined &&
138
+ availability.maxInputTokens < requirements.inputTokens) {
139
+ reasons.push("input_token_limit_insufficient");
140
+ }
141
+ if (requirements.maxOutputTokens !== undefined &&
142
+ availability.maxOutputTokens !== undefined &&
143
+ availability.maxOutputTokens < requirements.maxOutputTokens) {
144
+ reasons.push("output_token_limit_insufficient");
145
+ }
146
+ return reasons;
147
+ }
148
+ function calculateCandidates(input, active) {
149
+ const availability = new Map(input.availableModels.map((model) => [model.model, model]));
150
+ const floors = input.constraints?.minimumDimensionQuality ?? {};
151
+ return input.snapshot.candidateModels.map((model) => {
152
+ const reasons = capabilityReasons(availability.get(model), input.requirements);
153
+ let quality = 0;
154
+ let failureRate = 0;
155
+ let duration = 0;
156
+ let cost = 0;
157
+ let completeCoreEvidence = true;
158
+ let completeDuration = true;
159
+ let completeCost = true;
160
+ for (const { dimensionId, weight } of active) {
161
+ const cells = input.snapshot.evidence.filter((cell) => cell.model === model && cell.dimensionId === dimensionId);
162
+ if (cells.length === 0) {
163
+ reasons.push(`missing_evidence:${dimensionId}`);
164
+ completeCoreEvidence = false;
165
+ completeDuration = false;
166
+ completeCost = false;
167
+ continue;
168
+ }
169
+ if (cells.length > 1) {
170
+ reasons.push(`duplicate_evidence:${dimensionId}`);
171
+ completeCoreEvidence = false;
172
+ completeDuration = false;
173
+ completeCost = false;
174
+ continue;
175
+ }
176
+ const cell = cells[0];
177
+ if (cell === undefined)
178
+ continue;
179
+ quality += cell.quality.lowerConfidenceBound * weight;
180
+ failureRate += cell.failureRate * weight;
181
+ const floor = floors[dimensionId];
182
+ if (floor !== undefined && cell.quality.lowerConfidenceBound < floor) {
183
+ reasons.push(`quality_below_dimension_floor:${dimensionId}`);
184
+ }
185
+ if (cell.p95DurationMs === undefined)
186
+ completeDuration = false;
187
+ else
188
+ duration += cell.p95DurationMs * weight;
189
+ if (cell.averageCostUsd === undefined || cell.unpricedCalls > 0)
190
+ completeCost = false;
191
+ else
192
+ cost += cell.averageCostUsd * weight;
193
+ }
194
+ const candidate = {
195
+ model,
196
+ reasons,
197
+ costStatus: completeCoreEvidence && completeCost ? "known" : "unavailable",
198
+ ...(completeCoreEvidence ? { quality, failureRate } : {}),
199
+ ...(completeCoreEvidence && completeDuration ? { p95DurationMs: duration } : {}),
200
+ ...(completeCoreEvidence && completeCost ? { averageCostUsd: cost } : {})
201
+ };
202
+ if (candidate.failureRate !== undefined &&
203
+ input.constraints?.maximumFailureRate !== undefined &&
204
+ candidate.failureRate > input.constraints.maximumFailureRate) {
205
+ reasons.push("failure_rate_above_maximum");
206
+ }
207
+ return candidate;
208
+ });
209
+ }
210
+ function applyObjectiveEligibility(candidates, objective) {
211
+ for (const candidate of candidates) {
212
+ const quality = candidate.quality;
213
+ if (quality === undefined)
214
+ continue;
215
+ switch (objective.kind) {
216
+ case "highest-quality":
217
+ break;
218
+ case "lowest-cost":
219
+ if (quality < objective.minimumQuality)
220
+ candidate.reasons.push("quality_below_minimum");
221
+ if (candidate.averageCostUsd === undefined)
222
+ candidate.reasons.push("cost_unavailable");
223
+ break;
224
+ case "lowest-latency":
225
+ if (quality < objective.minimumQuality)
226
+ candidate.reasons.push("quality_below_minimum");
227
+ if (candidate.p95DurationMs === undefined)
228
+ candidate.reasons.push("latency_unavailable");
229
+ break;
230
+ case "balanced":
231
+ if (quality < objective.minimumQuality)
232
+ candidate.reasons.push("quality_below_minimum");
233
+ if (objective.weights.cost > 0 && candidate.averageCostUsd === undefined) {
234
+ candidate.reasons.push("cost_unavailable");
235
+ }
236
+ if (objective.weights.latency > 0 && candidate.p95DurationMs === undefined) {
237
+ candidate.reasons.push("latency_unavailable");
238
+ }
239
+ break;
240
+ case "pareto":
241
+ if (quality < objective.minimumQuality)
242
+ candidate.reasons.push("quality_below_minimum");
243
+ if (candidate.averageCostUsd === undefined)
244
+ candidate.reasons.push("cost_unavailable");
245
+ if (candidate.p95DurationMs === undefined)
246
+ candidate.reasons.push("latency_unavailable");
247
+ break;
248
+ default: {
249
+ const unreachable = objective;
250
+ invalid(`unsupported routing objective: ${String(unreachable)}`);
251
+ }
252
+ }
253
+ }
254
+ }
255
+ function normalizeHigher(value, minimum, maximum) {
256
+ return maximum === minimum ? 1 : (value - minimum) / (maximum - minimum);
257
+ }
258
+ function normalizeLower(value, minimum, maximum) {
259
+ return maximum === minimum ? 1 : (maximum - value) / (maximum - minimum);
260
+ }
261
+ function assignBalancedUtility(candidates, objective) {
262
+ const eligible = candidates.filter((candidate) => candidate.reasons.length === 0);
263
+ const qualities = eligible.flatMap((candidate) => candidate.quality === undefined ? [] : [candidate.quality]);
264
+ const costs = eligible.flatMap((candidate) => candidate.averageCostUsd === undefined ? [] : [candidate.averageCostUsd]);
265
+ const latencies = eligible.flatMap((candidate) => candidate.p95DurationMs === undefined ? [] : [candidate.p95DurationMs]);
266
+ if (qualities.length === 0)
267
+ return;
268
+ const qualityMin = Math.min(...qualities);
269
+ const qualityMax = Math.max(...qualities);
270
+ const costMin = costs.length === 0 ? 0 : Math.min(...costs);
271
+ const costMax = costs.length === 0 ? 0 : Math.max(...costs);
272
+ const latencyMin = latencies.length === 0 ? 0 : Math.min(...latencies);
273
+ const latencyMax = latencies.length === 0 ? 0 : Math.max(...latencies);
274
+ for (const candidate of eligible) {
275
+ const quality = candidate.quality;
276
+ if (quality === undefined)
277
+ continue;
278
+ const qualityUtility = normalizeHigher(quality, qualityMin, qualityMax);
279
+ const costUtility = objective.weights.cost === 0
280
+ ? 0
281
+ : normalizeLower(candidate.averageCostUsd ?? 0, costMin, costMax);
282
+ const latencyUtility = objective.weights.latency === 0
283
+ ? 0
284
+ : normalizeLower(candidate.p95DurationMs ?? 0, latencyMin, latencyMax);
285
+ candidate.utility =
286
+ objective.weights.quality * qualityUtility +
287
+ objective.weights.cost * costUtility +
288
+ objective.weights.latency * latencyUtility;
289
+ }
290
+ }
291
+ function standardComparator(objective) {
292
+ return (left, right) => {
293
+ let comparison = 0;
294
+ switch (objective.kind) {
295
+ case "highest-quality":
296
+ comparison =
297
+ compareNumberDescending(left.quality, right.quality) ||
298
+ compareNumberAscending(left.failureRate, right.failureRate) ||
299
+ compareNumberAscending(left.p95DurationMs, right.p95DurationMs) ||
300
+ compareNumberAscending(left.averageCostUsd, right.averageCostUsd);
301
+ break;
302
+ case "lowest-cost":
303
+ comparison =
304
+ compareNumberAscending(left.averageCostUsd, right.averageCostUsd) ||
305
+ compareNumberDescending(left.quality, right.quality) ||
306
+ compareNumberAscending(left.failureRate, right.failureRate) ||
307
+ compareNumberAscending(left.p95DurationMs, right.p95DurationMs);
308
+ break;
309
+ case "lowest-latency":
310
+ comparison =
311
+ compareNumberAscending(left.p95DurationMs, right.p95DurationMs) ||
312
+ compareNumberDescending(left.quality, right.quality) ||
313
+ compareNumberAscending(left.failureRate, right.failureRate) ||
314
+ compareNumberAscending(left.averageCostUsd, right.averageCostUsd);
315
+ break;
316
+ case "balanced":
317
+ comparison =
318
+ compareNumberDescending(left.utility, right.utility) ||
319
+ compareNumberDescending(left.quality, right.quality) ||
320
+ compareNumberAscending(left.averageCostUsd, right.averageCostUsd) ||
321
+ compareNumberAscending(left.p95DurationMs, right.p95DurationMs) ||
322
+ compareNumberAscending(left.failureRate, right.failureRate);
323
+ break;
324
+ default: {
325
+ const unreachable = objective;
326
+ invalid(`unsupported routing objective: ${String(unreachable)}`);
327
+ }
328
+ }
329
+ return comparison || compareModelIds(left.model, right.model);
330
+ };
331
+ }
332
+ function dominates(left, right) {
333
+ const leftQuality = left.quality;
334
+ const rightQuality = right.quality;
335
+ const leftCost = left.averageCostUsd;
336
+ const rightCost = right.averageCostUsd;
337
+ const leftLatency = left.p95DurationMs;
338
+ const rightLatency = right.p95DurationMs;
339
+ if (leftQuality === undefined ||
340
+ rightQuality === undefined ||
341
+ leftCost === undefined ||
342
+ rightCost === undefined ||
343
+ leftLatency === undefined ||
344
+ rightLatency === undefined) {
345
+ return false;
346
+ }
347
+ const noWorse = leftQuality >= rightQuality && leftCost <= rightCost && leftLatency <= rightLatency;
348
+ const strictlyBetter = leftQuality > rightQuality || leftCost < rightCost || leftLatency < rightLatency;
349
+ return noWorse && strictlyBetter;
350
+ }
351
+ function paretoPreferenceComparator(preference) {
352
+ return (left, right) => {
353
+ const preferred = preference === "quality"
354
+ ? compareNumberDescending(left.quality, right.quality)
355
+ : preference === "cost"
356
+ ? compareNumberAscending(left.averageCostUsd, right.averageCostUsd)
357
+ : compareNumberAscending(left.p95DurationMs, right.p95DurationMs);
358
+ return (preferred ||
359
+ compareNumberDescending(left.quality, right.quality) ||
360
+ compareNumberAscending(left.averageCostUsd, right.averageCostUsd) ||
361
+ compareNumberAscending(left.p95DurationMs, right.p95DurationMs) ||
362
+ compareNumberAscending(left.failureRate, right.failureRate) ||
363
+ compareModelIds(left.model, right.model));
364
+ };
365
+ }
366
+ function paretoOrder(candidates, preference) {
367
+ const remaining = [...candidates];
368
+ const ordered = [];
369
+ const comparator = paretoPreferenceComparator(preference);
370
+ while (remaining.length > 0) {
371
+ const frontier = remaining.filter((candidate) => !remaining.some((other) => other !== candidate && dominates(other, candidate)));
372
+ frontier.sort(comparator);
373
+ ordered.push(...frontier);
374
+ const frontierModels = new Set(frontier.map((candidate) => candidate.model));
375
+ for (let index = remaining.length - 1; index >= 0; index -= 1) {
376
+ const candidate = remaining[index];
377
+ if (candidate !== undefined && frontierModels.has(candidate.model))
378
+ remaining.splice(index, 1);
379
+ }
380
+ }
381
+ return ordered;
382
+ }
383
+ function publicDecision(candidate) {
384
+ return {
385
+ model: candidate.model,
386
+ eligible: candidate.reasons.length === 0,
387
+ exclusionReasons: candidate.reasons,
388
+ costStatus: candidate.costStatus,
389
+ ...(candidate.quality === undefined ? {} : { quality: candidate.quality }),
390
+ ...(candidate.failureRate === undefined ? {} : { failureRate: candidate.failureRate }),
391
+ ...(candidate.p95DurationMs === undefined ? {} : { p95DurationMs: candidate.p95DurationMs }),
392
+ ...(candidate.averageCostUsd === undefined ? {} : { averageCostUsd: candidate.averageCostUsd }),
393
+ ...(candidate.utility === undefined ? {} : { utility: candidate.utility }),
394
+ ...(candidate.rank === undefined ? {} : { rank: candidate.rank })
395
+ };
396
+ }
397
+ /**
398
+ * Deterministically rank candidate models from a semantic decomposition and a
399
+ * published model-by-dimension evidence matrix. This function performs no I/O and
400
+ * never treats missing or partially unpriced cost as zero.
401
+ */
402
+ export function scoreRoutingCandidates(input) {
403
+ const active = validateInput(input);
404
+ const candidates = calculateCandidates(input, active);
405
+ applyObjectiveEligibility(candidates, input.objective);
406
+ if (input.objective.kind === "balanced") {
407
+ assignBalancedUtility(candidates, input.objective);
408
+ }
409
+ const eligible = candidates.filter((candidate) => candidate.reasons.length === 0);
410
+ const rejected = candidates
411
+ .filter((candidate) => candidate.reasons.length > 0)
412
+ .sort((left, right) => compareModelIds(left.model, right.model));
413
+ const ranked = input.objective.kind === "pareto"
414
+ ? paretoOrder(eligible, input.objective.preference)
415
+ : [...eligible].sort(standardComparator(input.objective));
416
+ ranked.forEach((candidate, index) => {
417
+ candidate.rank = index + 1;
418
+ });
419
+ const decisions = [...ranked, ...rejected].map(publicDecision);
420
+ const selected = ranked[0];
421
+ if (selected === undefined) {
422
+ throw new RoutingScoringError("no_eligible_models", "no candidate model satisfies the routing requirements and objective", decisions);
423
+ }
424
+ return {
425
+ candidates: decisions,
426
+ selectedModel: selected.model,
427
+ fallbackModels: ranked.slice(1).map((candidate) => candidate.model)
428
+ };
429
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ test("retired ENG-814 imports remain compile failures", () => {
4
+ assert.ok(true);
5
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,211 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import { RoutingScoringError, scoreRoutingCandidates } from "../routing-score.js";
4
+ const models = ["provider/alpha", "provider/beta", "provider/gamma"];
5
+ const dimensions = [
6
+ { id: "code", description: "Code changes", includes: ["implementation"], excludes: [] },
7
+ { id: "docs", description: "Documentation", includes: ["writing"], excludes: [] }
8
+ ];
9
+ function cell(model, dimensionId, quality, options = {}) {
10
+ return {
11
+ model,
12
+ dimensionId,
13
+ suiteDigest: `suite-${dimensionId}`,
14
+ evidenceDigest: `evidence-${model}-${dimensionId}`,
15
+ quality: { passRate: quality, lowerConfidenceBound: quality, sampleCount: 20 },
16
+ failureRate: options.failureRate ?? 1 - quality,
17
+ ...(options.duration === undefined ? {} : { p95DurationMs: options.duration }),
18
+ ...(options.cost === undefined ? {} : { averageCostUsd: options.cost }),
19
+ unpricedCalls: options.unpricedCalls ?? (options.cost === undefined ? 20 : 0)
20
+ };
21
+ }
22
+ function snapshot(evidence, candidateModels = models) {
23
+ return {
24
+ version: 2,
25
+ generatedAt: "2026-08-17T00:00:00.000Z",
26
+ basisDigest: "definition-digest",
27
+ evidenceDigest: "evidence-digest",
28
+ classifierModel: "provider/classifier",
29
+ objective: { kind: "highest-quality" },
30
+ maximumUnknownWeight: 0.2,
31
+ dimensions,
32
+ candidateModels,
33
+ evidence
34
+ };
35
+ }
36
+ const decomposition = {
37
+ version: 2,
38
+ basisDigest: "definition-digest",
39
+ weights: [
40
+ { dimensionId: "code", weight: 0.54 },
41
+ { dimensionId: "docs", weight: 0.36 }
42
+ ],
43
+ unknownWeight: 0.1
44
+ };
45
+ const requirements = {
46
+ endpoint: "responses",
47
+ requiresTools: false,
48
+ requiresVision: false,
49
+ inputTokens: 4_000,
50
+ maxOutputTokens: 2_000
51
+ };
52
+ function available(model, overrides = {}) {
53
+ return {
54
+ model,
55
+ served: true,
56
+ endpoints: ["responses"],
57
+ supportsTools: true,
58
+ supportsVision: true,
59
+ maxInputTokens: 100_000,
60
+ maxOutputTokens: 8_000,
61
+ ...overrides
62
+ };
63
+ }
64
+ function run(evidence, objective = { kind: "highest-quality" }, options = {}) {
65
+ return scoreRoutingCandidates({
66
+ snapshot: snapshot(evidence, options.candidateModels),
67
+ decomposition: options.requestDecomposition ?? decomposition,
68
+ requirements,
69
+ objective,
70
+ availableModels: options.availableModels ?? models.map((model) => available(model))
71
+ });
72
+ }
73
+ const completeEvidence = [
74
+ cell(models[0], "code", 0.9, { cost: 3, duration: 100 }),
75
+ cell(models[0], "docs", 0.6, { cost: 1, duration: 300 }),
76
+ cell(models[1], "code", 0.75, { cost: 1, duration: 200 }),
77
+ cell(models[1], "docs", 0.8, { cost: 1, duration: 200 }),
78
+ cell(models[2], "code", 0.7, { cost: 0.5, duration: 80 }),
79
+ cell(models[2], "docs", 0.7, { cost: 0.5, duration: 80 })
80
+ ];
81
+ test("highest-quality aggregates covered dimension weights and is candidate-order invariant", () => {
82
+ const first = run(completeEvidence);
83
+ const reversed = run([...completeEvidence].reverse(), { kind: "highest-quality" }, {
84
+ candidateModels: [...models].reverse()
85
+ });
86
+ assert.equal(first.selectedModel, models[0]);
87
+ assert.deepEqual(first.fallbackModels, [models[1], models[2]]);
88
+ assert.deepEqual(first.candidates.map(({ model, rank }) => ({ model, rank })), reversed.candidates.map(({ model, rank }) => ({ model, rank })));
89
+ assert.equal(first.candidates[0]?.quality, 0.78);
90
+ assert.ok(Math.abs((first.candidates[0]?.averageCostUsd ?? 0) - 2.2) < 1e-12);
91
+ assert.equal(first.candidates[0]?.p95DurationMs, 180);
92
+ });
93
+ test("hard requirements exclude unserved and incapable candidates before scoring", () => {
94
+ const result = run(completeEvidence, { kind: "highest-quality" }, {
95
+ availableModels: [
96
+ available(models[0], { supportsTools: false }),
97
+ available(models[1], { maxOutputTokens: 1_000 }),
98
+ available(models[2])
99
+ ]
100
+ });
101
+ const withTools = scoreRoutingCandidates({
102
+ snapshot: snapshot(completeEvidence),
103
+ decomposition,
104
+ requirements: { ...requirements, requiresTools: true },
105
+ objective: { kind: "highest-quality" },
106
+ availableModels: [
107
+ available(models[0], { supportsTools: false }),
108
+ available(models[1], { maxOutputTokens: 1_000 }),
109
+ available(models[2])
110
+ ]
111
+ });
112
+ assert.equal(result.selectedModel, models[0]);
113
+ assert.deepEqual(result.candidates.find(({ model }) => model === models[1])?.exclusionReasons, [
114
+ "output_token_limit_insufficient"
115
+ ]);
116
+ assert.deepEqual(withTools.candidates.find(({ model }) => model === models[0])?.exclusionReasons, ["tools_not_supported"]);
117
+ });
118
+ test("unknown numeric basis limits do not claim a served model is incapable", () => {
119
+ const result = run(completeEvidence, { kind: "highest-quality" }, {
120
+ availableModels: models.map((model) => available(model, {
121
+ maxInputTokens: undefined,
122
+ maxOutputTokens: undefined
123
+ }))
124
+ });
125
+ assert.equal(result.selectedModel, models[0]);
126
+ assert.deepEqual(result.candidates.map(({ exclusionReasons }) => exclusionReasons), [[], [], []]);
127
+ });
128
+ test("missing evidence and per-dimension quality floors fail candidates closed", () => {
129
+ const missingLastCell = completeEvidence.filter((entry) => !(entry.model === models[0] && entry.dimensionId === "docs"));
130
+ const result = scoreRoutingCandidates({
131
+ snapshot: snapshot(missingLastCell),
132
+ decomposition,
133
+ requirements,
134
+ objective: { kind: "highest-quality" },
135
+ availableModels: models.map((model) => available(model)),
136
+ constraints: { minimumDimensionQuality: { code: 0.72 } }
137
+ });
138
+ assert.equal(result.selectedModel, models[1]);
139
+ assert.deepEqual(result.candidates.find(({ model }) => model === models[0])?.exclusionReasons, [
140
+ "missing_evidence:docs"
141
+ ]);
142
+ assert.deepEqual(result.candidates.find(({ model }) => model === models[2])?.exclusionReasons, [
143
+ "quality_below_dimension_floor:code"
144
+ ]);
145
+ });
146
+ test("lowest-cost excludes partially unpriced candidates rather than treating cost as zero", () => {
147
+ const evidence = completeEvidence.map((entry) => entry.model === models[2] ? { ...entry, unpricedCalls: 1 } : entry);
148
+ const result = run(evidence, { kind: "lowest-cost", minimumQuality: 0.65 });
149
+ const unpriced = result.candidates.find(({ model }) => model === models[2]);
150
+ assert.equal(result.selectedModel, models[1]);
151
+ assert.equal(unpriced?.costStatus, "unavailable");
152
+ assert.equal(unpriced?.averageCostUsd, undefined);
153
+ assert.deepEqual(unpriced?.exclusionReasons, ["cost_unavailable"]);
154
+ });
155
+ test("lowest-latency applies the aggregate quality floor and requires latency evidence", () => {
156
+ const evidence = completeEvidence.map((entry) => entry.model === models[2] && entry.dimensionId === "docs"
157
+ ? cell(models[2], "docs", 0.7, { cost: 0.5 })
158
+ : entry);
159
+ const result = run(evidence, { kind: "lowest-latency", minimumQuality: 0.72 });
160
+ assert.equal(result.selectedModel, models[0]);
161
+ assert.deepEqual(result.candidates.find(({ model }) => model === models[2])?.exclusionReasons, [
162
+ "quality_below_minimum",
163
+ "latency_unavailable"
164
+ ]);
165
+ });
166
+ test("balanced objective normalizes metrics and honors explicit weights", () => {
167
+ const result = run(completeEvidence, {
168
+ kind: "balanced",
169
+ minimumQuality: 0.65,
170
+ weights: { quality: 0.2, cost: 0.2, latency: 0.6 }
171
+ });
172
+ assert.equal(result.selectedModel, models[2]);
173
+ assert.equal(result.candidates[0]?.utility, 0.8);
174
+ assert.ok((result.candidates[1]?.utility ?? 0) < (result.candidates[0]?.utility ?? 0));
175
+ });
176
+ test("pareto ranks each non-dominated frontier by the declared preference", () => {
177
+ const evidence = [
178
+ cell(models[0], "code", 0.9, { cost: 3, duration: 100 }),
179
+ cell(models[0], "docs", 0.9, { cost: 3, duration: 100 }),
180
+ cell(models[1], "code", 0.8, { cost: 2, duration: 200 }),
181
+ cell(models[1], "docs", 0.8, { cost: 2, duration: 200 }),
182
+ cell(models[2], "code", 0.7, { cost: 4, duration: 300 }),
183
+ cell(models[2], "docs", 0.7, { cost: 4, duration: 300 })
184
+ ];
185
+ const result = run(evidence, {
186
+ kind: "pareto",
187
+ minimumQuality: 0.6,
188
+ preference: "cost"
189
+ });
190
+ assert.equal(result.selectedModel, models[1]);
191
+ assert.deepEqual(result.fallbackModels, [models[0], models[2]]);
192
+ });
193
+ test("invalid decompositions and balanced weights fail with a typed input error", () => {
194
+ assert.throws(() => run(completeEvidence, { kind: "highest-quality" }, {
195
+ requestDecomposition: { ...decomposition, unknownWeight: 0.2 }
196
+ }), (error) => error instanceof RoutingScoringError && error.code === "invalid_input");
197
+ assert.throws(() => run(completeEvidence, {
198
+ kind: "balanced",
199
+ minimumQuality: 0,
200
+ weights: { quality: 0.5, cost: 0.5, latency: 0.5 }
201
+ }), (error) => error instanceof RoutingScoringError && error.code === "invalid_input");
202
+ });
203
+ test("no eligible model returns sanitized candidate reasons in the typed error", () => {
204
+ assert.throws(() => run(completeEvidence, { kind: "lowest-cost", minimumQuality: 0.99 }), (error) => {
205
+ assert.ok(error instanceof RoutingScoringError);
206
+ assert.equal(error.code, "no_eligible_models");
207
+ assert.equal(error.candidates.length, 3);
208
+ assert.ok(error.candidates.every((candidate) => !candidate.eligible));
209
+ return true;
210
+ });
211
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@velum-labs/routekit-eval-core",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/velum-labs/routekit.git",
8
+ "directory": "packages/eval-core"
9
+ },
10
+ "description": "Effect evaluation execution and aggregation for RouteKit.",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./effect": {
19
+ "types": "./dist/effect-api.d.ts",
20
+ "default": "./dist/effect-api.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "LICENSE"
26
+ ],
27
+ "publishConfig": {
28
+ "registry": "https://registry.npmjs.org",
29
+ "access": "public",
30
+ "provenance": true
31
+ },
32
+ "dependencies": {
33
+ "effect": "4.0.0-rc.108",
34
+ "@velum-labs/routekit-eval-contracts": "1.0.0",
35
+ "@velum-labs/routekit-runtime": "1.0.0"
36
+ },
37
+ "keywords": [
38
+ "routekit",
39
+ "eval",
40
+ "effect"
41
+ ],
42
+ "scripts": {
43
+ "build": "tsc -b",
44
+ "clean": "tsc -b --clean",
45
+ "test": "node --test \"dist/test/*.test.js\""
46
+ }
47
+ }