truemap-cli 0.1.0 → 0.3.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/kit/truemap.css CHANGED
@@ -1,41 +1,59 @@
1
- /* truemap page kit — shared by every page in .truemap/.
2
- To match the project's own look, edit only the tokens in the first two blocks. */
1
+ /* truemap page kit. truemap serves this file to every page in .truemap/ (assets/truemap.css).
2
+ To match a project's own look, put token overrides in .truemap/assets/theme.css – truemap appends it here. */
3
+
4
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
5
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
6
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
7
+ @font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/__truemap/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
8
+ @font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/__truemap/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
3
9
 
4
10
  :root {
5
- --tm-paper: #f6f7f5;
6
- --tm-sheet: #ffffff;
7
- --tm-wash: #eef0ed;
8
- --tm-ink: #1d2733;
9
- --tm-graphite: #5a6472;
10
- --tm-pencil: #8a929c;
11
- --tm-rule: #d8dcd7;
12
- --tm-rule-strong: #b9bfba;
13
- --tm-route: #2c5a8c; /* the key path; links */
14
- --tm-route-wash: #e6edf5;
15
- --tm-changed: #9c6c12;
16
- --tm-broken: #a23b2c;
17
- --tm-fine: #2f6b4f;
18
- --tm-radius: 4px;
19
- --tm-font: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
20
- --tm-code: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
11
+ --tm-paper: #f6f7f4; /* page background */
12
+ --tm-sheet: #ffffff; /* boxes on the map */
13
+ --tm-wash: #eef0ec; /* quiet fills */
14
+ --tm-ink: #17202b; /* titles */
15
+ --tm-text: #2a3441; /* body text */
16
+ --tm-graphite: #5b6573; /* secondary text */
17
+ --tm-pencil: #8a939e; /* paths, hints */
18
+ --tm-rule: #dde1db;
19
+ --tm-rule-strong: #c2c8c1;
20
+ --tm-route: #2453c4; /* the one emphasis: the key path, links, decisions */
21
+ --tm-route-ink: #1b3f96;
22
+ --tm-route-wash: #e9eefb;
23
+ --tm-action: #2453c4; /* filled buttons */
24
+ --tm-changed: #a2690a;
25
+ --tm-changed-wash: #fbf2e0;
26
+ --tm-broken: #b03a2e;
27
+ --tm-broken-wash: #fbeae7;
28
+ --tm-fine: #2c7550;
29
+ --tm-fine-wash: #e5f1e9;
30
+ --tm-radius: 6px;
31
+ --tm-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
32
+ --tm-code: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
21
33
  color-scheme: light dark;
22
34
  }
23
35
 
24
36
  @media (prefers-color-scheme: dark) {
25
37
  :root {
26
- --tm-paper: #14181d;
27
- --tm-sheet: #1a1f25;
28
- --tm-wash: #20262d;
29
- --tm-ink: #e3e6e9;
30
- --tm-graphite: #a2aab4;
31
- --tm-pencil: #77808b;
32
- --tm-rule: #2c333b;
33
- --tm-rule-strong: #414a54;
34
- --tm-route: #8db0dc;
35
- --tm-route-wash: #1f2d3d;
36
- --tm-changed: #d4a24a;
37
- --tm-broken: #e07a66;
38
- --tm-fine: #74b894;
38
+ --tm-paper: #121519;
39
+ --tm-sheet: #191d23;
40
+ --tm-wash: #1f242b;
41
+ --tm-ink: #edf0f3;
42
+ --tm-text: #d0d6dd;
43
+ --tm-graphite: #9ba4af;
44
+ --tm-pencil: #707a86;
45
+ --tm-rule: #2a3039;
46
+ --tm-rule-strong: #3d4651;
47
+ --tm-route: #7ea3ff;
48
+ --tm-route-ink: #a9c0ff;
49
+ --tm-route-wash: #1b2440;
50
+ --tm-action: #3a66d6;
51
+ --tm-changed: #d9a54a;
52
+ --tm-changed-wash: #2c2414;
53
+ --tm-broken: #ec8170;
54
+ --tm-broken-wash: #321b18;
55
+ --tm-fine: #73bd95;
56
+ --tm-fine-wash: #16271e;
39
57
  }
40
58
  }
41
59
 
@@ -44,187 +62,231 @@
44
62
  html { -webkit-text-size-adjust: 100%; }
45
63
  body {
46
64
  margin: 0;
65
+ overflow-x: clip;
47
66
  background: var(--tm-paper);
48
- color: var(--tm-ink);
49
- font: 16px/1.6 var(--tm-font);
67
+ color: var(--tm-text);
68
+ font: 16px/1.62 var(--tm-font);
69
+ font-feature-settings: "kern", "liga";
50
70
  -webkit-font-smoothing: antialiased;
51
71
  text-rendering: optimizeLegibility;
52
72
  }
53
73
  img, svg, video, canvas { max-width: 100%; }
54
74
  p, li, td, th, h1, h2, h3, h4, dd { overflow-wrap: anywhere; }
