@polycode-projects/the-mechanical-code-talker 3.1.4 → 3.2.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polycode-projects/the-mechanical-code-talker",
3
- "version": "3.1.4",
3
+ "version": "3.2.0",
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; indexes a repo on request (tmct index) or reads any producer's graph.",
@@ -128,6 +128,12 @@ export async function createSession({
128
128
  // already-resolved value; full precedence (this param > TMCT_MEMORY_BACKEND
129
129
  // env > tmct.toml > the sqlite default) resolved below.
130
130
  memoryBackend = null,
131
+ // The tool-name prefix a host's own follow-up hints should use in place of
132
+ // "tmct_" (e.g. seonix's own tool names) — threaded onto `config` below so
133
+ // dispatchTool's handlers (kit.mjs/tmct-search.mjs/tmct-members.mjs/
134
+ // tmct-context.mjs) render hints under the host's own names. Omitted (the
135
+ // default) preserves today's "tmct_" behavior exactly.
136
+ toolNamePrefix,
131
137
  } = {}) {
132
138
  // EPHEMERAL mode (--ephemeral, or TMCT_EPHEMERAL=1): read the target graph but
133
139
  // write NOTHING back into it. The shipped examples run this way so a demo never
@@ -193,6 +199,10 @@ export async function createSession({
193
199
  ({ config, toml } = await resolveRuntimeConfig({ argv, cwd, env, gitRoot }));
194
200
  }
195
201
  }
202
+ // Every `config` branch above ends up here — set once so every downstream
203
+ // hint-rendering call site (dispatchTool's handlers, via config.toolNamePrefix)
204
+ // sees the same value regardless of which branch built `config`.
205
+ config.toolNamePrefix = toolNamePrefix || "tmct_";
196
206
 
197
207
  // Every game's tuning knobs (spider-fly's mass economy, guess-the-number's
198
208
  // bounds, the shared plan lane's search-depth cap), resolved once per
@@ -465,11 +475,12 @@ export async function runChat({
465
475
  narrate = false,
466
476
  liveReference = false,
467
477
  memoryBackend = null,
478
+ toolNamePrefix,
468
479
  } = {}) {
469
480
  // createSession's first-run seed (~2-3s) produces ZERO output until it fully
470
481
  // resolves, which otherwise reads as `npm run chat` hanging with total silence.
471
482
  output.write("tmct — starting…\n");
472
- const session = await createSession({ repoPath, graphPaths, configPath, source, env, cwd, gitRoot, ephemeral, narrate, liveReference, memoryBackend });
483
+ const session = await createSession({ repoPath, graphPaths, configPath, source, env, cwd, gitRoot, ephemeral, narrate, liveReference, memoryBackend, toolNamePrefix });
473
484
 
474
485
  const dim = (s) => (env.NO_COLOR || !output.isTTY ? s : `\x1b[2m${s}\x1b[0m`);
475
486
  for (const line of session.bannerLines) output.write(dim(line) + "\n");