@polycode-projects/the-mechanical-code-talker 3.0.8 → 3.1.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/README.md +2 -2
- package/package.json +4 -3
- package/src/adapters/corpus/wikipedia-live.mjs +1 -1
- package/src/adapters/providers/graph-service.mjs +7 -2
- package/src/adapters/repository-interface.mjs +2 -2
- package/src/services/adventure-viz.mjs +6 -1
- package/src/services/chat-page-viz.mjs +3 -0
- package/src/services/code-explorer-viz.mjs +3 -0
- package/src/services/ingest-viz.mjs +3 -0
- package/src/services/ledger-viz.mjs +3 -0
- package/src/services/plan-viz.mjs +3 -0
- package/src/services/research-viz.mjs +3 -0
- package/src/services/spider-fly-viz.mjs +6 -1
- package/src/services/sprite-catalog-viz.mjs +6 -1
- package/src/surfaces/web/memory-ask-browser.bundle.js +30 -30
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ src/handlers/tasks.mjs and src/handlers/users.mjs.
|
|
|
142
142
|
tmct> /exit
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
**[Try it live in your browser →](https://polycode
|
|
145
|
+
**[Try it live in your browser →](https://tmct.polycode.co.uk/)**
|
|
146
146
|
runs the actual query engine client-side. No server, no install. The landing
|
|
147
147
|
page answers codebase questions live, and eight more pages each ground their
|
|
148
148
|
own domain: a full chat seeded with 32,646 facts (the same nine bands as
|
|
@@ -197,7 +197,7 @@ functions". Every suggestion resolves to a real answer.
|
|
|
197
197
|
|
|
198
198
|
The identical page also runs as a plain hosted page over the demo code
|
|
199
199
|
graph, with nothing to install:
|
|
200
|
-
**[try it live →](https://polycode
|
|
200
|
+
**[try it live →](https://tmct.polycode.co.uk/code.html)**.
|
|
201
201
|
The desktop build below is for exploring your own repo or graph, which the
|
|
202
202
|
hosted page cannot reach.
|
|
203
203
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polycode-projects/the-mechanical-code-talker",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.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.",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "MPL-2.0",
|
|
27
27
|
"author": "Polycode Limited",
|
|
28
|
-
"homepage": "https://polycode
|
|
28
|
+
"homepage": "https://tmct.polycode.co.uk/",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://gitlab.com/polycode-projects/the-mechanical-code-talker.git"
|
|
@@ -133,7 +133,8 @@
|
|
|
133
133
|
"example:polyglot": "node --disable-warning=ExperimentalWarning bin/tmct.mjs chat --repo examples/polyglot --ephemeral",
|
|
134
134
|
"chatbench:run": "node test-benchmarks/chatbench/run.mjs",
|
|
135
135
|
"chatbench:judge": "node test-benchmarks/chatbench/judge.mjs",
|
|
136
|
-
"chatbench:judge:cached": "node test-benchmarks/chatbench/judge.mjs --cache test-benchmarks/chatbench/verdict-cache.json",
|
|
136
|
+
"chatbench:judge:cached": "node test-benchmarks/chatbench/judge.mjs --cache test-benchmarks/chatbench/verdict-cache.json --promoted test-benchmarks/chatbench/promoted.json",
|
|
137
|
+
"chatbench:distill": "node test-benchmarks/chatbench/distill.mjs",
|
|
137
138
|
"agentbench:run": "node test-benchmarks/agentbench/run.mjs",
|
|
138
139
|
"infbench": "node test-benchmarks/infbench/generate-cases.mjs && node test-benchmarks/infbench/run.mjs",
|
|
139
140
|
"idxbench:run": "node test-benchmarks/idxbench/run.mjs",
|
|
@@ -34,7 +34,7 @@ export const SIMPLE_WIKIPEDIA_ORIGIN = "https://simple.wikipedia.org";
|
|
|
34
34
|
* refuse to override the User-Agent request header, so the API-recognised
|
|
35
35
|
* Api-User-Agent header carries the same string there; under Node both are
|
|
36
36
|
* sent. */
|
|
37
|
-
export const WIKIMEDIA_USER_AGENT = "the-mechanical-code-talker (+https://polycode
|
|
37
|
+
export const WIKIMEDIA_USER_AGENT = "the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";
|
|
38
38
|
|
|
39
39
|
const DEFAULT_TIMEOUT_MS = 4000;
|
|
40
40
|
const DEFAULT_MIN_INTERVAL_MS = 2000;
|
|
@@ -197,21 +197,26 @@ export function createGraphService(graph, { sourceAccess = false, repoRoot = nul
|
|
|
197
197
|
}
|
|
198
198
|
const seen = new Set([classId]);
|
|
199
199
|
const subs = [];
|
|
200
|
+
const levels = [];
|
|
200
201
|
let frontier = [classId];
|
|
201
202
|
for (let d = 0; d < 8 && frontier.length; d += 1) {
|
|
202
203
|
const next = [];
|
|
204
|
+
const level = [];
|
|
203
205
|
for (const cur of frontier) {
|
|
204
206
|
for (const childId of childrenOf.get(cur) || []) {
|
|
205
207
|
if (seen.has(childId)) continue;
|
|
206
208
|
seen.add(childId);
|
|
207
209
|
const c = byId.get(childId);
|
|
208
|
-
|
|
210
|
+
const proj = c ? toIndividual(c) : { id: childId, label: childId, class: "Class", attributes: [] };
|
|
211
|
+
subs.push(proj);
|
|
212
|
+
level.push(proj);
|
|
209
213
|
next.push(childId);
|
|
210
214
|
}
|
|
211
215
|
}
|
|
216
|
+
if (level.length) levels.push(level);
|
|
212
217
|
frontier = next;
|
|
213
218
|
}
|
|
214
|
-
return hit({ bases, subclasses: subs });
|
|
219
|
+
return hit({ bases, subclasses: subs, levels });
|
|
215
220
|
},
|
|
216
221
|
|
|
217
222
|
exports(moduleId) {
|
|
@@ -236,9 +236,9 @@ export const REPOSITORY_INTERFACE = Object.freeze({
|
|
|
236
236
|
},
|
|
237
237
|
subclasses: {
|
|
238
238
|
group: "resolution", args: { classId: "string" },
|
|
239
|
-
result: `{ bases: ${IND}[], subclasses: ${IND}[] }`,
|
|
239
|
+
result: `{ bases: ${IND}[], subclasses: ${IND}[], levels: Array<${IND}[]> }`,
|
|
240
240
|
misses: ["UNRESOLVED_TERM"], concurrency: CONCURRENT_SAFE,
|
|
241
|
-
purpose: "Forward bases + the transitive reverse inheritance closure (who extends this).",
|
|
241
|
+
purpose: "Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape.",
|
|
242
242
|
},
|
|
243
243
|
exports: {
|
|
244
244
|
group: "resolution", args: { moduleId: "string" },
|
|
@@ -508,7 +508,9 @@ export function roomCaptionText(rows, state, here) {
|
|
|
508
508
|
* the engine into the page instead of the sibling `<script src>`, for the
|
|
509
509
|
* CLI's standalone export — one downloadable file that runs from file://
|
|
510
510
|
* with no sibling assets. Default empty keeps the site build's sibling-file
|
|
511
|
-
* arrangement byte-identical
|
|
511
|
+
* arrangement byte-identical, favicon links included; the standalone export
|
|
512
|
+
* drops them too, since a relative ./favicon.svg would be a dangling
|
|
513
|
+
* external reference the "no sibling assets" export can't carry. */
|
|
512
514
|
export function renderAdventureHtml({
|
|
513
515
|
title = DEFAULT_TITLE,
|
|
514
516
|
worldPayload = { facts: [], rules: [], opening: "" },
|
|
@@ -530,6 +532,9 @@ export function renderAdventureHtml({
|
|
|
530
532
|
<meta charset="utf-8">
|
|
531
533
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
532
534
|
<title>${escapeHtml(title)}</title>
|
|
535
|
+
${engineBundleJs ? "" : `<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
536
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
537
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">`}
|
|
533
538
|
<style>
|
|
534
539
|
${THEME_TOKENS_CSS}
|
|
535
540
|
/* Murder-mystery board-game chrome — layered over the shared neutrals/
|
|
@@ -194,6 +194,9 @@ export function renderChatHtml({ title = DEFAULT_TITLE, digestStructures = [] }
|
|
|
194
194
|
<meta charset="utf-8">
|
|
195
195
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
196
196
|
<title>${escapeHtml(title)}</title>
|
|
197
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
198
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
199
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
197
200
|
<!--
|
|
198
201
|
The wink lemma/POS tier loads from ./vendor/wink.js — the site's own shared
|
|
199
202
|
first-party bundle of wink-nlp + wink-eng-lite-web-model (built by
|
|
@@ -354,6 +354,9 @@ export function renderCodeExplorerHtml(data, { bundleInline = "", bundleAvailabl
|
|
|
354
354
|
<meta charset="utf-8">
|
|
355
355
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
356
356
|
<title>tmct code explorer</title>
|
|
357
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
358
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
359
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
357
360
|
<style>
|
|
358
361
|
${THEME_TOKENS_CSS}
|
|
359
362
|
* { box-sizing: border-box; }
|
|
@@ -76,6 +76,9 @@ export function renderIngestHtml({ title = DEFAULT_TITLE } = {}) {
|
|
|
76
76
|
<meta charset="utf-8">
|
|
77
77
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
78
78
|
<title>${escapeHtml(title)}</title>
|
|
79
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
80
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
81
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
79
82
|
<!--
|
|
80
83
|
The wink lemma/POS tier loads from ./vendor/wink.js — the site's own shared
|
|
81
84
|
first-party bundle (built by scripts/build-wink-vendor.mjs), one cached copy
|
|
@@ -570,6 +570,9 @@ export function renderLedgerHtml({ rows, terms, edges, focus, contradictions, wo
|
|
|
570
570
|
<meta charset="utf-8">
|
|
571
571
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
572
572
|
<title>${escapeHtml(title)}</title>
|
|
573
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
574
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
575
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
573
576
|
<!--
|
|
574
577
|
The wink lemma/POS tier loads from ./vendor/wink.js — the site's own shared
|
|
575
578
|
first-party bundle of wink-nlp + wink-eng-lite-web-model (built by
|
|
@@ -293,6 +293,9 @@ export function renderPlanHtml({ plan, rendersAs = {}, sizeOrder = [], title } =
|
|
|
293
293
|
<meta charset="utf-8">
|
|
294
294
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
295
295
|
<title>${escapeHtml(pageTitle)}</title>
|
|
296
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
297
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
298
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
296
299
|
<!--
|
|
297
300
|
The wink lemma/POS tier loads from ./vendor/wink.js — the site's own shared
|
|
298
301
|
first-party bundle of wink-nlp + wink-eng-lite-web-model (built by
|
|
@@ -87,6 +87,9 @@ export function renderResearchHtml({ title = DEFAULT_TITLE, digestStructures = [
|
|
|
87
87
|
<meta charset="utf-8">
|
|
88
88
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
89
89
|
<title>${escapeHtml(title)}</title>
|
|
90
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
91
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
92
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
|
90
93
|
<!--
|
|
91
94
|
The wink lemma/POS tier loads from ./vendor/wink.js — the site's own shared
|
|
92
95
|
first-party bundle (built by scripts/build-wink-vendor.mjs), one cached copy
|
|
@@ -225,7 +225,9 @@ export function nextCorpses(prevCorpses, prevAgents, agents, turn, lingerTurns =
|
|
|
225
225
|
* the engine into the page instead of the sibling `<script src>`, for the
|
|
226
226
|
* CLI's standalone export — one downloadable file that runs from file://
|
|
227
227
|
* with no sibling assets. Default empty keeps the site build's sibling-file
|
|
228
|
-
* arrangement byte-identical
|
|
228
|
+
* arrangement byte-identical, favicon links included; the standalone export
|
|
229
|
+
* drops them too, since a relative ./favicon.svg would be a dangling
|
|
230
|
+
* external reference the "no sibling assets" export can't carry. */
|
|
229
231
|
export function renderSpiderFlyHtml({ title = DEFAULT_TITLE, spriteTemplates = [], engineBundleJs = "" } = {}) {
|
|
230
232
|
const gridData = embedJson({
|
|
231
233
|
gridSize: GRID_SIZE,
|
|
@@ -254,6 +256,9 @@ export function renderSpiderFlyHtml({ title = DEFAULT_TITLE, spriteTemplates = [
|
|
|
254
256
|
<meta charset="utf-8">
|
|
255
257
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
256
258
|
<title>${escapeHtml(title)}</title>
|
|
259
|
+
${engineBundleJs ? "" : `<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
260
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
261
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">`}
|
|
257
262
|
<style>
|
|
258
263
|
${THEME_TOKENS_CSS}
|
|
259
264
|
:root { --fly: #A6791F; }
|
|
@@ -464,7 +464,9 @@ function sectionHtml(group, entries) {
|
|
|
464
464
|
* same two template sets) and references the sibling
|
|
465
465
|
* ./sprites-browser.bundle.js scripts/build-demo-site.mjs builds alongside
|
|
466
466
|
* it. Left false, the page renders exactly as before — no dock, no bundle
|
|
467
|
-
* reference, nothing extra to 404
|
|
467
|
+
* reference, nothing extra to 404 — including the favicon links, since the
|
|
468
|
+
* CLI's standalone export (also `spritesBundleAvailable: false`) can't carry
|
|
469
|
+
* a dangling relative ./favicon.svg either. */
|
|
468
470
|
export function renderSpriteCatalogHtml({ title = DEFAULT_TITLE, iconTemplates = [], largeTemplates = [], factRows = [], spritesBundleAvailable = false } = {}) {
|
|
469
471
|
const entries = buildSpriteCatalogEntries({ iconTemplates, largeTemplates, factRows });
|
|
470
472
|
const totalSwatches = entries.reduce((n, e) => n + e.iconSwatches.length + e.largeSwatches.length, 0);
|
|
@@ -607,6 +609,9 @@ const SPRITE_CHAT = ${embedJson({ rows: dockRows })};
|
|
|
607
609
|
<meta charset="utf-8">
|
|
608
610
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
609
611
|
<title>${escapeHtml(title)}</title>
|
|
612
|
+
${spritesBundleAvailable ? `<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
613
|
+
<link rel="icon" href="./favicon.ico" sizes="any">
|
|
614
|
+
<link rel="apple-touch-icon" href="./apple-touch-icon.png">` : ""}
|
|
610
615
|
<style>
|
|
611
616
|
${THEME_TOKENS_CSS}
|
|
612
617
|
html { background: var(--bg); }
|