@konneal/engine 0.2.42 → 0.2.43

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-ZAAKM54K.js";
3
+ } from "./chunk-IEM2XBLP.js";
4
4
  import "./chunk-N2UOENDY.js";
5
5
  import "./chunk-R2V3X6SQ.js";
6
6
  import "./chunk-A3QHHUN5.js";
@@ -1814,7 +1814,10 @@ async function searchRegister(db, query) {
1814
1814
  if (!isRegisterShaped(query)) return null;
1815
1815
  const tokens2 = registerTokens(query);
1816
1816
  if (!tokens2.length) return null;
1817
- const clauses = tokens2.map(() => "(holder LIKE ?1 OR model LIKE ?1 OR num LIKE ?1)").join(" OR ");
1817
+ const clauses = tokens2.map((_, i) => {
1818
+ const n = i + 1;
1819
+ return `(holder LIKE ?${n} OR model LIKE ?${n} OR num LIKE ?${n})`;
1820
+ }).join(" OR ");
1818
1821
  const params = tokens2.map((t) => `%${t}%`);
1819
1822
  try {
1820
1823
  const res = await db.prepare(`SELECT num, family, holder, model, year, status FROM certificates WHERE ${clauses} LIMIT 6`).bind(...params).all();
@@ -9,7 +9,7 @@ import {
9
9
  modelGroundingBlock,
10
10
  scoreJudge,
11
11
  standardForDocNumber
12
- } from "../../chunk-ZAAKM54K.js";
12
+ } from "../../chunk-IEM2XBLP.js";
13
13
  import {
14
14
  buildMessages,
15
15
  citations,
@@ -999,7 +999,7 @@ async function handleMcp(env, ctx, req, tier, key) {
999
999
  // stream:false forces the JSON lane (anon defaults to SSE)
1000
1000
  body: JSON.stringify({ ...args, stream: false })
1001
1001
  });
1002
- const res = name === "ask" ? await (await import("../../ask-LFU3M2JA.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-QZDQVB57.js")).handleSearch(env, ctx, inner, tier, key);
1002
+ const res = name === "ask" ? await (await import("../../ask-72UZSXFM.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-QZDQVB57.js")).handleSearch(env, ctx, inner, tier, key);
1003
1003
  return res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
1004
1004
  });
1005
1005
  if (out.ok && "accepted" in out) return new Response(null, { status: 202 });
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.42",
30
+ "version": "0.2.43",
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",
@@ -52,7 +52,13 @@ export async function searchRegister(db: any, query: string): Promise<{ rows: Re
52
52
  if (!isRegisterShaped(query)) return null;
53
53
  const tokens = registerTokens(query);
54
54
  if (!tokens.length) return null;
55
- const clauses = tokens.map(() => "(holder LIKE ?1 OR model LIKE ?1 OR num LIKE ?1)").join(" OR ");
55
+ // each token takes its own numbered placeholder, referenced three
56
+ // times (holder, model, number) — a shared ?1 would silently search
57
+ // the first token only
58
+ const clauses = tokens.map((_, i) => {
59
+ const n = i + 1;
60
+ return `(holder LIKE ?${n} OR model LIKE ?${n} OR num LIKE ?${n})`;
61
+ }).join(" OR ");
56
62
  const params = tokens.map((t) => `%${t}%`);
57
63
  try {
58
64
  const res = await db