@konneal/engine 0.2.98 → 0.2.99

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,7 +1,7 @@
1
1
  import {
2
2
  handleAsk
3
- } from "./chunk-BIX3SMC7.js";
4
- import "./chunk-A3ELAHKF.js";
3
+ } from "./chunk-2SWMTCVX.js";
4
+ import "./chunk-QNLFNEI4.js";
5
5
  import "./chunk-TXPWLKCI.js";
6
6
  import "./chunk-KNCRYAX3.js";
7
7
  import "./chunk-DTW4UW2E.js";
@@ -18,7 +18,7 @@ import {
18
18
  tableRetyped,
19
19
  toolNote,
20
20
  verdictNote
21
- } from "./chunk-A3ELAHKF.js";
21
+ } from "./chunk-QNLFNEI4.js";
22
22
  import {
23
23
  NO_CONTEXT,
24
24
  answerQuality,
@@ -2,7 +2,8 @@ import {
2
2
  embed,
3
3
  hasLane,
4
4
  portIndex,
5
- portModelRunner
5
+ portModelRunner,
6
+ portStore
6
7
  } from "./chunk-KNCRYAX3.js";
7
8
  import {
8
9
  standardKeysFrom
@@ -920,6 +921,140 @@ var bibEntry = {
920
921
  }
921
922
  }
922
923
  };
