@polycode-projects/the-mechanical-code-talker 0.9.3 → 0.9.5
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/ask-vocab.mjs +1 -0
- package/src/chat.mjs +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polycode-projects/the-mechanical-code-talker",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
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/ask-vocab.mjs
CHANGED
|
@@ -380,6 +380,7 @@ export const FILLER_WORDS = Object.freeze([
|
|
|
380
380
|
"um", "uh", "erm", "so", "like", "yo", "hey", "bru", "bro", "fam", "mate",
|
|
381
381
|
"please", "could you", "can you", "would you", "tell me", "i wonder",
|
|
382
382
|
"just wondering", "quickly", "real quick", "kinda", "sorta",
|
|
383
|
+
"btw", "by the way",
|
|
383
384
|
]);
|
|
384
385
|
|
|
385
386
|
/** Deictic/pronoun terms that refer to a context entity rather than naming one
|
package/src/chat.mjs
CHANGED
|
@@ -2052,6 +2052,35 @@ function relationTermOf(query, envelope) {
|
|
|
2052
2052
|
return null;
|
|
2053
2053
|
}
|
|
2054
2054
|
|
|
2055
|
+
/** A closed "describe"-intent wrapper: "can you describe X for me", "could you
|
|
2056
|
+
* tell me about X", "tell me more about X" → attempt tmct_describe(X). Found
|
|
2057
|
+
* live (playtest sprint round 2, SKILL_PLAYTEST_SPRINT.md): a describe-intent
|
|
2058
|
+
* question wrapped in an ordinary polite request ("can you tell me more about
|
|
2059
|
+
* Controller") fell all the way to the generic wall despite naming a real,
|
|
2060
|
+
* just-listed entity — nothing recognized the wrapper at all. Same closed
|
|
2061
|
+
* lead-in-alternation discipline as GREETING_PREAMBLE_RE/THANKS_PREAMBLE_RE
|
|
2062
|
+
* (normalize.mjs). Deliberately used only as a LAST-RESORT lane (see its call
|
|
2063
|
+
* site below) — "tell me about X" is ALSO the relation/concept force's own
|
|
2064
|
+
* trigger phrase for enumerable concepts ("tell me about inheritance"), so
|
|
2065
|
+
* this must never run before those have had their chance. Trails an optional
|
|
2066
|
+
* "please" as well as "for me" (playtest sprint round 3): this lane reads the
|
|
2067
|
+
* RAW turn text, not normalize.mjs's FILLER_WORDS-stripped one, so "could you
|
|
2068
|
+
* tell me more about Router please" needs its own trailing-politeness strip. */
|
|
2069
|
+
const DESCRIBE_WRAPPER_RE =
|
|
2070
|
+
/^(?:(?:can|could|would)\s+you\s+(?:please\s+)?|please\s+)?(?:tell\s+me\s+(?:more\s+)?about|describe)\s+(.+?)(?:\s+for\s+me)?(?:\s+please)?\s*\??$/i;
|
|
2071
|
+
|
|
2072
|
+
async function describeWrapperAnswer(query, { config, source }) {
|
|
2073
|
+
const m = DESCRIBE_WRAPPER_RE.exec(String(query || "").trim());
|
|
2074
|
+
const term = m?.[1]?.trim();
|
|
2075
|
+
if (!term) return null;
|
|
2076
|
+
try {
|
|
2077
|
+
const text = await dispatchTool("tmct_describe", { symbol: term }, { config, source });
|
|
2078
|
+
return text ? { text } : null;
|
|
2079
|
+
} catch {
|
|
2080
|
+
return null; // unresolvable term — decline, the ordinary wall stands unchanged
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2055
2084
|
/** THE RELATION CONCEPT FORCE — compose the three-band answer (curated relation
|
|
2056
2085
|
* definition + real example EDGES + pre-validated follow-ups) for a vague touch on a
|
|
2057
2086
|
* relation/edge kind ("what about imports", "what are the calls", "tell me about
|
|
@@ -2369,6 +2398,20 @@ async function runAsk(query, { config, source, graph, focus, last, templates, me
|
|
|
2369
2398
|
const nudged = nudgeAnswer(query, newFocus);
|
|
2370
2399
|
if (nudged) { answer = nudged; via = "miss"; }
|
|
2371
2400
|
}
|
|
2401
|
+
// (4d) DESCRIBE-WRAPPER RESCUE (playtest sprint round 2, SKILL_PLAYTEST_SPRINT.md)
|
|
2402
|
+
// — "can you describe X for me" / "tell me more about X": a closed wrapper
|
|
2403
|
+
// around an ordinary polite request naming a symbol. Tried ONLY here, after
|
|
2404
|
+
// EVERY other lane (concept force, relation force, teach, author,
|
|
2405
|
+
// presupposition, capability nudges) has already declined — "tell me about
|
|
2406
|
+
// inheritance" must keep reaching the relation force's richer answer
|
|
2407
|
+
// unmolested (that regression is exactly why this ISN'T inside asBareCommand,
|
|
2408
|
+
// which runs first and would preempt every lane above). A last-resort rescue
|
|
2409
|
+
// for what would otherwise become the generic wall, never a competing route:
|
|
2410
|
+
// it only claims the turn if /describe actually resolves the captured term.
|
|
2411
|
+
if (miss && recordMiss && via === "composed") {
|
|
2412
|
+
const described = await describeWrapperAnswer(query, { config, source });
|
|
2413
|
+
if (described) { answer = described.text; via = "describe"; recordMiss = false; }
|
|
2414
|
+
}
|
|
2372
2415
|
// (5) #1 SHORT TAILORED MISS — replace ONLY the engine's full grammar cheat-sheet
|
|
2373
2416
|
// wall (WALL_MISS_RE). Receipt-bearing misses keep their specific wording.
|
|
2374
2417
|
// WALL KINDNESS (0.8.2 WS4 (a)): when the PREVIOUS turn's answer was already a
|