@polycode-projects/the-mechanical-code-talker 0.7.0 → 0.7.1
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/package.json +1 -1
- package/src/chat.mjs +20 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polycode-projects/the-mechanical-code-talker",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The Mechanical Code Talker (tmct) — a tolerant, offline, $0 chat surface that guides you toward precision queries about a software repository. ELIZA/PARRY-style but domain-obsessed with code. No model calls; no codebase index of its own.",
|
package/src/chat.mjs
CHANGED
|
@@ -1264,25 +1264,33 @@ async function curatedDefinitionAnswer(query, envelope, { memoryDir, lexicon })
|
|
|
1264
1264
|
* the graph parser reads as a count. Null when the line isn't such a touch. The
|
|
1265
1265
|
* concept force is gated further downstream (a KNOWN, instance-bearing concept), so
|
|
1266
1266
|
* this only has to recognize the SHAPE, not vet the term. */
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1267
|
+
/** The VAGUE-TOUCH shapes ("tell me about X", "[and] what about X") — a concept
|
|
1268
|
+
* touch that is NOT the "what is a X" / "what does X mean" META shape. The meta shape
|
|
1269
|
+
* has its own established handling (a noun definition, a predicate definition, or the
|
|
1270
|
+
* honest ambiguity surround for a term that is BOTH a noun and a predicate — e.g.
|
|
1271
|
+
* "imports"), which the RELATION force must never preempt (frozen case
|
|
1272
|
+
* am-meta-imports). Gated downstream by CONCEPT_CLASS / RELATION_TERM, so a real
|
|
1273
|
+
* entity name declines here. */
|
|
1274
|
+
function vagueTouchTermOf(query) {
|
|
1270
1275
|
const q = String(query).trim();
|
|
1271
1276
|
const m = q.match(/^tell me about\s+(?:an?\s+)?(.+?)[?.!\s]*$/i)
|
|
1272
|
-
// "[and/so/…] what about X" with no good discourse continuation — the concept
|
|
1273
|
-
// KIND word is a concept touch, not a bare module lookup (DEAD-END 4). Gated
|
|
1274
|
-
// downstream by CONCEPT_CLASS/RELATION_TERM, so a real entity name declines here.
|
|
1275
1277
|
|| q.match(/^(?:(?:and|so|but|ok|okay|now|then)\s+)*what about\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i);
|
|
1276
1278
|
return m ? m[1].trim() : null;
|
|
1277
1279
|
}
|
|
1278
1280
|
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1281
|
+
function conceptTermOf(query, envelope) {
|
|
1282
|
+
return metaTermOf(query, envelope) || vagueTouchTermOf(query);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/** The RELATION term a vague touch names — the VAGUE-touch shapes only ("tell me
|
|
1286
|
+
* about X", "what about X"), NOT the "what is a X"/"what does X mean" meta shape (a
|
|
1287
|
+
* relation term that is also a vocabulary word, like "imports", keeps its established
|
|
1288
|
+
* ambiguity/predicate-definition answer — frozen case am-meta-imports). Plus the
|
|
1289
|
+
* relation-only openers the graph parser reads as something else: "what are the
|
|
1290
|
+
* imports", "what calls are there", "what is calling". Null when the line isn't such a
|
|
1291
|
+
* touch. Gated downstream by RELATION_TERM, so this only has to recognize the SHAPE. */
|
|
1284
1292
|
function relationTermOf(query, envelope) {
|
|
1285
|
-
const base =
|
|
1293
|
+
const base = vagueTouchTermOf(query);
|
|
1286
1294
|
if (base) return base;
|
|
1287
1295
|
const q = String(query).trim().toLowerCase().replace(/[?.!]+$/, "").replace(/\s+/g, " ");
|
|
1288
1296
|
let m;
|