924
+ async function unitByTerm(store, term) {
925
+ const t = term.trim();
926
+ if (!t) return null;
927
+ const q = (where, bind) => store.prepare(`SELECT * FROM units_db WHERE ${where} LIMIT 1`).bind(...bind).all().catch(() => ({ results: [] }));
928
+ const exact = await q("code = ?1 OR short = ?1 OR LOWER(name_en) = LOWER(?1)", [t]);
929
+ let rows = exact.results ?? [];
930
+ if (rows.length) return rows[0];
931
+ const sym = await q("LOWER(json_extract(symbols, '$.ascii')) = LOWER(?1)", [t]);
932
+ rows = sym.results ?? [];
933
+ if (rows.length) return rows[0];
934
+ const like = await q("LOWER(short) LIKE LOWER(?1) OR LOWER(name_en) LIKE LOWER(?1)", [`%${t}%`]);
935
+ rows = like.results ?? [];
936
+ return rows[0] ?? null;
937
+ }
938
+ async function resolveWithPrefix(store, term) {
939
+ const direct = await unitByTerm(store, term);
940
+ if (direct) return { unit: direct, prefixFactor: 1, prefixName: null };
941
+ const t = term.trim();
942
+ for (let cut = 1; cut < Math.min(t.length, 3); cut++) {
943
+ const pSym = t.slice(0, cut);
944
+ const rest = t.slice(cut);
945
+ if (!rest) continue;
946
+ const pres = await store.prepare("SELECT id, name_en, symbol, base, power FROM unit_prefixes WHERE symbol = ?1 AND base IS NOT NULL AND power IS NOT NULL").bind(pSym).all().catch(() => ({ results: [] }));
947
+ const prefix = (pres.results ?? [])[0];
948
+ if (!prefix) continue;
949
+ const unit = await unitByTerm(store, rest);
950
+ if (unit) return { unit, prefixFactor: Math.pow(prefix.base, prefix.power), prefixName: prefix.name_en };
951
+ }
952
+ return null;
953
+ }
954
+ var unitsLookup = {
955
+ name: "units.lookup",
956
+ description: "Look up a measurement unit in the unitsdb plane: its names and symbols, its dimension, its quantity kinds, and its SI decomposition. Bind a symbol or an everyday unit name to the dataset's canonical unit before computing with it.",
957
+ params: [{ key: "term", required: true, description: "a unit's code, short name, symbol or plain name, e.g. m, Pa, pascal, meter per second" }],
958
+ audiences: ["mcp"],
959
+ handler: async (env, args) => {
960
+ const term = String(args?.term ?? "").trim();
961
+ if (term.length < 1) return null;
962
+ try {
963
+ const store = portStore(env);
964
+ const unit = await unitByTerm(store, term);
965
+ if (!unit) {
966
+ return { name: "units.lookup", query: term, output: `No unit matches "${term}" in the unitsdb plane. State this plainly.` };
967
+ }
968
+ const qtyNames = [];
969
+ for (const qid of JSON.parse(unit.quantity_ids || "[]")) {
970
+ const r = await store.prepare("SELECT name_en FROM unit_quantities WHERE id = ?1").bind(qid).all().catch(() => ({ results: [] }));
971
+ const n = (r.results ?? [])[0]?.name_en;
972
+ if (n) qtyNames.push(n);
973
+ }
974
+ const roots = JSON.parse(unit.root_units || "[]");
975
+ const rootNames = await Promise.all(
976
+ roots.map(async (r) => {
977
+ const row = await unitByTerm(store, r.code);
978
+ return `${row?.short ?? r.code}^${r.power}`;
979
+ })
980
+ );
981
+ const symbols = JSON.parse(unit.symbols || "null");
982
+ return {
983
+ name: "units.lookup",
984
+ query: term,
985
+ output: JSON.stringify({
986
+ code: unit.code,
987
+ name_en: unit.name_en,
988
+ name_fr: unit.name_fr,
989
+ symbol: symbols?.ascii ?? null,
990
+ si_root: !!unit.root,
991
+ unit_system: unit.unit_system,
992
+ dimension: unit.dimension_ascii,
993
+ quantities: qtyNames.slice(0, 4),
994
+ si_decomposition: rootNames,
995
+ scale: unit.scale
996
+ })
997
+ };
998
+ } catch {
999
+ return null;
1000
+ }
1001
+ }
1002
+ };
1003
+ var unitsConvert = {
1004
+ name: "units.convert",
1005
+ description: "Convert a value between two measurement units through the unitsdb plane. SI-coherent units convert exactly (prefix powers over the same dimension); a non-SI unit is stated honestly \u2014 the dataset defines a ratio scale for it, not a factor, and none is invented.",
1006
+ params: [
1007
+ { key: "value", required: true, description: "the numeric value to convert" },
1008
+ { key: "from_unit", required: true, description: "the source unit, e.g. kPa, km, m" },
1009
+ { key: "to_unit", required: true, description: "the target unit, e.g. Pa, m" }
1010
+ ],
1011
+ audiences: ["mcp"],
1012
+ handler: async (env, args) => {
1013
+ const value = Number(args?.value);
1014
+ const fromTerm = String(args?.from_unit ?? "").trim();
1015
+ const toTerm = String(args?.to_unit ?? "").trim();
1016
+ if (!Number.isFinite(value) || !fromTerm || !toTerm) return null;
1017
+ try {
1018
+ const store = portStore(env);
1019
+ const from = await resolveWithPrefix(store, fromTerm);
1020
+ const to = await resolveWithPrefix(store, toTerm);
1021
+ if (!from || !to) {
1022
+ const missing = !from ? fromTerm : toTerm;
1023
+ return { name: "units.convert", query: `${value} ${fromTerm} \u2192 ${toTerm}`, output: `No unit matches "${missing}" in the unitsdb plane. State this plainly.` };
1024
+ }
1025
+ if ((from.unit.dimension_ascii ?? "") !== (to.unit.dimension_ascii ?? "")) {
1026
+ return {
1027
+ name: "units.convert",
1028
+ query: `${value} ${fromTerm} \u2192 ${toTerm}`,
1029
+ output: `Not convertible: ${fromTerm} carries dimension ${from.unit.dimension_ascii ?? "unknown"} and ${toTerm} carries ${to.unit.dimension_ascii ?? "unknown"}. State this plainly.`
1030
+ };
1031
+ }
1032
+ const coherent = (u) => !!u.unit_system && u.unit_system.toLowerCase().startsWith("si");
1033
+ if (!coherent(from.unit) || !coherent(to.unit)) {
1034
+ const nonSi = !coherent(from.unit) ? fromTerm : toTerm;
1035
+ return {
1036
+ name: "units.convert",
1037
+ query: `${value} ${fromTerm} \u2192 ${toTerm}`,
1038
+ output: `The dataset defines no numeric factor for ${nonSi} (a non-SI unit carried on a ${from.unit.scale ?? to.unit.scale ?? "ratio"} scale) \u2014 no factor is invented. State this plainly; the caller may supply the factor itself.`
1039
+ };
1040
+ }
1041
+ const result = value * from.prefixFactor / to.prefixFactor;
1042
+ return {
1043
+ name: "units.convert",
1044
+ query: `${value} ${fromTerm} \u2192 ${toTerm}`,
1045
+ output: JSON.stringify({
1046
+ value,
1047
+ from: `${from.prefixName ? from.prefixName + " " : ""}${from.unit.name_en}`,
1048
+ to: `${to.prefixName ? to.prefixName + " " : ""}${to.unit.name_en}`,
1049
+ dimension: from.unit.dimension_ascii,
1050
+ result
1051
+ })
1052
+ };
1053
+ } catch {
1054
+ return null;
1055
+ }
1056
+ }
1057
+ };
923
1058
  var glossaryLookup = {
924
1059
  name: "glossary.lookup",
925
1060
  description: "Look up a defined term in the terminology datasets \u2014 the concept's definition and its defining publication. Bind everyday words to the defined term before interpreting a question.",
@@ -988,7 +1123,7 @@ var certificatesSearch = {
988
1123
  return { name: "certificates.search", query, output };
989
1124
  }
990
1125
  };
