@konneal/engine 0.2.133 → 0.2.134
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-ISHJOTSR.js → ask-PFU74MIP.js} +2 -2
- package/dist/{chunk-6KYYWVRV.js → chunk-JYJJ4SYF.js} +1 -1
- package/dist/{chunk-N26ADFMG.js → chunk-WPOKSNPE.js} +1 -1
- package/dist/{search-TMCLLHHP.js → search-NIRCPRMW.js} +1 -1
- package/dist/worker_public/src/index.js +3 -3
- package/dist/worker_public/src/refusal.js +1 -1
- package/package.json +1 -1
- package/workers/worker_public/src/refusal.ts +8 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleAsk
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JYJJ4SYF.js";
|
|
4
4
|
import "./chunk-J6LBR6GI.js";
|
|
5
5
|
import "./chunk-7AXXR7GD.js";
|
|
6
6
|
import "./chunk-TH5XGPD5.js";
|
|
7
7
|
import "./chunk-W7J5SFXJ.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-WPOKSNPE.js";
|
|
9
9
|
import "./chunk-4NXH5ZI6.js";
|
|
10
10
|
import "./chunk-VT7DR6NQ.js";
|
|
11
11
|
import "./chunk-GBGRHXRU.js";
|
|
@@ -58,7 +58,7 @@ function redirectOfferSentences(answer) {
|
|
|
58
58
|
while (i < answer.length) {
|
|
59
59
|
const end = sentenceEnd(answer, i);
|
|
60
60
|
const s = answer.slice(i, end);
|
|
61
|
-
if (/\bI\b[^.!?]{0,
|
|
61
|
+
if (/\bI\b[^.!?]{0,160}?\bquestions? about\b/i.test(s) || /\bI\b[^.!?]{0,160}?\binstead\b/i.test(s) && !/[§\[\d]/.test(s)) out.push([i, end]);
|
|
62
62
|
i = end;
|
|
63
63
|
while (i < answer.length && /\s/.test(answer[i] ?? "")) i++;
|
|
64
64
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
handleMemories,
|
|
5
5
|
scoreFaithfulness,
|
|
6
6
|
scoreJudge
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-JYJJ4SYF.js";
|
|
8
8
|
import {
|
|
9
9
|
TOOLS_REGISTRY,
|
|
10
10
|
bindModelNode,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
} from "../../chunk-W7J5SFXJ.js";
|
|
55
55
|
import {
|
|
56
56
|
canonicalRefusal
|
|
57
|
-
} from "../../chunk-
|
|
57
|
+
} from "../../chunk-WPOKSNPE.js";
|
|
58
58
|
import {
|
|
59
59
|
entitlementScope,
|
|
60
60
|
standardKeysFrom
|
|
@@ -1052,7 +1052,7 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
|
|
|
1052
1052
|
const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
|
|
1053
1053
|
payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
|
|
1054
1054
|
} else {
|
|
1055
|
-
const res = name === "ask" ? await (await import("../../ask-
|
|
1055
|
+
const res = name === "ask" ? await (await import("../../ask-PFU74MIP.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-NIRCPRMW.js")).handleSearch(env, ctx, inner, tier, key);
|
|
1056
1056
|
payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
|
|
1057
1057
|
}
|
|
1058
1058
|
telemetry(env, ctx, tier, `mcp:${name}`, null, !payload?.error, JSON.stringify(payload).length, await sha256Hex(`${name}:${JSON.stringify(args ?? {})}`), void 0, void 0, { durationMs: Date.now() - t0 });
|
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.134",
|
|
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",
|
|
@@ -79,15 +79,20 @@ export interface RefusalScope {
|
|
|
79
79
|
cited?: boolean;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/** A whole-sentence redirect offer
|
|
83
|
-
*
|
|
82
|
+
/** A whole-sentence redirect offer in ONE sentence, first person:
|
|
83
|
+
* the "questions about" marker (four observed shapes carry it —
|
|
84
|
+
* "I'm happy to help with questions about…", "I can answer questions
|
|
85
|
+
* about…", "I'm a metrology assistant — I can answer questions
|
|
86
|
+
* about…", "I'm here for questions about…"), or the "instead" marker
|
|
87
|
+
* in a sentence with NO citation apparatus (no clause anchors, no
|
|
88
|
+
* digits — an offer names no provisions). */
|
|
84
89
|
function redirectOfferSentences(answer: string): Array<[number, number]> {
|
|
85
90
|
const out: Array<[number, number]> = [];
|
|
86
91
|
let i = 0;
|
|
87
92
|
while (i < answer.length) {
|
|
88
93
|
const end = sentenceEnd(answer, i);
|
|
89
94
|
const s = answer.slice(i, end);
|
|
90
|
-
if (/\bI\b[^.!?]{0,
|
|
95
|
+
if (/\bI\b[^.!?]{0,160}?\bquestions? about\b/i.test(s) || (/\bI\b[^.!?]{0,160}?\binstead\b/i.test(s) && !/[§\[\d]/.test(s))) out.push([i, end]);
|
|
91
96
|
i = end;
|
|
92
97
|
while (i < answer.length && /\s/.test(answer[i] ?? "")) i++;
|
|
93
98
|
}
|