@konneal/engine 0.2.82 → 0.2.83
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/dist/{ask-QLY2CODU.js → ask-IAJDX2YY.js} +2 -2
- package/dist/{certificates-YFL4K7O3.js → certificates-CO7KX2S2.js} +1 -1
- package/dist/{chunk-7AQM3GSO.js → chunk-JZFXSTYX.js} +7 -2
- package/dist/{chunk-DH3WDTZX.js → chunk-TWK46PU2.js} +3 -3
- package/dist/worker_public/src/index.js +3 -3
- package/package.json +1 -1
- package/workers/worker_public/src/ask.ts +1 -1
- package/workers/worker_public/src/certificates.ts +8 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleAsk
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TWK46PU2.js";
|
|
4
4
|
import "./chunk-7HWJOFTQ.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-
|
|
9
|
+
import "./chunk-JZFXSTYX.js";
|
|
10
10
|
import "./chunk-3FYJM7LH.js";
|
|
11
11
|
export {
|
|
12
12
|
handleAsk
|
|
@@ -139,8 +139,13 @@ function registerNote(rows) {
|
|
|
139
139
|
}
|
|
140
140
|
function certificateLinks(rows) {
|
|
141
141
|
const links = rows.filter((r) => r.pdf_key).map((r) => `- ${r.num}: https://www.oimlsmart.org/cert-pdf/${r.pdf_key}`);
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const absent = rows.filter((r) => !r.pdf_key && r.num).slice(0, 6).map((r) => `- ${r.num}: no document on file in this snapshot`);
|
|
143
|
+
const parts = [];
|
|
144
|
+
if (links.length) parts.push(`Documents on file:
|
|
145
|
+
${links.join("\n")}`);
|
|
146
|
+
if (absent.length) parts.push(`No document on file (do NOT construct a link for these):
|
|
147
|
+
${absent.join("\n")}`);
|
|
148
|
+
return parts.join("\n");
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
export {
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
certificateLinks,
|
|
73
73
|
registerNote,
|
|
74
74
|
searchRegister
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-JZFXSTYX.js";
|
|
76
76
|
import {
|
|
77
77
|
P
|
|
78
78
|
} from "./chunk-3FYJM7LH.js";
|
|
@@ -1896,7 +1896,7 @@ async function runTool(db, call) {
|
|
|
1896
1896
|
if (call.name !== "register_search") return null;
|
|
1897
1897
|
const query = String(call.args?.query ?? "").trim().slice(0, 160);
|
|
1898
1898
|
if (!query) return null;
|
|
1899
|
-
const { searchRegister: searchRegister2, registerNote: registerNote2 } = await import("./certificates-
|
|
1899
|
+
const { searchRegister: searchRegister2, registerNote: registerNote2 } = await import("./certificates-CO7KX2S2.js");
|
|
1900
1900
|
const reg = await searchRegister2(db, query, true);
|
|
1901
1901
|
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.`;
|
|
1902
1902
|
return { name: call.name, query, output };
|
|
@@ -2880,7 +2880,7 @@ Answer account questions from these records ONLY: name the record when you use i
|
|
|
2880
2880
|
const imageTurn = typeof withImage === "string";
|
|
2881
2881
|
const probeMessages = [...messages.slice(0, -1), { role: "user", content: `${TOOL_DECLARATION}
|
|
2882
2882
|
|
|
2883
|
-
${imageTurn ? "A photograph of the instrument is attached after this message. Transcribe the maker, model and any printed certificate number you can read, then emit the TOOL line with those tokens as the query \u2014 never invented." : ""}
|
|
2883
|
+
${imageTurn ? "A photograph of the instrument is attached after this message. Transcribe the maker, model and any printed certificate number you can read FROM THE PHOTOGRAPH ITSELF, then emit the TOOL line with those tokens as the query \u2014 never invented, and never tokens taken from any register content elsewhere in the context (a register row's holder is not the plate's maker; observed live 2026-10-04)." : ""}
|
|
2884
2884
|
|
|
2885
2885
|
${q.query}`.replace("\n\n\n\n", "\n\n") }];
|
|
2886
2886
|
if (imageTurn) probeMessages.push({ role: "user", content: [{ type: "image_url", image_url: { url: withImage } }] });
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
modelGroundingBlock,
|
|
7
7
|
scoreFaithfulness,
|
|
8
8
|
scoreJudge
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-TWK46PU2.js";
|
|
10
10
|
import {
|
|
11
11
|
handleSearch
|
|
12
12
|
} from "../../chunk-KO6DRI7C.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
sha256Hex,
|
|
64
64
|
today
|
|
65
65
|
} from "../../chunk-2PCUAJJO.js";
|
|
66
|
-
import "../../chunk-
|
|
66
|
+
import "../../chunk-JZFXSTYX.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-
|
|
962
|
+
const res = name === "ask" ? await (await import("../../ask-IAJDX2YY.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-LVUQLA3C.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.
|
|
30
|
+
"version": "0.2.83",
|
|
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",
|
|
@@ -1230,7 +1230,7 @@ let convEntities: Array<{ entity: string; kind: string }> = [];
|
|
|
1230
1230
|
if (/certificate|certified|certification/i.test(q.query) && env.DB) {
|
|
1231
1231
|
try {
|
|
1232
1232
|
const imageTurn = typeof withImage === "string";
|
|
1233
|
-
const probeMessages: any[] = [...messages.slice(0, -1), { role: "user", content: `${TOOL_DECLARATION}\n\n${imageTurn ? "A photograph of the instrument is attached after this message. Transcribe the maker, model and any printed certificate number you can read, then emit the TOOL line with those tokens as the query — never invented." : ""}\n\n${q.query}`.replace("\n\n\n\n", "\n\n") }];
|
|
1233
|
+
const probeMessages: any[] = [...messages.slice(0, -1), { role: "user", content: `${TOOL_DECLARATION}\n\n${imageTurn ? "A photograph of the instrument is attached after this message. Transcribe the maker, model and any printed certificate number you can read FROM THE PHOTOGRAPH ITSELF, then emit the TOOL line with those tokens as the query — never invented, and never tokens taken from any register content elsewhere in the context (a register row's holder is not the plate's maker; observed live 2026-10-04)." : ""}\n\n${q.query}`.replace("\n\n\n\n", "\n\n") }];
|
|
1234
1234
|
if (imageTurn) probeMessages.push({ role: "user", content: [{ type: "image_url", image_url: { url: withImage } }] });
|
|
1235
1235
|
const probe = await (env as any).AI.run(model, {
|
|
1236
1236
|
messages: probeMessages,
|
|
@@ -163,6 +163,13 @@ export function registerNote(rows: RegisterRow[]): string {
|
|
|
163
163
|
* the fact. */
|
|
164
164
|
export function certificateLinks(rows: RegisterRow[]): string {
|
|
165
165
|
const links = rows.filter((r) => r.pdf_key).map((r) => `- ${r.num}: https://www.oimlsmart.org/cert-pdf/${r.pdf_key}`);
|
|
166
|
-
|
|
166
|
+
// absence is stated per row: an unmarked gap invited the model to
|
|
167
|
+
// generalize the URL pattern to a document-less row (a fabricated 404
|
|
168
|
+
// link, observed live 2026-10-04)
|
|
169
|
+
const absent = rows.filter((r) => !r.pdf_key && r.num).slice(0, 6).map((r) => `- ${r.num}: no document on file in this snapshot`);
|
|
170
|
+
const parts: string[] = [];
|
|
171
|
+
if (links.length) parts.push(`Documents on file:\n${links.join("\n")}`);
|
|
172
|
+
if (absent.length) parts.push(`No document on file (do NOT construct a link for these):\n${absent.join("\n")}`);
|
|
173
|
+
return parts.join("\n");
|
|
167
174
|
}
|
|
168
175
|
|