991
- var TOOLS_REGISTRY = [certificatesSearch, unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry];
1126
+ var TOOLS_REGISTRY = [certificatesSearch, unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry, unitsLookup, unitsConvert];
992
1127
  var TOOL_DECLARATION = [
993
1128
  "You may use one tool before answering, by writing a single line:",
994
1129
  ...TOOLS_REGISTRY.filter((t) => t.audiences.includes("agent")).map((t) => {
@@ -4,7 +4,7 @@ import {
4
4
  parseToolCall,
5
5
  runTool,
6
6
  toolNote
7
- } from "./chunk-A3ELAHKF.js";
7
+ } from "./chunk-QNLFNEI4.js";
8
8
  import "./chunk-KNCRYAX3.js";
9
9
  import "./chunk-U4ERFUOK.js";
10
10
  import "./chunk-BOAITSVV.js";
@@ -7,4 +7,6 @@ export declare const licensedSection: ToolSpec;
7
7
  export declare const verdictEvaluate: ToolSpec;
8
8
  export declare const conditionsCheck: ToolSpec;
9
9
  export declare const bibEntry: ToolSpec;
10
+ export declare const unitsLookup: ToolSpec;
11
+ export declare const unitsConvert: ToolSpec;
10
12
  export declare const glossaryLookup: ToolSpec;
@@ -4,12 +4,12 @@ import {
4
4
  handleMemories,
5
5
  scoreFaithfulness,
6
6
  scoreJudge
7
- } from "../../chunk-BIX3SMC7.js";
7
+ } from "../../chunk-2SWMTCVX.js";
8
8
  import {
9
9
  TOOLS_REGISTRY,
10
10
  bindModelNode,
11
11
  modelGroundingBlock
12
- } from "../../chunk-A3ELAHKF.js";
12
+ } from "../../chunk-QNLFNEI4.js";
13
13
  import {
14
14
  handleSearch
15
15
  } from "../../chunk-GY33RTEO.js";
@@ -990,13 +990,13 @@ async function callToolOnce(env, ctx, _req, tier, key, name, args, t0) {
990
990
  // stream:false forces the JSON lane (anon defaults to SSE)
991
991
  body: JSON.stringify({ ...args, stream: false })
992
992
  });
993
- const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-YHEXFX6V.js");
993
+ const { runTool, TOOLS_REGISTRY: TOOLS_REGISTRY2 } = await import("../../tools-ZNQY6ZMC.js");
994
994
  let payload;