55
- p { margin: 0 0 1em; max-width: 70ch; }
56
- a { color: var(--tm-route); text-decoration-thickness: 1px; text-underline-offset: 3px; }
57
- a:hover { text-decoration-thickness: 2px; }
75
+ p { margin: 0 0 1em; max-width: 68ch; }
76
+ strong, b { color: var(--tm-ink); font-weight: 600; }
77
+ a { color: var(--tm-route); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--tm-route) 40%, transparent); }
78
+ a:hover { text-decoration-color: var(--tm-route); }
58
79
  :focus-visible { outline: 2px solid var(--tm-route); outline-offset: 2px; }
59
- ::selection { background: var(--tm-route-wash); }
60
-
61
- .tm-page { max-width: 1040px; margin: 0 auto; padding: 56px 32px 112px; }
62
- .tm-page.is-wide { max-width: 1320px; }
63
-
64
- /* ---------- page head ---------- */
65
- .tm-header { margin-bottom: 48px; }
66
- .tm-crumb, .tm-eyebrow { display: block; font-size: 14px; color: var(--tm-graphite); margin-bottom: 10px; }
67
- .tm-crumb a, .tm-eyebrow a { color: inherit; }
68
- .tm-title { font-size: clamp(30px, 4.2vw, 40px); line-height: 1.12; letter-spacing: -.018em; font-weight: 650; margin: 0 0 14px; max-width: 24ch; }
69
- .tm-lede { font-size: 19px; line-height: 1.55; color: var(--tm-graphite); margin: 0; max-width: 60ch; }
70
-
71
- /* ---------- sections ---------- */
72
- .tm-section { margin: 56px 0; }
73
- .tm-section > h2, .tm-h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.01em; font-weight: 640; margin: 0 0 8px; }
74
- .tm-section > h2 + p, .tm-sub { color: var(--tm-graphite); margin-bottom: 20px; }
75
- h3 { font-size: 17px; line-height: 1.35; font-weight: 640; margin: 0 0 6px; }
80
+ ::selection { background: var(--tm-route-wash); color: var(--tm-ink); }
81
+ h1, h2, h3, h4 { color: var(--tm-ink); font-weight: 600; text-wrap: balance; }
82
+ ul, ol { padding-left: 1.3em; max-width: 68ch; }
83
+ li { margin: 0.2em 0; }
84
+ li::marker { color: var(--tm-pencil); }
85
+ hr { border: 0; border-top: 1px solid var(--tm-rule); margin: 40px 0; }
86
+
87
+ /* ---------- page ---------- */
88
+ .tm-page { max-width: 960px; margin: 0 auto; padding: 48px 48px 112px; }
89
+ .tm-header { margin-bottom: 8px; }
90
+ .tm-crumb, .tm-eyebrow { font-size: 13.5px; color: var(--tm-graphite); margin: 0 0 14px; }
91
+ .tm-crumb a { color: var(--tm-graphite); text-decoration-color: var(--tm-rule-strong); }
92
+ .tm-crumb a:hover { color: var(--tm-route); }
93
+ .tm-title { font-size: 36px; line-height: 1.15; letter-spacing: -0.018em; margin: 0 0 14px; max-width: 22ch; }
94
+ .tm-lede { font-size: 18.5px; line-height: 1.55; color: var(--tm-graphite); margin: 0; max-width: 60ch; }
95
+ .tm-lede strong { color: var(--tm-text); font-weight: 500; }
96
+
97
+ .tm-section { margin-top: 64px; }
98
+ .tm-section > h2, .tm-h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; }
99
+ .tm-section > h2 + p { color: var(--tm-graphite); }
100
+ .tm-section h3 { font-size: 16.5px; line-height: 1.35; margin: 32px 0 8px; }
101
+ .tm-section > :last-child { margin-bottom: 0; }
76
102
  .tm-muted { color: var(--tm-graphite); }
