@polycode-projects/the-mechanical-code-talker 5.0.12 → 5.0.13

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
@@ -10,6 +10,82 @@
10
10
  > The [GitHub repo](https://github.com/polycode-public/the-mechanical-code-talker) is a
11
11
  > read-only mirror, synced hourly. Issues and merge requests go to GitLab.
12
12
 
13
+ ## 30-second quickstart
14
+
15
+ Install it:
16
+
17
+ ```bash skip=network
18
+ npm install @polycode-projects/the-mechanical-code-talker
19
+ ```
20
+
21
+ Teach it a fact, then ask about it. This is the whole public API for a
22
+ one-off library call:
23
+
24
+ ```js
25
+ import { runTurn } from "@polycode-projects/the-mechanical-code-talker";
26
+ import { mkdtemp, rm } from "node:fs/promises";
27
+ import { tmpdir } from "node:os";
28
+ import { join } from "node:path";
29
+
30
+ const memoryDir = await mkdtemp(join(tmpdir(), "tmct-quickstart-"));
31
+ await runTurn("a dog is an animal", { memoryDir });
32
+ const { answer } = await runTurn("what is a dog", { memoryDir });
33
+ console.log(answer);
34
+ await rm(memoryDir, { recursive: true, force: true });
35
+ ```
36
+
37
+ Cloned the repo instead? The same engine runs as a chat over stdin:
38
+
39
+ ```bash skip=repo-state
40
+ printf 'hi\n/exit\n' | node bin/tmct.mjs
41
+ ```
42
+
43
+ That greets you and exits 0. It's the project's own smoke test. (This one is
44
+ marked `skip=` so the README suite doesn't run it. It would seed `.tmct/` in
45
+ whatever directory it runs from, and every other example here runs from a
46
+ disposable temp dir instead of your clone.)
47
+
48
+ ## Architecture
49
+
50
+ Four layers, top to bottom. A **surface** (CLI, HTTP, TUI, or the browser)
51
+ takes input. A **service** (chat, plan, research, ledger, adventure) runs
52
+ the use case. **Domain** logic decides what's true and does no I/O of its
53
+ own. An **adapter** sits at the seam. It is the only layer that touches
54
+ disk, reading and writing the **graph store**, the OWL-labelled `.tmct/`
55
+ graph.
56
+
57
+ ![tmct architecture: surfaces call services, services call domain, adapters sit at the seam between domain and the graph store](docs/architecture.svg)
58
+
59
+ <details>
60
+ <summary>Mermaid source (GitLab and GitHub render this natively; npm does not, which is why the image above is the diagram of record)</summary>
61
+
62
+ ```mermaid
63
+ flowchart TB
64
+ subgraph Surfaces
65
+ CLI
66
+ HTTP
67
+ TUI
68
+ Web[Web browser]
69
+ end
70
+ subgraph Services
71
+ chat
72
+ plan
73
+ research
74
+ ledger
75
+ adventure
76
+ end
77
+ Domain["domain — pure logic<br/>router · planner · codegraph · completions"]
78
+ Adapters["adapters — the seam<br/>I/O · storage · providers"]
79
+ Store[(".tmct/ graph store<br/>SQLite or in-memory")]
80
+
81
+ Surfaces --> Services
82
+ Services --> Domain
83
+ Domain -.->|interface| Adapters
84
+ Adapters --> Store
85
+ ```
86
+
87
+ </details>
88
+
13
89
  `@polycode-projects/the-mechanical-code-talker`
14
90
 
15
91
  A pure-JS, **no-LLM**, offline, **$0** chatbot in the ELIZA/PARRY lineage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polycode-projects/the-mechanical-code-talker",
3
- "version": "5.0.12",
3
+ "version": "5.0.13",
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.",
@@ -638,7 +638,12 @@ const MUD_STYLE = `
638
638
  font-family: ${MONO_STACK}; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
639
639
  padding: .32rem .7rem; border: 1px solid var(--soil-mid); border-radius: 3px;
640
640
  background: rgba(255,255,255,.5); color: var(--mud-ink);
641
+ /* A select is as wide as its longest option, and a burrow's label can run
642
+ long enough on its own to force the whole page to scroll sideways on a
643
+ phone. */
644
+ min-width: 0; max-width: 100%;
641
645
  }
646
+ #scenarioSelect { flex: 1 1 9rem; }
642
647
  .deck-select:hover { border-color: var(--burrow-glow); }
643
648
  .deck-teach { display: flex; align-items: center; gap: .3rem; font-family: ${MONO_STACK}; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--soil-mid); cursor: pointer; }
644
649
  .deck-teach input[type="checkbox"] { accent-color: var(--burrow-glow); }