995
995
  if (TOOLS_REGISTRY2.some((t) => t.name === name && t.audiences.includes("mcp"))) {
996
996
  const r = await runTool({ ...env, DB: env.DB }, { name, args }, "mcp");
997
997
  payload = r ? { tool: r.name, query: r.query, result: r.output } : { error: { message: `tool ${name} returned nothing for the given arguments` } };
998
998
  } else {
999
- const res = name === "ask" ? await (await import("../../ask-4G24T25V.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-EQAOPFCC.js")).handleSearch(env, ctx, inner, tier, key);
999
+ const res = name === "ask" ? await (await import("../../ask-W6NUC3MG.js")).handleAsk(env, ctx, inner, tier, key) : await (await import("../../search-EQAOPFCC.js")).handleSearch(env, ctx, inner, tier, key);
1000
1000
  payload = await res.json().catch(() => ({ error: { message: "tool transport failed", status: res.status } }));
1001
1001
  }
1002
1002
  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.98",
30
+ "version": "0.2.99",
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",
@@ -7,7 +7,7 @@
7
7
  // tool-selection quality degrades with menu size.
8
8
  import type { ToolSpec } from "./tools.ts";
9
9
  import { resolveBlocks } from "./refs.ts";
10
- import { portIndex, portModelRunner, hasLane } from "./env.ts";
10
+ import { portIndex, portModelRunner, hasLane, portStore } from "./env.ts";
11
11
  import { embed } from "./ai.ts";
12
12
  import { THRESHOLDS } from "./config.ts";
13
13
  import { standardKeysFrom } from "./requestScope.ts";
@@ -428,6 +428,178 @@ export const bibEntry: ToolSpec = {
428
428
  },
429
429
  };
430
430
 