77
- .tm-faint { color: var(--tm-pencil); }
78
- .tm-small { font-size: 14px; }
79
- .tm-stack > * + * { margin-top: 12px; }
80
-
81
- /* ---------- layout ---------- */
82
- .tm-grid { display: grid; gap: 20px 28px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
83
- .tm-grid-2 { display: grid; gap: 20px 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
84
- .tm-grid-3 { display: grid; gap: 20px 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
85
- @media (max-width: 760px) { .tm-grid-2, .tm-grid-3 { grid-template-columns: minmax(0, 1fr); } }
86
- .tm-grid > *, .tm-grid-2 > *, .tm-grid-3 > * { min-width: 0; }
87
-
88
- /* A panel is for content that belongs together, not a wrapper for every paragraph. */
89
- .tm-card { background: var(--tm-sheet); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 18px 20px; }
90
- .tm-card > :last-child { margin-bottom: 0; }
91
- .tm-card.is-key { border-color: var(--tm-route); }
103
+ .tm-small { font-size: 13.5px; }
92
104
 
93
- /* ---------- blueprint: layered structure ---------- */
94
- .tm-blueprint { display: grid; gap: 0; border-top: 1px solid var(--tm-rule); }
95
- .tm-layer { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--tm-rule); }
96
- .tm-layer-label { font-size: 14px; color: var(--tm-graphite); padding-top: 11px; }
97
- .tm-layer-nodes { display: flex; flex-wrap: wrap; gap: 12px; }
98
- @media (max-width: 640px) { .tm-layer { grid-template-columns: minmax(0, 1fr); gap: 8px; } .tm-layer-label { padding-top: 0; } }
105
+ /* ---------- the map (blueprint) ---------- */
106
+ /* Rows are layers; boxes are real code. truemap draws the wires from data-to="id id". */
107
+ /* A map never wraps or stacks: when it is wider than the page it scrolls sideways, wires and all. */
108
+ /* The map may run wider than the text column, up to the right edge of the window. */
109
+ .tm-map, .tm-blueprint {
110
+ position: relative; margin: 20px 0 0; overflow-x: auto; overflow-y: hidden; padding: 10px 8px 14px 2px; scrollbar-width: thin;
111
+ width: 100%;
112
+ }
113
+ /* --tm-vw is the usable window width (without the scrollbar), set by truemap. */
114
+ html[style*="--tm-vw"] .tm-map, html[style*="--tm-vw"] .tm-blueprint { width: calc(var(--tm-vw) - max(48px, (var(--tm-vw) - 960px) / 2 + 48px) - 16px); min-width: 100%; }
115
+ .tm-map.tm-scrolls { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
116
+ .tm-layer { position: relative; display: grid; grid-template-columns: var(--tm-label-w, 112px) minmax(0, 1fr); gap: 20px; align-items: start; }
117
+ .tm-layer + .tm-layer { margin-top: 44px; }
118
+ .tm-layer-label { font-size: 13px; color: var(--tm-pencil); padding-top: 12px; line-height: 1.35; }
119
+ .tm-layer-nodes { display: flex; flex-wrap: nowrap; gap: 18px 26px; }
120
+ /* Boxes shrink to 168px before the map has to scroll. */
121
+ .tm-layer-nodes > .tm-node { flex: 0 1 var(--tm-node-w, 216px); min-width: var(--tm-node-min, 168px); max-width: none; }
122
+ .tm-map > .tm-layer-nodes { margin-left: 132px; }
99
123
 
100
- /* ---------- nodes: modules, services, steps ---------- */
101
124
  .tm-node, .tm-step {
102
- position: relative; display: flex; flex-direction: column; gap: 3px;
103
- min-width: 160px; flex: 1 1 160px; max-width: 300px;
104
- padding: 11px 14px 12px; border-radius: var(--tm-radius);
105
- background: var(--tm-sheet); border: 1px solid var(--tm-rule-strong);
106
- color: inherit; text-decoration: none;
125
+ position: relative; z-index: 1;
126
+ display: flex; flex-direction: column; flex: 0 1 216px; min-width: 156px; max-width: 280px;
127
+ padding: 11px 26px 12px 14px;
128
+ background: var(--tm-sheet); color: var(--tm-text);
129
+ border: 1px solid var(--tm-rule-strong); border-radius: var(--tm-radius);
130
+ text-decoration: none; line-height: 1.4;
131
+ transition: border-color 120ms ease, box-shadow 120ms ease;
132
+ }
133
+ a.tm-node:hover, a.tm-step:hover { border-color: var(--tm-graphite); }
134
+ .tm-node-title, .tm-step > b, .tm-step > strong { font-size: 15px; font-weight: 600; color: var(--tm-ink); }
135
+ .tm-node-sub { font-family: var(--tm-code); font-size: 12px; color: var(--tm-pencil); margin-top: 2px; overflow-wrap: break-word; }
136
+ .tm-node-desc { font-size: 13.5px; line-height: 1.45; color: var(--tm-graphite); margin-top: 7px; }
137
+
138
+ /* The survey mark: a box pinned to real code (data-src) carries a small triangle. */
139
+ .tm-node[data-src]::after, .tm-step[data-src]::after, .tm-card[data-src]::after {
140
+ content: ""; position: absolute; top: 11px; right: 11px; width: 8px; height: 7px;
141
+ background: var(--tm-pencil); clip-path: polygon(50% 0, 100% 100%, 0 100%);
107
142
  }
108
- .tm-node-title { font-weight: 620; font-size: 15px; line-height: 1.3; }
109
- .tm-node-sub { font: 12.5px/1.4 var(--tm-code); color: var(--tm-pencil); overflow-wrap: anywhere; }
110
- .tm-node-desc { font-size: 14px; line-height: 1.45; color: var(--tm-graphite); margin-top: 3px; }
111
- a.tm-node:hover .tm-node-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
112
- .tm-node.is-key, .tm-step.is-key { border: 1.5px solid var(--tm-route); }
143
+ .tm-node.is-key, .tm-step.is-key { border-color: var(--tm-route); box-shadow: inset 0 0 0 1px var(--tm-route); }
144
+ .tm-node.is-key .tm-node-title, .tm-step.is-key > b, .tm-step.is-key > strong { color: var(--tm-route-ink); }
145
+ .tm-node.is-key::after, .tm-step.is-key::after { background: var(--tm-route); }
146
+ .tm-node.is-ext, .tm-step.is-ext { background: transparent; border-style: dashed; }
147
+ .tm-node.is-ext .tm-node-title, .tm-step.is-ext > b { color: var(--tm-graphite); font-weight: 500; }
113
148
  .tm-node.is-new, .tm-step.is-new { border-color: var(--tm-fine); }
114
149
  .tm-node.is-risk, .tm-step.is-risk { border-color: var(--tm-changed); }
115
- .tm-node.is-ext, .tm-step.is-ext { border-style: dashed; background: transparent; }
116
150
 
117
- /* The pin: anything anchored to code carries a small corner mark. This is truemap's signature. */
118
- .tm-node[data-src], .tm-step[data-src], .tm-card[data-src] {
119
- background-image: linear-gradient(225deg, var(--tm-route) 0 6px, transparent 6px);
120
- background-repeat: no-repeat;
121
- }
151
+ /* Wires (drawn by truemap into svg.tm-wires) */
152
+ .tm-wires { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; overflow: visible; z-index: 0; }
153
+ .tm-wire { fill: none; stroke: var(--tm-rule-strong); stroke-width: 1.5; }
154
+ .tm-wire.is-key { stroke: var(--tm-route); stroke-width: 2; }
155
+ .tm-wire.is-ext { stroke-dasharray: 4 4; }
156
+ .tm-wire-head { fill: var(--tm-rule-strong); }
157
+ .tm-wire-head.is-key { fill: var(--tm-route); }
158
+ .tm-wire-label { font: 500 11.5px var(--tm-font); fill: var(--tm-graphite); paint-order: stroke; stroke: var(--tm-paper); stroke-width: 4px; stroke-linejoin: round; }
159
+
160
+ /* Legend under a map */
161
+ .tm-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 0 132px; font-size: 13px; color: var(--tm-graphite); }
162
+ .tm-legend span { display: inline-flex; align-items: center; gap: 8px; }
163
+ .tm-legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--tm-route); }
164
+ .tm-legend i.is-wire { border-top: 1.5px solid var(--tm-rule-strong); }
165
+ .tm-legend i.is-ext { border-top: 1.5px dashed var(--tm-rule-strong); }
166
+ .tm-legend i.is-mark { width: 8px; height: 7px; border: 0; background: var(--tm-pencil); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
122
167
 
123
- /* ---------- flows (a real sequence: step, then step) ---------- */
124
- .tm-flow { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 14px; }
125
- .tm-flow > .tm-node, .tm-flow > .tm-step { flex: 1 1 150px; max-width: none; }
126
- .tm-flow > * + * { margin-left: 32px; }
127
- .tm-flow > * + *::before { content: ""; position: absolute; left: -26px; top: 50%; width: 19px; height: 1px; background: var(--tm-graphite); }
128
- .tm-flow > * + *::after {
129
- content: ""; position: absolute; left: -9px; top: calc(50% - 4px);
130
- border: 4px solid transparent; border-left: 6px solid var(--tm-graphite); border-right: 0;
168
+ /* ---------- flow: a real sequence ---------- */
169
+ .tm-flow { display: flex; align-items: stretch; gap: 30px; margin: 24px 0 8px; overflow-x: auto; padding: 2px 2px 6px; }
170
+ .tm-flow > .tm-step { flex: 1 1 0; min-width: auto; max-width: none; }
171
+ .tm-flow > .tm-step > * { min-width: 132px; }
172
+ .tm-flow > .tm-step + .tm-step::before {
173
+ content: ""; position: absolute; left: -26px; top: 50%; width: 21px; height: 0;
174
+ border-top: 1.5px solid var(--tm-rule-strong);
131
175
  }
132
- .tm-flow.is-vertical { flex-direction: column; }
133
- .tm-flow.is-vertical > * { flex: none; }
134
- .tm-flow.is-vertical > * + * { margin: 24px 0 0; }
135
- .tm-flow.is-vertical > * + *::before { left: 28px; top: -20px; width: 1px; height: 14px; }
136
- .tm-flow.is-vertical > * + *::after { left: 24px; top: -9px; border: 4px solid transparent; border-top: 6px solid var(--tm-graphite); border-bottom: 0; }
137
- @media (max-width: 640px) {
138
- .tm-flow { flex-direction: column; }
139
- .tm-flow > *, .tm-flow > .tm-node, .tm-flow > .tm-step { flex: none; }
140
- .tm-flow > * + * { margin: 24px 0 0; }
141
- .tm-flow > * + *::before { left: 28px; top: -20px; width: 1px; height: 14px; }
142
- .tm-flow > * + *::after { left: 24px; top: -9px; border: 4px solid transparent; border-top: 6px solid var(--tm-graphite); border-bottom: 0; }
176
+ .tm-flow > .tm-step + .tm-step > :first-child::before {
177
+ content: ""; position: absolute; left: -8px; top: calc(50% - 4px); border: 4px solid transparent; border-left: 5px solid var(--tm-rule-strong); border-right: 0;
143
178
  }
179
+ .tm-flow > .tm-step.is-key + .tm-step.is-key::before { border-top: 2px solid var(--tm-route); }
180
+ .tm-flow > .tm-step.is-key + .tm-step.is-key > :first-child::before { border-left-color: var(--tm-route); }
181
+ .tm-flow.is-vertical { flex-direction: column; gap: 26px; max-width: 420px; overflow: visible; }
182
+ .tm-flow.is-vertical > .tm-step { flex: none; }
183
+ .tm-flow.is-vertical > .tm-step + .tm-step::before { left: 50%; top: -22px; width: 0; height: 18px; border-top: 0; border-left: 1.5px solid var(--tm-rule-strong); }
184
+ .tm-flow.is-vertical > .tm-step + .tm-step > :first-child::before { left: calc(50% - 4px); top: -8px; border: 4px solid transparent; border-top: 5px solid var(--tm-rule-strong); border-bottom: 0; }
144
185
 
145
- /* ---------- inline SVG diagrams ---------- */
146
- .tm-svg { display: block; width: 100%; height: auto; color: var(--tm-ink); font-family: var(--tm-font); }
147
- .tm-svg text { fill: currentColor; font-size: 13px; }
148
- .tm-svg .tm-box { fill: var(--tm-sheet); stroke: var(--tm-rule-strong); stroke-width: 1; }
149
- .tm-svg .tm-box.is-key { stroke: var(--tm-route); stroke-width: 1.6; }
150
- .tm-svg .tm-edge { fill: none; stroke: var(--tm-graphite); stroke-width: 1.2; }
151
- .tm-svg .tm-edge.is-key { stroke: var(--tm-route); stroke-width: 1.6; }
152
- .tm-svg .tm-label { fill: var(--tm-graphite); font-size: 12px; }
153
- .tm-figure { margin: 0; }
154
- .tm-figure figcaption { margin-top: 10px; font-size: 14px; color: var(--tm-graphite); max-width: 70ch; }
155
-
156
- /* ---------- page index (on the blueprint) ---------- */
157
- .tm-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); border-top: 1px solid var(--tm-rule); column-gap: 32px; }
158
- .tm-link { display: block; padding: 14px 0; border-bottom: 1px solid var(--tm-rule); text-decoration: none; color: inherit; }
159
- .tm-link strong { display: block; font-weight: 620; color: var(--tm-route); }
160
- .tm-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
161
- .tm-link span { display: block; margin-top: 2px; font-size: 14px; color: var(--tm-graphite); }
162
-
163
- /* ---------- tags, code ---------- */
164
- .tm-badge {
165
- display: inline-block; padding: 0 6px; border-radius: 3px; vertical-align: 1px;
166
- font-size: 12.5px; line-height: 20px; font-weight: 560; color: var(--tm-graphite); background: var(--tm-wash);
167
- }
168
- .tm-badge.is-accent { color: var(--tm-route); background: var(--tm-route-wash); }
169
- .tm-badge.is-ok { color: var(--tm-fine); background: color-mix(in srgb, var(--tm-fine) 12%, transparent); }
170
- .tm-badge.is-warn { color: var(--tm-changed); background: color-mix(in srgb, var(--tm-changed) 13%, transparent); }
171
- .tm-badge.is-bad { color: var(--tm-broken); background: color-mix(in srgb, var(--tm-broken) 11%, transparent); }
172
- .tm-path, code { font-family: var(--tm-code); font-size: .88em; padding: 1px 4px; border-radius: 3px; background: var(--tm-wash); overflow-wrap: anywhere; }
173
- pre { margin: 14px 0; padding: 14px 16px; overflow: auto; border-radius: var(--tm-radius); font: 13.5px/1.6 var(--tm-code); background: var(--tm-wash); }
174
- pre code { padding: 0; background: none; font-size: inherit; }
175
-
176
- /* ---------- notes (risk, decision, fact) ---------- */
177
- .tm-callout { margin: 16px 0; padding: 14px 16px; border-radius: var(--tm-radius); background: var(--tm-sheet); border: 1px solid var(--tm-rule); max-width: 76ch; }
178
- .tm-callout > :first-child { margin-top: 0; } .tm-callout > :last-child { margin-bottom: 0; }
186
+ /* ---------- panels ---------- */
187
+ .tm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; }
188
+ .tm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
189
+ .tm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
190
+ .tm-card { position: relative; background: var(--tm-sheet); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 18px 20px; min-width: 0; }
191
+ .tm-card > h3 { margin: 0 0 6px; font-size: 15.5px; }
192
+ .tm-card > p { color: var(--tm-graphite); font-size: 14.5px; }
193
+ .tm-card > :last-child { margin-bottom: 0; }
194
+
195
+ .tm-callout { margin: 22px 0; padding: 14px 18px; border-radius: var(--tm-radius); background: var(--tm-wash); color: var(--tm-text); max-width: 72ch; }
196
+ .tm-callout > :last-child { margin-bottom: 0; }
179
197
  .tm-callout > b:first-child, .tm-callout > strong:first-child { color: var(--tm-ink); }
