@konneal/engine 0.2.103 → 0.2.104

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.
@@ -1573,7 +1573,7 @@ async function laneRoute(c) {
1573
1573
  }
1574
1574
  if (!query || query.length > 2e3) return err(400, "invalid_input", "query required (1-2000 chars)");
1575
1575
  try {
1576
- const vector = await embed(env.AI, MODELS.embed, query);
1576
+ const vector = await embed(portModelRunner(env), MODELS.embed, query);
1577
1577
  const dense = await binding.query(vector, { topK: 20, returnMetadata: "all" });
1578
1578
  const hits = (dense.matches ?? []).map((m) => ({
1579
1579
  id: m.id,
package/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "playwright": "^1.62.1",
28
28
  "yaml": "^2.9.1"
29
29
  },
30
- "version": "0.2.103",
30
+ "version": "0.2.104",
31
31
  "description": "The Konneal engine: the publisher-agnostic build pipeline and API plane for standards intelligence (retrieval, answer contract, verdicts, evaluation).",
32
32
  "license": "BSD-3-Clause",
33
33
  "type": "module",
@@ -17,6 +17,7 @@ import { bindModelNode, modelGroundingBlock } from "./modelplane";
17
17
  import { refCodec } from "./codecs";
18
18
  import { entitlementScope, standardKeysFrom } from "./requestScope";
19
19
  import type { Env } from "./env";
20
+ import { portModelRunner } from "./env.ts";
20
21
  export type { Env };
21
22
  import { json, err, corsHeaders, withCors, readJson, authenticate, type ApiKey } from "./lib/http";
22
23
 
@@ -390,8 +391,11 @@ async function laneRoute(c: RouteContext): Promise<Response> {
390
391
  if (!query || query.length > 2000) return err(400, "invalid_input", "query required (1-2000 chars)");
391
392
 
392
393
  try {
393
- // embed the query
394
- const vector = await embed(env.AI, MODELS.embed, query);
394
+ // embed the query — through the port (the raw binding has no
395
+ // .embed; this call site predates the ports and failed every call
396
+ // with "ai.embed is not a function", unprobed until the primmel
397
+ // lane eval went through the endpoint)
398
+ const vector = await embed(portModelRunner(env), MODELS.embed, query);
395
399
  // dense retrieval from the comparison index
396
400
  const dense = await binding.query(vector, { topK: 20, returnMetadata: "all" });
397
401
  const hits = (dense.matches ?? []).map((m: any) => ({