431
+
432
+ // The unitsdb plane (the owner's 2026-10-05 direction): measurement
433
+ // units as machine-shaped data — the dataset's typed projection in D1
434
+ // (units_db / unit_quantities / unit_prefixes), served as tools agents
435
+ // compute with. Conversion is honest about its scope: SI-coherent
436
+ // units convert through prefix powers; the dataset defines no numeric
437
+ // factors for non-SI units (foot, pound) — a ratio scale is not a
438
+ // factor — and the tool says so instead of inventing one.
439
+
440
+ interface UnitRow {
441
+ code: string;
442
+ short: string | null;
443
+ name_en: string | null;
444
+ name_fr: string | null;
445
+ root: number;
446
+ symbols: string | null;
447
+ root_units: string | null;
448
+ dimension_id: string | null;
449
+ dimension_ascii: string | null;
450
+ quantity_ids: string | null;
451
+ unit_system: string | null;
452
+ scale: string | null;
453
+ }
454
+
455
+ async function unitByTerm(store: any, term: string): Promise<UnitRow | null> {
456
+ const t = term.trim();
457
+ if (!t) return null;
458
+ const q = (where: string, bind: unknown[]) =>
459
+ store.prepare(`SELECT * FROM units_db WHERE ${where} LIMIT 1`).bind(...bind).all().catch(() => ({ results: [] }));
460
+ const exact = await q("code = ?1 OR short = ?1 OR LOWER(name_en) = LOWER(?1)", [t]);
461
+ let rows = (exact.results ?? []) as UnitRow[];
462
+ if (rows.length) return rows[0]!;
463
+ const sym = await q("LOWER(json_extract(symbols, '$.ascii')) = LOWER(?1)", [t]);
464
+ rows = (sym.results ?? []) as UnitRow[];
465
+ if (rows.length) return rows[0]!;
466
+ const like = await q("LOWER(short) LIKE LOWER(?1) OR LOWER(name_en) LIKE LOWER(?1)", [`%${t}%`]);
467
+ rows = (like.results ?? []) as UnitRow[];
468
+ return rows[0] ?? null;
469
+ }
470
+
471
+ /** A prefixed input ("kPa", "km"): the first symbols name a prefix,
472
+ * the remainder a unit — the dataset does not enumerate prefixed
473
+ * variants, they are derived. Returns the factor the prefix carries. */
474
+ async function resolveWithPrefix(store: any, term: string): Promise<{ unit: UnitRow; prefixFactor: number; prefixName: string | null } | null> {
475
+ const direct = await unitByTerm(store, term);
476
+ if (direct) return { unit: direct, prefixFactor: 1, prefixName: null };
477
+ const t = term.trim();
478
+ for (let cut = 1; cut < Math.min(t.length, 3); cut++) {
479
+ const pSym = t.slice(0, cut);
480
+ const rest = t.slice(cut);
481
+ if (!rest) continue;
482
+ const pres = await store
483
+ .prepare("SELECT id, name_en, symbol, base, power FROM unit_prefixes WHERE symbol = ?1 AND base IS NOT NULL AND power IS NOT NULL")
484
+ .bind(pSym)
485
+ .all()
486
+ .catch(() => ({ results: [] }));
487
+ const prefix = (pres.results ?? [])[0] as { id: string; name_en: string | null; symbol: string; base: number; power: number } | undefined;
488
+ if (!prefix) continue;
489
+ const unit = await unitByTerm(store, rest);
490
+ if (unit) return { unit, prefixFactor: Math.pow(prefix.base, prefix.power), prefixName: prefix.name_en };
491
+ }
492
+ return null;
493
+ }
494
+
495
+ export const unitsLookup: ToolSpec = {
496
+ name: "units.lookup",
497
+ description:
498
+ "Look up a measurement unit in the unitsdb plane: its names and symbols, its dimension, its quantity kinds, and its SI decomposition. Bind a symbol or an everyday unit name to the dataset's canonical unit before computing with it.",
499
+ params: [{ key: "term", required: true, description: "a unit's code, short name, symbol or plain name, e.g. m, Pa, pascal, meter per second" }],
500
+ audiences: ["mcp"],
501
+ handler: async (env, args) => {
502
+ const term = String(args?.term ?? "").trim();
503
+ if (term.length < 1) return null;
504
+ try {
505
+ const store = portStore(env);
506
+ const unit = await unitByTerm(store, term);
507
+ if (!unit) {
508
+ return { name: "units.lookup", query: term, output: `No unit matches "${term}" in the unitsdb plane. State this plainly.` };
509
+ }
510
+ const qtyNames: string[] = [];
511
+ for (const qid of JSON.parse(unit.quantity_ids || "[]") as string[]) {
512
+ const r = await store.prepare("SELECT name_en FROM unit_quantities WHERE id = ?1").bind(qid).all().catch(() => ({ results: [] }));
513
+ const n = ((r.results ?? [])[0] as any)?.name_en;
514
+ if (n) qtyNames.push(n);
515
+ }
516
+ const roots: { code: string; power: number }[] = JSON.parse(unit.root_units || "[]");
517
+ const rootNames = await Promise.all(
518
+ roots.map(async (r) => {
519
+ const row = await unitByTerm(store, r.code);
520
+ return `${row?.short ?? r.code}^${r.power}`;
521
+ }),
522
+ );
523
+ const symbols = JSON.parse(unit.symbols || "null");
524
+ return {
525
+ name: "units.lookup",
526
+ query: term,
527
+ output: JSON.stringify({
528
+ code: unit.code,
529
+ name_en: unit.name_en,
530
+ name_fr: unit.name_fr,
531
+ symbol: symbols?.ascii ?? null,
532
+ si_root: !!unit.root,
533
+ unit_system: unit.unit_system,
534
+ dimension: unit.dimension_ascii,
535
+ quantities: qtyNames.slice(0, 4),
536
+ si_decomposition: rootNames,
537
+ scale: unit.scale,
538
+ }),
539
+ };
540
+ } catch {
541
+ return null;
542
+ }
543
+ },
544
+ };
545
+
546
+ export const unitsConvert: ToolSpec = {
547
+ name: "units.convert",
548
+ description:
549
+ "Convert a value between two measurement units through the unitsdb plane. SI-coherent units convert exactly (prefix powers over the same dimension); a non-SI unit is stated honestly — the dataset defines a ratio scale for it, not a factor, and none is invented.",
550
+ params: [
551
+ { key: "value", required: true, description: "the numeric value to convert" },
552
+ { key: "from_unit", required: true, description: "the source unit, e.g. kPa, km, m" },
553
+ { key: "to_unit", required: true, description: "the target unit, e.g. Pa, m" },
554
+ ],
555
+ audiences: ["mcp"],
556
+ handler: async (env, args) => {
557
+ const value = Number(args?.value);
558
+ const fromTerm = String(args?.from_unit ?? "").trim();
559
+ const toTerm = String(args?.to_unit ?? "").trim();
560
+ if (!Number.isFinite(value) || !fromTerm || !toTerm) return null;
561
+ try {
562
+ const store = portStore(env);
563
+ const from = await resolveWithPrefix(store, fromTerm);
564
+ const to = await resolveWithPrefix(store, toTerm);
565
+ if (!from || !to) {
566
+ const missing = !from ? fromTerm : toTerm;
567
+ return { name: "units.convert", query: `${value} ${fromTerm} → ${toTerm}`, output: `No unit matches "${missing}" in the unitsdb plane. State this plainly.` };
568
+ }
569
+ if ((from.unit.dimension_ascii ?? "") !== (to.unit.dimension_ascii ?? "")) {
570
+ return {
571
+ name: "units.convert",
572
+ query: `${value} ${fromTerm} → ${toTerm}`,
573
+ output: `Not convertible: ${fromTerm} carries dimension ${from.unit.dimension_ascii ?? "unknown"} and ${toTerm} carries ${to.unit.dimension_ascii ?? "unknown"}. State this plainly.`,
574
+ };
575
+ }
576
+ const coherent = (u: UnitRow) => !!u.unit_system && u.unit_system.toLowerCase().startsWith("si");
577
+ if (!coherent(from.unit) || !coherent(to.unit)) {
578
+ const nonSi = !coherent(from.unit) ? fromTerm : toTerm;
579
+ return {
580
+ name: "units.convert",
581
+ query: `${value} ${fromTerm} → ${toTerm}`,
582
+ output: `The dataset defines no numeric factor for ${nonSi} (a non-SI unit carried on a ${from.unit.scale ?? to.unit.scale ?? "ratio"} scale) — no factor is invented. State this plainly; the caller may supply the factor itself.`,
583
+ };
584
+ }
585
+ const result = (value * from.prefixFactor) / to.prefixFactor;
586
+ return {
587
+ name: "units.convert",
588
+ query: `${value} ${fromTerm} → ${toTerm}`,
589
+ output: JSON.stringify({
590
+ value,
591
+ from: `${from.prefixName ? from.prefixName + " " : ""}${from.unit.name_en}`,
592
+ to: `${to.prefixName ? to.prefixName + " " : ""}${to.unit.name_en}`,
593
+ dimension: from.unit.dimension_ascii,
594
+ result,
595
+ }),
596
+ };
597
+ } catch {
598
+ return null;
599
+ }
600
+ },
601
+ };
602
+
431
603
  export const glossaryLookup: ToolSpec = {
432
604
  name: "glossary.lookup",
433
605
  description:
@@ -64,9 +64,9 @@ const certificatesSearch: ToolSpec = {
64
64
  },
65
65
  };
66
66
 
67
- import { unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry } from "./tools-content.ts";
67
+ import { unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry, unitsLookup, unitsConvert } from "./tools-content.ts";
68
68
 
69
- export const TOOLS_REGISTRY: ToolSpec[] = [certificatesSearch, unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry];
69
+ export const TOOLS_REGISTRY: ToolSpec[] = [certificatesSearch, unitsGet, graphCites, docsSection, glossaryLookup, documentsFamily, licensedSection, verdictEvaluate, conditionsCheck, bibEntry, unitsLookup, unitsConvert];
70
70
 
71
71
  /** The agent loop's protocol declaration, GENERATED from the registry —
72
72
  * the model's tool vocabulary is always the registry's, never a