180
- .tm-callout.is-accent { border-color: color-mix(in srgb, var(--tm-route) 40%, var(--tm-rule)); }
181
- .tm-callout.is-accent > b:first-child, .tm-callout.is-accent > strong:first-child { color: var(--tm-route); }
198
+ .tm-callout.is-accent { background: var(--tm-route-wash); }
199
+ .tm-callout.is-accent > b:first-child, .tm-callout.is-accent > strong:first-child { color: var(--tm-route-ink); }
200
+ .tm-callout.is-ok { background: var(--tm-fine-wash); }
182
201
  .tm-callout.is-ok > b:first-child, .tm-callout.is-ok > strong:first-child { color: var(--tm-fine); }
183
- .tm-callout.is-warn { border-color: color-mix(in srgb, var(--tm-changed) 40%, var(--tm-rule)); }
202
+ .tm-callout.is-warn { background: var(--tm-changed-wash); }
184
203
  .tm-callout.is-warn > b:first-child, .tm-callout.is-warn > strong:first-child { color: var(--tm-changed); }
185
- .tm-callout.is-bad { border-color: color-mix(in srgb, var(--tm-broken) 40%, var(--tm-rule)); }
204
+ .tm-callout.is-bad { background: var(--tm-broken-wash); }
186
205
  .tm-callout.is-bad > b:first-child, .tm-callout.is-bad > strong:first-child { color: var(--tm-broken); }
