@polycode-projects/the-mechanical-code-talker 2.5.2 → 2.5.4
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/README.md +11 -7
- package/bin/tmct.mjs +7 -4
- package/corpus/LICENSES.json +7 -0
- package/corpus/reference/LICENSE-NOTICE +36 -0
- package/corpus/reference/README.md +19 -0
- package/corpus/reference/index.json.gz +0 -0
- package/corpus/reference/manifest.json +367 -0
- package/corpus/reference/shards/ref-00.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-01.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-02.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-03.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-04.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-05.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-06.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-07.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-08.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-09.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0a.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0b.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0c.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0d.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0e.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-0f.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-10.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-11.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-12.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-13.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-14.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-15.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-16.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-17.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-18.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-19.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1a.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1b.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1c.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1d.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1e.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-1f.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-20.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-21.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-22.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-23.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-24.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-25.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-26.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-27.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-28.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-29.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2a.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2b.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2c.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2d.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2e.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-2f.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-30.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-31.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-32.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-33.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-34.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-35.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-36.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-37.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-38.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-39.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3a.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3b.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3c.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3d.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3e.jsonl.gz +0 -0
- package/corpus/reference/shards/ref-3f.jsonl.gz +0 -0
- package/package.json +5 -1
- package/src/adapters/corpus/reference-pack.mjs +113 -0
- package/src/adapters/memory/core.mjs +104 -10
- package/src/domain/ask.mjs +66 -9
- package/src/domain/cli-verbs.mjs +3 -3
- package/src/domain/codegraph.mjs +6 -0
- package/src/domain/dialogue-acts.mjs +160 -0
- package/src/domain/interpret/normalize.mjs +14 -2
- package/src/domain/interpret/strategies/keywords.mjs +10 -1
- package/src/domain/memory/trust.mjs +12 -0
- package/src/domain/reference-pack.mjs +72 -0
- package/src/domain/skos-view.mjs +111 -0
- package/src/domain/syllogise.mjs +647 -56
- package/src/services/chat.mjs +937 -142
- package/src/services/index.mjs +4 -1
- package/src/surfaces/web/chat-browser-entry.mjs +87 -0
- package/src/surfaces/web/memory-ask-browser.bundle.js +1187 -85
- package/src/tools/definitions.mjs +13 -0
- package/src/tools/handlers/index.mjs +2 -0
- package/src/tools/handlers/tmct-related.mjs +30 -0
|
@@ -180,6 +180,19 @@ export const TOOL_DEFINITIONS = Object.freeze([
|
|
|
180
180
|
inputSchema: classArg("The class to walk the inheritance edges of."),
|
|
181
181
|
example: { class: "Field" },
|
|
182
182
|
},
|
|
183
|
+
{
|
|
184
|
+
name: "tmct_related",
|
|
185
|
+
tier: "cold",
|
|
186
|
+
summary: "A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: "object",
|
|
189
|
+
required: ["term"],
|
|
190
|
+
properties: {
|
|
191
|
+
term: { type: "string", description: "The term whose synonyms / related concepts you want." },
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
example: { term: "sofa" },
|
|
195
|
+
},
|
|
183
196
|
{
|
|
184
197
|
name: "tmct_architecture",
|
|
185
198
|
tier: "cold",
|
|
@@ -14,6 +14,7 @@ import { tmct_impact } from "./tmct-impact.mjs";
|
|
|
14
14
|
import { tmct_search } from "./tmct-search.mjs";
|
|
15
15
|
import { tmct_members } from "./tmct-members.mjs";
|
|
16
16
|
import { tmct_subclasses } from "./tmct-subclasses.mjs";
|
|
17
|
+
import { tmct_related } from "./tmct-related.mjs";
|
|
17
18
|
import { tmct_architecture } from "./tmct-architecture.mjs";
|
|
18
19
|
import { tmct_exports } from "./tmct-exports.mjs";
|
|
19
20
|
import { tmct_untested } from "./tmct-untested.mjs";
|
|
@@ -38,6 +39,7 @@ export const HANDLERS = Object.freeze({
|
|
|
38
39
|
tmct_search,
|
|
39
40
|
tmct_members,
|
|
40
41
|
tmct_subclasses,
|
|
42
|
+
tmct_related,
|
|
41
43
|
tmct_architecture,
|
|
42
44
|
tmct_exports,
|
|
43
45
|
tmct_untested,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// tmct_related — a term's synonyms (skos:altLabel) and related concepts (skos:related),
|
|
2
|
+
// served from the conversational-memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo
|
|
3
|
+
// facts through the derived SKOS concept view (src/domain/skos-view.mjs). A term the store
|
|
4
|
+
// holds no relation facts for misses honestly — never a guessed neighbour.
|
|
5
|
+
|
|
6
|
+
import { ToolError } from "../../adapters/config.mjs";
|
|
7
|
+
import { relatedForTerm } from "../../domain/skos-view.mjs";
|
|
8
|
+
import { memoryFactRows } from "../memory-fallthrough.mjs";
|
|
9
|
+
import { requiredArg } from "./kit.mjs";
|
|
10
|
+
|
|
11
|
+
export async function tmct_related(args, { config }) {
|
|
12
|
+
const term = requiredArg(args, "term");
|
|
13
|
+
const hit = relatedForTerm(await memoryFactRows(config), term);
|
|
14
|
+
if (!hit) {
|
|
15
|
+
throw new ToolError(
|
|
16
|
+
`no synonym or related facts for "${term}" in the memory graph. ` +
|
|
17
|
+
"This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).",
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const lines = [`${hit.prefLabel} [${hit.conceptId}]`];
|
|
21
|
+
if (hit.synonyms.length) lines.push(`synonyms (skos:altLabel): ${hit.synonyms.join(", ")}`);
|
|
22
|
+
if (hit.related.length) lines.push(`related (skos:related): ${hit.related.map((c) => c.prefLabel).join(", ")}`);
|
|
23
|
+
lines.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)");
|
|
24
|
+
return lines.join("\n");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The memory graph is this tool's only source — it answers with or without a
|
|
28
|
+
// code-map graph, so the shared code-graph load (which refuses an empty graph)
|
|
29
|
+
// must not gate it.
|
|
30
|
+
tmct_related.ownsGraphLoad = true;
|