@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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-6KYYWVRV.js";
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-N26ADFMG.js";
8
+ import "./chunk-WPOKSNPE.js";
9
9
  import "./chunk-4NXH5ZI6.js";
10
10
  import "./chunk-VT7DR6NQ.js";
11
11
  import "./chunk-GBGRHXRU.js";
@@ -83,7 +83,7 @@ import {
83
83
  canonicalRefusal,
84
84
  exciseMisplacedPin,
85
85
  refusalAnswer
86
- } from "./chunk-N26ADFMG.js";
86
+ } from "./chunk-WPOKSNPE.js";
87
87
  import {
88
88
  entitlementScope,
89
89
  requestSalt,
@@ -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,120}\b(?:answer|help|assist)\b/i.test(s) && /\b(?:questions? about|instead)\b/i.test(s)) out.push([i, end]);
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
  import "./chunk-7AXXR7GD.js";
5
5
  import "./chunk-TH5XGPD5.js";
6
6
  import "./chunk-W7J5SFXJ.js";
7
- import "./chunk-N26ADFMG.js";
7
+ import "./chunk-WPOKSNPE.js";
8
8
  import "./chunk-4NXH5ZI6.js";
9
9
  import "./chunk-VT7DR6NQ.js";
10
10
  import "./chunk-3FYJM7LH.js";
@@ -4,7 +4,7 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-6KYYWVRV.js";
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-N26ADFMG.js";
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-ISHJOTSR.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-TMCLLHHP.js")).handleSearch(env, ctx, inner, tier, key);
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 });
@@ -2,7 +2,7 @@ import {
2
2
  canonicalRefusal,
3
3
  exciseMisplacedPin,
4
4
  refusalAnswer
5
- } from "../../chunk-N26ADFMG.js";
5
+ } from "../../chunk-WPOKSNPE.js";
6
6
  import "../../chunk-3FYJM7LH.js";
7
7
  export {
8
8
  canonicalRefusal,
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.133",
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: first person + an answer/help verb
83
- * + a redirect marker (questions about / instead) in ONE sentence. */
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,120}\b(?:answer|help|assist)\b/i.test(s) && /\b(?:questions? about|instead)\b/i.test(s)) out.push([i, end]);
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
  }