187
206
 
188
- /* ---------- tables & key-values ---------- */
189
- .tm-table-wrap { overflow-x: auto; }
190
- .tm-table { width: 100%; border-collapse: collapse; font-size: 15px; border-top: 1px solid var(--tm-rule-strong); }
191
- .tm-table th, .tm-table td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--tm-rule); }
192
- .tm-table th { font-size: 14px; font-weight: 600; color: var(--tm-graphite); }
193
- .tm-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
194
- .tm-kv dt { color: var(--tm-graphite); }
195
- .tm-kv dd { margin: 0; }
196
-
197
- /* ---------- ordered steps (only for real sequences) ---------- */
198
- .tm-steps { padding-left: 1.6em; margin: 0; max-width: 70ch; }
199
- .tm-steps > li { padding-left: .4em; margin: 0 0 10px; }
200
- .tm-steps > li::marker { color: var(--tm-graphite); font-variant-numeric: tabular-nums; font-weight: 600; }
201
-
202
- /* ---------- decisions (the user clicks, the agent receives the answer) ---------- */
203
- .tm-ask { margin: 24px 0; padding: 22px 22px 20px; border-radius: var(--tm-radius); background: var(--tm-sheet); border: 1px solid var(--tm-rule-strong); max-width: 760px; }
204
- .tm-ask > h3, .tm-ask > legend { font-size: 18px; margin: 0 0 6px; }
205
- .tm-ask > p { color: var(--tm-graphite); font-size: 15px; margin-bottom: 16px; }
206
- .tm-options { display: grid; gap: 8px; margin: 0 0 16px; }
207
- .tm-option {
208
- display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start; cursor: pointer;
209
- padding: 11px 14px; border-radius: var(--tm-radius); border: 1px solid var(--tm-rule);
207
+ /* ---------- page links (on the blueprint) ---------- */
208
+ .tm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; margin: 18px 0; border-top: 1px solid var(--tm-rule); }
209
+ .tm-link { display: block; padding: 14px 0 15px; border-bottom: 1px solid var(--tm-rule); text-decoration: none; color: var(--tm-graphite); font-size: 14px; line-height: 1.45; }
210
+ .tm-link strong { display: block; font-size: 15.5px; color: var(--tm-ink); margin-bottom: 3px; }
211
+ .tm-link:hover strong { color: var(--tm-route); }
212
+
213
+ /* ---------- small things ---------- */
214
+ .tm-badge { display: inline-block; vertical-align: 0.1em; font: 500 11.5px/1.5 var(--tm-font); padding: 0 6px; border-radius: 4px; background: var(--tm-wash); color: var(--tm-graphite); white-space: nowrap; }
215
+ .tm-badge.is-accent { background: var(--tm-route-wash); color: var(--tm-route-ink); }
216
+ .tm-badge.is-ok { background: var(--tm-fine-wash); color: var(--tm-fine); }
217
+ .tm-badge.is-warn { background: var(--tm-changed-wash); color: var(--tm-changed); }
218
+ .tm-badge.is-bad { background: var(--tm-broken-wash); color: var(--tm-broken); }
219
+
220
+ code, kbd, samp { font-family: var(--tm-code); font-size: 0.88em; }
221
+ :not(pre) > code { background: var(--tm-wash); color: var(--tm-ink); padding: 1px 5px; border-radius: 4px; }
222
+ pre { font-family: var(--tm-code); font-size: 13px; line-height: 1.6; background: var(--tm-sheet); color: var(--tm-text); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 14px 16px; overflow-x: auto; margin: 18px 0; max-width: 100%; }
223
+ .tm-path { font-family: var(--tm-code); font-size: 12.5px; color: var(--tm-graphite); }
224
+
225
+ .tm-steps { list-style: none; counter-reset: tm-step; padding: 0; margin: 18px 0; max-width: 68ch; }
226
+ .tm-steps > li { counter-increment: tm-step; position: relative; padding: 0 0 14px 36px; margin: 0; }
227
+ .tm-steps > li::before {
228
+ content: counter(tm-step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
229
+ border: 1px solid var(--tm-rule-strong); color: var(--tm-graphite); font: 500 12px/20px var(--tm-code); text-align: center; background: var(--tm-sheet);
210
230
  }
231
+ .tm-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; border-left: 1px solid var(--tm-rule); }
232
+
233
+ .tm-table-wrap { overflow-x: auto; margin: 20px 0; }
234
+ .tm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
235
+ .tm-table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--tm-graphite); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--tm-rule-strong); }
236
+ .tm-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--tm-rule); vertical-align: top; }
237
+ .tm-table tr:last-child td { border-bottom: 0; }
238
+
239
+ .tm-kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 24px; margin: 18px 0; font-size: 14.5px; }
240
+ .tm-kv dt { color: var(--tm-graphite); }
241
+ .tm-kv dd { margin: 0; color: var(--tm-text); }
242
+
243
+ /* ---------- custom diagrams ---------- */
244
+ .tm-svg { display: block; width: 100%; height: auto; margin: 24px 0; font-family: var(--tm-font); }
245
+ .tm-svg .tm-box { fill: var(--tm-sheet); stroke: var(--tm-rule-strong); stroke-width: 1; }
246
+ .tm-svg .tm-box.is-key { stroke: var(--tm-route); stroke-width: 2; }
247
+ .tm-svg .tm-edge { fill: none; stroke: var(--tm-rule-strong); stroke-width: 1.5; }
248
+ .tm-svg .tm-edge.is-key { stroke: var(--tm-route); stroke-width: 2; }
249
+ .tm-svg .tm-label { fill: var(--tm-ink); font-size: 14px; font-weight: 600; }
250
+ .tm-svg .tm-sub { fill: var(--tm-pencil); font-size: 12px; font-family: var(--tm-code); }
251
+
252
+ /* ---------- decisions ---------- */
253
+ .tm-ask { margin: 28px 0; padding: 22px 24px 24px; background: var(--tm-sheet); border: 1px solid var(--tm-rule-strong); border-radius: calc(var(--tm-radius) + 2px); max-width: 720px; }
254
+ .tm-ask > h3 { margin: 0 0 6px; font-size: 18px; }
255
+ .tm-ask > p { color: var(--tm-graphite); font-size: 14.5px; }
256
+ .tm-options { display: grid; gap: 10px; margin: 16px 0; }
257
+ .tm-option { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; padding: 13px 16px; border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); cursor: pointer; background: var(--tm-sheet); transition: border-color 120ms ease, background-color 120ms ease; }
211
258
  .tm-option:hover { border-color: var(--tm-rule-strong); }
