@konneal/engine 0.2.64 → 0.2.66

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,12 +1,12 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-NC52SIL7.js";
3
+ } from "./chunk-YZA5XAU7.js";
4
4
  import "./chunk-TPV5GPY2.js";
5
5
  import "./chunk-SPKPH54J.js";
6
6
  import "./chunk-A3QHHUN5.js";
7
7
  import "./chunk-LVZTWUVJ.js";
8
8
  import "./chunk-2PCUAJJO.js";
9
- import "./chunk-D6CMIRMB.js";
9
+ import "./chunk-VGVTIPFW.js";
10
10
  import "./chunk-3FYJM7LH.js";
11
11
  export {
12
12
  handleAsk
@@ -6,7 +6,7 @@ import {
6
6
  registerNote,
7
7
  registerTokens,
8
8
  searchRegister
9
- } from "./chunk-D6CMIRMB.js";
9
+ } from "./chunk-VGVTIPFW.js";
10
10
  import "./chunk-3FYJM7LH.js";
11
11
  export {
12
12
  buildRegisterQuery,
@@ -95,6 +95,9 @@ async function searchRegister(db, query, force = false) {
95
95
  const built = buildRegisterQuery(tokens);
96
96
  let { sql, params } = built;
97
97
  const family = queryFamily(query);
98
+ if (!family) {
99
+ sql = sql.replace("family = ?FAMILY AND ", "");
100
+ }
98
101
  if (family) {
99
102
  sql = sql.replace(/\?(\d+)/g, (_, n) => `?${Number(n) + 1}`);
100
103
  sql = sql.replace("?FAMILY", "?1");
@@ -68,7 +68,7 @@ import {
68
68
  certificateLinks,
69
69
  registerNote,
70
70
  searchRegister
71
- } from "./chunk-D6CMIRMB.js";
71
+ } from "./chunk-VGVTIPFW.js";
72
72
  import {
73
73
  P
74
74
  } from "./chunk-3FYJM7LH.js";
@@ -1892,7 +1892,7 @@ async function runTool(db, call) {
1892
1892
  if (call.name !== "register_search") return null;
1893
1893
  const query = String(call.args?.query ?? "").trim().slice(0, 160);
1894
1894
  if (!query) return null;
1895
- const { searchRegister: searchRegister2, registerNote: registerNote2 } = await import("./certificates-IQU7GQCJ.js");
1895
+ const { searchRegister: searchRegister2, registerNote: registerNote2 } = await import("./certificates-DNRUOYRF.js");
1896
1896
  const reg = await searchRegister2(db, query, true);
1897
1897
  const output = reg?.rows?.length ? registerNote2(reg.rows) : `No certificate was found for "${query}" in the certificates database (the register snapshot). State this as the search's result, with the searched string visible.`;
1898
1898
  return { name: call.name, query, output };
@@ -1943,8 +1943,11 @@ async function extractNameplate(ai, model, image) {
1943
1943
  reasoning_effort: "low"
1944
1944
  });
1945
1945
  const text = typeof res?.response === "string" ? res.response : res?.choices?.[0]?.message?.content;
1946
- return parseNameplate(text ?? "");
1947
- } catch {
1946
+ const np = parseNameplate(text ?? "");
1947
+ console.log(`nameplate-extract: ${np ? `${np.manufacturer} / ${np.model}` : `no parse (${(text ?? "").slice(0, 120)})`}`);
1948
+ return np;
1949
+ } catch (e) {
1950
+ console.log(`nameplate-extract: FAILED ${String(e).slice(0, 160)}`);
1948
1951
  return null;
1949
1952
  }
1950
1953
  }
@@ -6,7 +6,7 @@ import {
6
6
  modelGroundingBlock,
7
7
  scoreFaithfulness,
8
8
  scoreJudge
9
- } from "../../chunk-NC52SIL7.js";
9
+ } from "../../chunk-YZA5XAU7.js";
10
10
  import {
11
11
  handleSearch
12
12
  } from "../../chunk-FLNX4O7C.js";
@@ -63,7 +63,7 @@ import {
63
63
  sha256Hex,
64
64
  today
65
65
  } from "../../chunk-2PCUAJJO.js";
66
- import "../../chunk-D6CMIRMB.js";
66
+ import "../../chunk-VGVTIPFW.js";
67
67
  import {
68
68
  P,
69
69
  setProfile
@@ -959,7 +959,7 @@ async function handleMcp(env, ctx, req, tier, key) {
959
959
  // stream:false forces the JSON lane (anon defaults to SSE)
960
960
  body: JSON.stringify({ ...args, stream: false })
961
961
  });
962
- const res = name === "ask" ? await (await import("../../ask-QSZUXUWG.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-PBOODCMQ.js")).handleSearch(env, ctx, inner, tier, key);
962
+ const res = name === "ask" ? await (await import("../../ask-LAYLNLDK.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-PBOODCMQ.js")).handleSearch(env, ctx, inner, tier, key);
963
963
  return res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
964
964
  });
965
965
  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.64",
30
+ "version": "0.2.66",
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",
@@ -98,6 +98,10 @@ export async function searchRegister(db: any, query: string, force = false): Pro
98
98
  const built = buildRegisterQuery(tokens);
99
99
  let { sql, params } = built;
100
100
  const family = queryFamily(query);
101
+ if (!family) {
102
+ // a tool query that names no family must not carry the placeholder
103
+ sql = sql.replace("family = ?FAMILY AND ", "");
104
+ }
101
105
  if (family) {
102
106
  // the register's family column is the DIGITS ONLY ("60", "105") —
103
107
  // the letter+padding form ("R60") never matched a single row
@@ -24,8 +24,11 @@ export async function extractNameplate(ai: any, model: string, image: string): P
24
24
  reasoning_effort: "low",
25
25
  });
26
26
  const text = typeof res?.response === "string" ? res.response : res?.choices?.[0]?.message?.content;
27
- return parseNameplate(text ?? "");
28
- } catch {
27
+ const np = parseNameplate(text ?? "");
28
+ console.log(`nameplate-extract: ${np ? `${np.manufacturer} / ${np.model}` : `no parse (${(text ?? "").slice(0, 120)})`}`);
29
+ return np;
30
+ } catch (e) {
31
+ console.log(`nameplate-extract: FAILED ${String(e).slice(0, 160)}`);
29
32
  return null; // the bridge is optional — the ask never depends on it
30
33
  }
31
34
  }