@polycode-projects/the-mechanical-code-talker 3.0.8 → 3.0.10
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
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.0.10",
|
|
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"
|
|
@@ -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" },
|