259
+ .tm-option input { grid-row: 1 / span 2; margin: 3px 0 0; accent-color: var(--tm-route); width: 16px; height: 16px; }
260
+ .tm-option strong { font-size: 15px; }
261
+ .tm-option .tm-why { grid-column: 2; font-size: 13.5px; color: var(--tm-graphite); margin-top: 2px; }
212
262
  .tm-option:has(input:checked) { border-color: var(--tm-route); background: var(--tm-route-wash); }
213
- .tm-option input { margin: 4px 0 0; accent-color: var(--tm-route); width: 16px; height: 16px; }
214
- .tm-option strong { font-weight: 600; }
215
- .tm-option .tm-why { grid-column: 2; font-size: 14px; color: var(--tm-graphite); }
216
- .tm-ask textarea {
217
- width: 100%; min-height: 64px; resize: vertical; padding: 10px 12px; margin-bottom: 14px;
218
- border-radius: var(--tm-radius); border: 1px solid var(--tm-rule); background: var(--tm-paper); color: inherit; font: inherit; font-size: 15px;
219
- }
220
- .tm-btn {
221
- display: inline-block; padding: 9px 16px; border-radius: var(--tm-radius); border: 1px solid var(--tm-ink); cursor: pointer;
222
- font: 600 15px/1.2 var(--tm-font); background: var(--tm-ink); color: var(--tm-paper);
263
+ .tm-ask textarea { width: 100%; min-height: 64px; resize: vertical; font: 14.5px/1.5 var(--tm-font); color: var(--tm-text); background: var(--tm-paper); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 10px 12px; }
264
+ .tm-ask textarea:focus { outline: none; border-color: var(--tm-route); }
265
+ .tm-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font: 500 14.5px/1 var(--tm-font); padding: 11px 18px; border-radius: var(--tm-radius); border: 1px solid var(--tm-action); background: var(--tm-action); color: #fff; cursor: pointer; }
266
+ .tm-btn:hover { filter: brightness(0.92); }
267
+ .tm-btn.is-quiet { background: transparent; color: var(--tm-route); }
268
+ [data-tm-sent] .tm-btn { background: var(--tm-wash); border-color: var(--tm-rule); color: var(--tm-graphite); cursor: default; }
269
+ [data-tm-sent] .tm-option { cursor: default; }
270
+
271
+ /* ---------- small screens ---------- */
272
+ @media (max-width: 720px) {
273
+ .tm-page { padding: 28px 18px 80px; }
274
+ .tm-title { font-size: 28px; }
275
+ .tm-lede { font-size: 17px; }
276
+ .tm-section { margin-top: 48px; }
277
+ .tm-map { --tm-label-w: 72px; --tm-node-w: 184px; }
278
+ html[style*="--tm-vw"] .tm-map, html[style*="--tm-vw"] .tm-blueprint { width: calc(var(--tm-vw) - 26px); }
279
+ .tm-layer { gap: 12px; }
280
+ .tm-legend { margin-left: 0; }
281
+ .tm-node { flex: 1 1 100%; max-width: none; }
282
+ .tm-grid-2, .tm-grid-3 { grid-template-columns: minmax(0, 1fr); }
283
+ .tm-flow:not(.is-vertical) { flex-direction: column; gap: 26px; overflow: visible; }
284
+ .tm-flow:not(.is-vertical) > .tm-step { flex: none; }
285
+ .tm-flow:not(.is-vertical) > .tm-step + .tm-step::before { left: 50%; top: -22px; width: 0; height: 18px; border-top: 0; border-left: 1.5px solid var(--tm-rule-strong); }
286
+ .tm-flow:not(.is-vertical) > .tm-step + .tm-step > :first-child::before { left: calc(50% - 4px); top: -8px; border: 4px solid transparent; border-top: 5px solid var(--tm-rule-strong); border-bottom: 0; }
223
287
  }
224
- .tm-btn:hover { background: color-mix(in srgb, var(--tm-ink) 86%, var(--tm-route)); }
225
- .tm-btn.is-ghost { background: transparent; color: var(--tm-ink); border-color: var(--tm-rule-strong); }
226
- .tm-ask[data-tm-sent] { border-color: var(--tm-fine); }
227
- .tm-ask[data-tm-sent] .tm-btn { background: var(--tm-fine); border-color: var(--tm-fine); }
228
288
 
229
- @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
230
- @media print { body { background: #fff; } .tm-page { padding: 0; } .tm-ask { break-inside: avoid; } }
289
+ @media print {
290
+ body { background: #fff; }
291
+ .tm-page { padding: 0; }
292
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "truemap-cli",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Agents explain your project with living HTML pages that stay true to the code. Click, ask, and decide right on the page.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: truemap
3
- description: Explain a codebase with living HTML pages the user can click, ask about, and decide on. Use when explaining architecture, a module, a flow, or a data model; when comparing options or needing the user to decide; when asked "how does X work" or "show me the project"; and whenever a .truemap/ folder exists and you are about to explain something it may already cover. Not for one-line answers.
3
+ description: Explain a codebase with a living map in HTML that the user can comment on, ask about, and decide on. Use when explaining architecture, a module, a flow, or a data model; when comparing options or needing the user to decide; when asked "how does X work" or "show me the project"; and whenever a .truemap/ folder exists and you are about to explain something it may already cover. Not for one-line answers.
4
4
  allowed-tools: Bash(npx -y truemap-cli:*), Bash(npx truemap-cli:*), Bash(truemap:*)
5
5
  license: MIT
6
6
  ---
@@ -12,9 +12,10 @@ Pages live in `.truemap/` at the repo root (`index.html` is the project blueprin
12
12
  Current instructions live in the CLI – this file stays short so it never goes stale:
13
13
 
14
14
  - `npx -y truemap-cli --help` – commands and the chat loop
15
- - `npx -y truemap-cli guide` – how to write pages: folder rules, `data-src` anchors, page kit, decision forms
15
+ - `npx -y truemap-cli outline` – a fast repo outline for the first blueprint
16
+ - `npx -y truemap-cli guide` – how to write pages: the map, `data-src` anchors, page kit, decision forms
16
17
 
17
- Flow: look in `.truemap/` first → update or write the page → `npx -y truemap-cli <page>` → follow the `next_step` it prints.
18
+ Flow: look in `.truemap/` first, update or write the page, run `npx -y truemap-cli <page>` (add `--annotate` when you want the user's review), then follow the `next_step` it prints.
18
19
  Always also give the user a 1–3 line answer in the terminal.
19
20
 
20
21
  ## Request
package/src/check.js CHANGED
@@ -223,7 +223,38 @@ export function checkPage(ctx, page) {
223
223
  });
224
224
  const counts = { ok: 0, changed: 0, broken: 0 };
225
225
  for (const a of anchors) counts[a.state]++;
226
- return { page, anchors, counts };
226
+ return { page, anchors, counts, wires: checkWires(html), layout: checkLayout(html) };
227
+ }
228
+
229
+ /** Maps that are too big to read at a glance (the guide: at most 12 boxes per map, 4 per layer). */
230
+ export function checkLayout(html) {
231
+ const notes = [];
232
+ const NODE = /class=["'][^"']*\btm-node(?![-\w])/g;
233
+ const maps = html.split(/class=["'][^"']*\btm-(?:map|blueprint)(?![-\w])/).slice(1);
234
+ maps.forEach((body, i) => {
235
+ const total = (body.match(NODE) || []).length;
236
+ if (total > 12) notes.push(`map ${i + 1} has ${total} boxes; 12 or fewer reads at a glance, split the rest into a module page`);
237
+ body.split(/class=["'][^"']*\btm-layer(?![-\w])/).slice(1).forEach((layer, j) => {
238
+ const n = (layer.match(NODE) || []).length;
239
+ if (n > 4) notes.push(`map ${i + 1}, layer ${j + 1} has ${n} boxes; keep it to 4`);
240
+ });
241
+ });
242
+ return notes;
243
+ }
244
+
245
+ /** Map wires whose data-to names an id that is not on the page (they would silently not be drawn). */
246
+ export function checkWires(html) {
247
+ const ID = /\sid\s*=\s*["']([^"']+)["']/i;
248
+ const ids = new Set([...html.matchAll(new RegExp(ID.source, 'gi'))].map((m) => m[1]));
249
+ const problems = [];
250
+ for (const m of html.matchAll(/<[^>]*\sdata-to\s*=\s*["']([^"']*)["'][^>]*>/gi)) {
251
+ const from = (m[0].match(ID) || [])[1] || '(a box without an id)';
252
+ for (const spec of m[1].split(/[\s,]+/).filter(Boolean)) {
253
+ const to = spec.split(':')[0];
254
+ if (!ids.has(to)) problems.push({ from, to, reason: `no element with id="${to}"` });
255
+ }
256
+ }
257
+ return problems;
227
258
  }
228
259
 
229
260
  export function checkAll(root, pages) {