cognitune 0.3.0 → 0.3.1
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/CHANGELOG.md +22 -0
- package/README.md +183 -42
- package/dist/cli.js +8 -7
- package/dist/web/assets/Map-xBJDQ_Xn.js +1 -0
- package/dist/web/assets/{Practice-DJ_GeEEw.js → Practice-DNf-tMjl.js} +3 -3
- package/dist/web/assets/{_baseUniq-Cgcxu-ug.js → _baseUniq-7KLmbwxc.js} +1 -1
- package/dist/web/assets/{architectureDiagram-UYN6MBPD-F11egvO5.js → architectureDiagram-UYN6MBPD-DFK-K3Yp.js} +1 -1
- package/dist/web/assets/{blockDiagram-ZHA2E4KO-DcLwUr6e.js → blockDiagram-ZHA2E4KO-D9jSBc-F.js} +1 -1
- package/dist/web/assets/{c4Diagram-6F5ED5ID-DoK6LsEW.js → c4Diagram-6F5ED5ID-KAOALvx3.js} +1 -1
- package/dist/web/assets/channel-BW4MllLS.js +1 -0
- package/dist/web/assets/{chunk-5HRBRIJM-BZZC4mrX.js → chunk-5HRBRIJM-Btr12S8H.js} +1 -1
- package/dist/web/assets/{chunk-7U56Z5CX-CRQL1BaD.js → chunk-7U56Z5CX-NWMyaEQ0.js} +1 -1
- package/dist/web/assets/{chunk-ASOPGD6M-MyeXPUAo.js → chunk-ASOPGD6M-DdvxpUSZ.js} +1 -1
- package/dist/web/assets/{chunk-KFBOBJHC-ivtJnQTl.js → chunk-KFBOBJHC-CLK5Qods.js} +1 -1
- package/dist/web/assets/{chunk-T2TOU4HS-DfaWwXAy.js → chunk-T2TOU4HS-B-nrzheR.js} +1 -1
- package/dist/web/assets/{chunk-TMUBEWPD-1vGEp44G.js → chunk-TMUBEWPD-DCsdC8PC.js} +1 -1
- package/dist/web/assets/classDiagram-LNE6IOMH-D4kEJsvG.js +1 -0
- package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-D4kEJsvG.js +1 -0
- package/dist/web/assets/clone-C8mTbP7R.js +1 -0
- package/dist/web/assets/{dagre-4EVJKHTY-BzJqGMK1.js → dagre-4EVJKHTY-D_09gC0H.js} +1 -1
- package/dist/web/assets/{diagram-QW4FP2JN-DserUmhH.js → diagram-QW4FP2JN-quH5WQny.js} +1 -1
- package/dist/web/assets/{erDiagram-6RL3IURR-BeMwcZZW.js → erDiagram-6RL3IURR-BmJHLDew.js} +1 -1
- package/dist/web/assets/{flowDiagram-7ASYPVHJ-C2Qt1H4b.js → flowDiagram-7ASYPVHJ-DNzT7Cua.js} +1 -1
- package/dist/web/assets/{ganttDiagram-NTVNEXSI-DjG6T96W.js → ganttDiagram-NTVNEXSI-6reJ1AIG.js} +1 -1
- package/dist/web/assets/{gitGraph-YCYPL57B-C92c8R4j.js → gitGraph-YCYPL57B-BfipSUJ3.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-NRZ2UAAF-C0OK2-pl.js → gitGraphDiagram-NRZ2UAAF-BRb9bqzI.js} +1 -1
- package/dist/web/assets/{graph-jcgmh1Ot.js → graph-BHXuL-RR.js} +1 -1
- package/dist/web/assets/{index-BTAmHv-d.js → index-7JDqNzz1.js} +1 -1
- package/dist/web/assets/{index-DgVZUoYY.js → index-B49g1XNF.js} +1 -1
- package/dist/web/assets/{index-BD8q1ij7.js → index-B5Tomqy6.js} +1 -1
- package/dist/web/assets/{index-D8PR6AHG.js → index-BCM7jSxq.js} +1 -1
- package/dist/web/assets/{index-DB9Tltht.js → index-BM9KwSU5.js} +1 -1
- package/dist/web/assets/{index-BPFm8xBn.js → index-BiiiKqbq.js} +1 -1
- package/dist/web/assets/{index-D5AcpGl_.js → index-Bli4383n.js} +1 -1
- package/dist/web/assets/{index-DJ7YtDlC.js → index-BsH1Ca5H.js} +1 -1
- package/dist/web/assets/{index-H4qir-5V.js → index-Bsf4UF_h.js} +1 -1
- package/dist/web/assets/{index-DgTHE4KH.js → index-C5JoMvch.js} +1 -1
- package/dist/web/assets/{index-CW1WHdXq.js → index-C67RtHfG.js} +1 -1
- package/dist/web/assets/{index-CfFkiEw9.js → index-CNViI9C2.js} +1 -1
- package/dist/web/assets/{index-TRTMCU2f.js → index-CQjof-kk.js} +1 -1
- package/dist/web/assets/{index-DM-V8yrZ.js → index-CyHGDhfc.js} +1 -1
- package/dist/web/assets/index-CyhIx47s.css +1 -0
- package/dist/web/assets/{index-DIV7qBvA.js → index-D-DY42g9.js} +1 -1
- package/dist/web/assets/{index-B05Rh3LW.js → index-DRri1mnd.js} +1 -1
- package/dist/web/assets/{index-D3Zk0Btz.js → index-DXji-ikE.js} +1 -1
- package/dist/web/assets/{index-D-9XGv5u.js → index-D_DIS1os.js} +1 -1
- package/dist/web/assets/{index-BtCLkneo.js → index-Dl6tJxzv.js} +1 -1
- package/dist/web/assets/{index-HBtEhFV8.js → index-TI1LWXRL.js} +1 -1
- package/dist/web/assets/index-dA5Y-R2D.js +514 -0
- package/dist/web/assets/{index-a7yJqPRD.js → index-wnqHtEcu.js} +1 -1
- package/dist/web/assets/{index-BJepU7_w.js → index-ysHMZpcw.js} +1 -1
- package/dist/web/assets/{infoDiagram-A4XQUW5V-DqkPyvzP.js → infoDiagram-A4XQUW5V-CE9eDiRA.js} +1 -1
- package/dist/web/assets/{journeyDiagram-G5WM74LC-CPoGO9lU.js → journeyDiagram-G5WM74LC-D_iPCzBK.js} +1 -1
- package/dist/web/assets/{kanban-definition-QRCXZQQD-DhYcbXpZ.js → kanban-definition-QRCXZQQD-Bxj-EOmZ.js} +1 -1
- package/dist/web/assets/{layout-D3h_RNbG.js → layout-CQ6J22ew.js} +1 -1
- package/dist/web/assets/layout.worker-Bzrmqu8H.js +1 -0
- package/dist/web/assets/{mermaid.core-QonkHgY_.js → mermaid.core-27sLJoRM.js} +4 -4
- package/dist/web/assets/{min-u5yV8FH_.js → min-h0zR_W4w.js} +1 -1
- package/dist/web/assets/{mindmap-definition-GWI6TPTV-7qne4US6.js → mindmap-definition-GWI6TPTV-DiBTVWc8.js} +28 -28
- package/dist/web/assets/{pieDiagram-YF2LJOPJ-CYjuzLxS.js → pieDiagram-YF2LJOPJ-BE2VMHC3.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-OS5C2QUG-iNs3hmmI.js → quadrantDiagram-OS5C2QUG-DkN-8Avj.js} +1 -1
- package/dist/web/assets/{requirementDiagram-MIRIMTAZ-tDYOd2xQ.js → requirementDiagram-MIRIMTAZ-0OCRbKti.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-Y46BX6SQ-Ce34Wa1G.js → sankeyDiagram-Y46BX6SQ-6v9qBJFv.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-G6AWOVSC-i7VCqMq3.js → sequenceDiagram-G6AWOVSC-CjH7axp-.js} +1 -1
- package/dist/web/assets/{stateDiagram-MAYHULR4-BSREATU6.js → stateDiagram-MAYHULR4-Bbbno_Ix.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-4JROLMXI-CvrRdVH2.js +1 -0
- package/dist/web/assets/{timeline-definition-U7ZMHBDA-DgAweJ73.js → timeline-definition-U7ZMHBDA-BSIsFSlr.js} +1 -1
- package/dist/web/assets/{xychartDiagram-6QU3TZC5-DxWMJtPc.js → xychartDiagram-6QU3TZC5-B12dxFiy.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/Map-pFoOaroM.js +0 -1
- package/dist/web/assets/channel-cS78OL1L.js +0 -1
- package/dist/web/assets/classDiagram-LNE6IOMH-BV-X_A98.js +0 -1
- package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-BV-X_A98.js +0 -1
- package/dist/web/assets/clone-CX7XQP1C.js +0 -1
- package/dist/web/assets/index-Bs71achu.js +0 -509
- package/dist/web/assets/index-DajatLhQ.css +0 -1
- package/dist/web/assets/stateDiagram-v2-4JROLMXI-CtOZAypx.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1 (2026-11-18)
|
|
4
|
+
|
|
5
|
+
New:
|
|
6
|
+
|
|
7
|
+
- **Progress rolls up by repo and folder.** At a folder of many repos, each repo is one row with a
|
|
8
|
+
coverage bar; click to go into its folders, then files. A scope bar (breadcrumb with a repo picker)
|
|
9
|
+
narrows the cards, table and heatmap, and search filters the touched files in it. The scope lives
|
|
10
|
+
in the address, so it can be bookmarked. Untouched rows fold into one "show N untouched" line.
|
|
11
|
+
- **Map shows repos and folders, not ~2,000 files.** Nodes are repos, then folders, then files at
|
|
12
|
+
the current scope; a folder of 8 code files or fewer shows its files. Imports between two folders
|
|
13
|
+
are one arrow, thicker for more imports, so a Python package's `__init__.py` no longer looks like a
|
|
14
|
+
hub. Click a folder to go in. The layout runs off the main thread behind a placeholder map, and the
|
|
15
|
+
server keeps the graph until you press Refresh (it used to rebuild every minute).
|
|
16
|
+
- README: a banner, the Read / Prove / Keep loop, and screenshots cropped to be readable.
|
|
17
|
+
|
|
18
|
+
Fixes:
|
|
19
|
+
|
|
20
|
+
- Tutor links dropped the word between two ranges: "lines 41-48 and 58-60" showed as "41-4858-60".
|
|
21
|
+
- The Today page's path card said "Do this stop"; it now names the activity ("Start the lens"),
|
|
22
|
+
like the Paths page.
|
|
23
|
+
- The Library's tab strip stretches to fill its row instead of ending in an empty block.
|
|
24
|
+
|
|
3
25
|
## 0.3.0 (2026-11-18)
|
|
4
26
|
|
|
5
27
|
New:
|
package/README.md
CHANGED
|
@@ -1,63 +1,193 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/banner-dark.svg">
|
|
4
|
+
<img alt="cognitune. Understand any codebase, and prove to yourself that you do." src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/banner-light.svg" width="860">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/cognitune"><img alt="npm" src="https://img.shields.io/npm/v/cognitune?color=268bd2"></a>
|
|
10
|
+
<img alt="node 20 or newer" src="https://img.shields.io/badge/node-%3E%3D20-859900">
|
|
11
|
+
<img alt="MIT license" src="https://img.shields.io/badge/license-MIT-b58900">
|
|
12
|
+
<img alt="runs locally" src="https://img.shields.io/badge/runs-locally-586e75">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="#try-it-in-a-minute"><b>Try it</b></a> ·
|
|
17
|
+
<a href="#what-you-do-in-it"><b>What you do in it</b></a> ·
|
|
18
|
+
<a href="#why-it-works"><b>Why it works</b></a> ·
|
|
19
|
+
<a href="SETUP.md"><b>Setup</b></a> ·
|
|
20
|
+
<a href="CHANGELOG.md"><b>Changelog</b></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
AI makes code faster to write and easier to not understand.
|
|
24
|
+
**cognitune turns the model around: it does not write code for you. It teaches you the code you have, then checks that you got it.**
|
|
25
|
+
|
|
26
|
+
## Try it in a minute
|
|
7
27
|
|
|
8
28
|
```bash
|
|
9
|
-
npx cognitune
|
|
10
|
-
npx cognitune
|
|
29
|
+
npx cognitune --demo # a sample repo with canned answers. No model, no login.
|
|
30
|
+
npx cognitune ./my-repo # your own code, with the coding CLI you already use
|
|
11
31
|
```
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
- **No new account, no key.** It runs Claude Code, Codex or Copilot with that CLI's own login.
|
|
34
|
+
- **Read-only.** It works from the files you tick, and cognitune never writes to your folders.
|
|
35
|
+
- **Local.** A web app on `127.0.0.1`. Your notes and scores are plain JSON files in `~/.cognitune`.
|
|
14
36
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
<p align="center">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/lens-dark.png">
|
|
40
|
+
<img alt="A lens about a retry queue: the idea in one sentence, why it matters, then the words you need first" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/lens.png" width="860">
|
|
41
|
+
</picture>
|
|
42
|
+
<br>
|
|
43
|
+
<sub>A lens: one question, answered about the files you picked. The screenshots are real model output on the bundled 100-line demo repo (Map and Progress show cognitune's own source).</sub>
|
|
44
|
+
</p>
|
|
19
45
|
|
|
20
|
-
## What it
|
|
46
|
+
## What you do in it
|
|
21
47
|
|
|
22
|
-
|
|
23
|
-
|
|
48
|
+
<p align="center">
|
|
49
|
+
<picture>
|
|
50
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/loop-dark.svg">
|
|
51
|
+
<img alt="The loop: 1. Read with a question (lens, tutor, walkthrough). 2. Prove it (quiz, teach-back, practice, bug hunt). 3. Keep it (review cards, weak spots, today). What you got wrong comes back." src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/loop-light.svg" width="860">
|
|
52
|
+
</picture>
|
|
53
|
+
</p>
|
|
24
54
|
|
|
25
|
-
|
|
55
|
+
### 1. Read with a question
|
|
26
56
|
|
|
27
57
|
| | |
|
|
28
58
|
|---|---|
|
|
29
|
-
| **
|
|
30
|
-
| **
|
|
31
|
-
| **
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
| **Lens** | Pick files, pick a question: *Explain*, *Data flow*, *Failure modes*, *Trace a run*, *History*, or your own. You get a lesson where every step shows its own lines of code. Ask a follow-up and the answer joins the same lens. |
|
|
60
|
+
| **Tutor** | A Socratic chat. It gives a nudge first, then a hint, then more. Say "just tell me" any time. Click "line 50" in a reply and the code pane jumps there. |
|
|
61
|
+
| **Walkthrough** | The file in reading order, one block at a time. Each block ends with a question you answer before you go on. |
|
|
62
|
+
|
|
63
|
+
<p align="center">
|
|
64
|
+
<img alt="The tutor answers with a nudge, then a hint. Line numbers in its replies are links into the code pane on the right." src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/tutor.png" width="860">
|
|
65
|
+
<br>
|
|
66
|
+
<sub><b>Tutor.</b> A nudge, then a hint. The blue line numbers jump the code pane.</sub>
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
<table>
|
|
70
|
+
<tr>
|
|
71
|
+
<td width="50%"><img alt="A follow-up question answered inside the same lens, with file and line references" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/followup.png"></td>
|
|
72
|
+
<td width="50%"><img alt="A walkthrough block: worked example, a check question, the answer typed and the feedback" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/walk.png"></td>
|
|
73
|
+
</tr>
|
|
74
|
+
<tr>
|
|
75
|
+
<td align="center"><sub><b>Follow-up.</b> Ask more; the answer is added to the lens.</sub></td>
|
|
76
|
+
<td align="center"><sub><b>Walkthrough.</b> Answer the check, then the next block.</sub></td>
|
|
77
|
+
</tr>
|
|
78
|
+
</table>
|
|
79
|
+
|
|
80
|
+
### 2. Prove it
|
|
34
81
|
|
|
35
|
-
|
|
82
|
+
| | |
|
|
83
|
+
|---|---|
|
|
84
|
+
| **Quiz** | Free-text questions about behaviour and reasons, not names. Mark each answer *sure* or *guess*. The feedback names the line you got wrong. A wrong answer you were sure of is flagged first. |
|
|
85
|
+
| **Teach-back** | Explain the code in your own words. Graded 1-5: what is right, what is missing, what is wrong. |
|
|
86
|
+
| **Practice** | The key logic is cut out of a copy of your file. Write it back, with hints. |
|
|
87
|
+
| **Bug hunt** | Bugs are planted in a copy of the file. Find them and say why. |
|
|
88
|
+
| **Changes** | A split diff of two git refs, or of your uncommitted work. Every activity above can run on the diff. Good before you merge code you did not write. |
|
|
89
|
+
|
|
90
|
+
<p align="center">
|
|
91
|
+
<img alt="A graded quiz: score, the question, the answer marked sure, feedback that corrects two line numbers, and a good answer to compare with" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/quiz.png" width="860">
|
|
92
|
+
<br>
|
|
93
|
+
<sub><b>Quiz.</b> The answer was right, the line numbers were off, and the feedback says so.</sub>
|
|
94
|
+
</p>
|
|
95
|
+
|
|
96
|
+
<table>
|
|
97
|
+
<tr>
|
|
98
|
+
<td width="50%"><img alt="Practice: two holes cut out of fail() in queue.ts, the hole's intent on the right, and Check my work" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/practice.png"></td>
|
|
99
|
+
<td width="50%"><img alt="A graded bug hunt: one planted bug found with the reason, one missed, the buggy and real lines side by side" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/hunt.png"></td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td align="center"><sub><b>Practice.</b> Write the missing logic back, then check your work.</sub></td>
|
|
103
|
+
<td align="center"><sub><b>Bug hunt.</b> Found, missed and false alarms, each explained.</sub></td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
<img alt="The Changes page: file list, a split diff of an uncommitted change, and the activities that can run on it" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/changes.png" width="860">
|
|
109
|
+
<br>
|
|
110
|
+
<sub><b>Changes.</b> Read the diff, then lens it, quiz yourself on it or ask the tutor about it.</sub>
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
### 3. Keep it
|
|
36
114
|
|
|
37
115
|
| | |
|
|
38
116
|
|---|---|
|
|
39
|
-
| **
|
|
40
|
-
| **
|
|
41
|
-
| **
|
|
42
|
-
| **
|
|
43
|
-
|
|
117
|
+
| **Weak spots** | A wrong answer is saved as the belief behind it: "you think X, but Y". The next quiz aims at exactly those. A right answer clears one. |
|
|
118
|
+
| **Review cards** | Quiz misses become spaced-repetition cards (FSRS). Each card links back to the quiz or lens it came from. |
|
|
119
|
+
| **Today** | Each project opens on what to do now: cards due, weak spots, files that changed, the next stop on your path. |
|
|
120
|
+
| **Map, Paths, Progress** | See how the repo hangs together, take an ordered tour of it, and see what you have proved and what is fading. |
|
|
121
|
+
|
|
122
|
+
<table>
|
|
123
|
+
<tr>
|
|
124
|
+
<td width="50%"><img alt="Today: a suggested next step, 2 review cards due, two weak spots written as beliefs, and the next learning path stop" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/today.png"></td>
|
|
125
|
+
<td width="50%"><img alt="A review card made from a quiz miss: the question, what you wrote, the answer, and the Again, Hard, Good, Easy buttons" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/review.png"></td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td align="center"><sub><b>Today.</b> What to do now, in about 10 minutes.</sub></td>
|
|
129
|
+
<td align="center"><sub><b>Review.</b> Recall first, then reveal and rate.</sub></td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td width="50%"><img alt="The map: folders sized by their files, thicker arrows for more imports between them" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/map.png"></td>
|
|
133
|
+
<td width="50%"><img alt="Progress: folders rolled up with coverage bars, and cards for understood, fading, stale and seen" src="https://raw.githubusercontent.com/k-pulkit/cognitune/main/assets/screenshots/progress.png"></td>
|
|
134
|
+
</tr>
|
|
135
|
+
<tr>
|
|
136
|
+
<td align="center"><sub><b>Map.</b> Repos and folders, then files. Click a folder to go in.</sub></td>
|
|
137
|
+
<td align="center"><sub><b>Progress.</b> Per repo, folder and file: proved, fading or stale.</sub></td>
|
|
138
|
+
</tr>
|
|
139
|
+
</table>
|
|
140
|
+
|
|
141
|
+
## Use it when
|
|
142
|
+
|
|
143
|
+
- You joined a team and must find your way in a repo you did not write.
|
|
144
|
+
- An agent wrote the code and you must own it. Open **Changes** and quiz yourself on the diff.
|
|
145
|
+
- You come back to your own code after six months.
|
|
146
|
+
- You review a pull request and want to know what it does, not only that it looks fine.
|
|
147
|
+
|
|
148
|
+
## Why it works
|
|
149
|
+
|
|
150
|
+
Three findings from learning research decide how every page behaves.
|
|
151
|
+
|
|
152
|
+
| The finding | What cognitune does about it |
|
|
153
|
+
|---|---|
|
|
154
|
+
| **Recall beats re-reading** | Quizzes and teach-back are free text. You write the answer; you do not pick it from a list. |
|
|
155
|
+
| **Spacing beats cramming** | Misses come back as review cards on a schedule. Progress marks a file *fading* when you stop recalling it. |
|
|
156
|
+
| **Answer first, then read** | The tutor hints before it tells. A lens can ask for your own take first. A missed check asks you to try again. |
|
|
157
|
+
|
|
158
|
+
## Reference
|
|
44
159
|
|
|
45
|
-
|
|
160
|
+
<details>
|
|
161
|
+
<summary><b>All features</b></summary>
|
|
162
|
+
<br>
|
|
46
163
|
|
|
47
164
|
| | |
|
|
48
165
|
|---|---|
|
|
166
|
+
| **Lenses** | See code through one question: *Explain*, *Data flow*, *State over time*, *Failure modes*, *Contracts*, *Concepts*, *The change*, *Trace a run* (a debugger without running: line by line with the variables), *History* (why it is like this, from git), or your own. Tick **My take first** to write your own guess before the lens; it opens with where you differ. On a diff, that becomes **Predict first**. Ask follow-ups at the end; the answers are added to the same lens. A lens shows a banner when its code changes, with one-click refresh. |
|
|
167
|
+
| **Walkthrough** | The file in reading order (not file order), one block at a time, with a check question on each block before the next. Retry a block you missed. |
|
|
168
|
+
| **Tutor** | A Socratic chat over the files. It answers with a question or a hint first and gives a bit more each turn; ask it to just tell you any time. Line references jump the code pane. |
|
|
169
|
+
| **Map** | The import graph (TS/JS with tsconfig aliases, Python) at one scope: repos, then folders, then files. Thicker arrows carry more imports; click a folder to go in. A folder of 8 code files or fewer shows its files. |
|
|
170
|
+
| **Paths** | An ordered tour of the repo, 6-12 stops, each with the activity that fits. Stops tick off as you do them. |
|
|
171
|
+
| **Quizzes** | Free-text questions about behaviour and reasons, not names. Mark each answer *sure* or *guess*. Graded with feedback that names the line and a good answer to compare with. |
|
|
172
|
+
| **Teach-back** | Explain the code in your own words. Graded 1-5: what you got right, what you missed, what is wrong. |
|
|
173
|
+
| **Practice** | The key logic is cut out of a copy of your file (4 levels). Write it back, with hints, then "check my work". |
|
|
174
|
+
| **Bug hunt** | Realistic bugs are planted in a copy of the file. Click the lines you suspect and say why; see found, missed and false alarms. |
|
|
175
|
+
| **Changes** | Two git refs, or HEAD vs your working tree. Read the diff, then predict, lens, quiz, teach back or ask the tutor about the change itself. |
|
|
49
176
|
| **Review cards** | Spaced repetition (FSRS). Quiz misses become cards on their own; lens concepts and code lines can become cards in one click. |
|
|
50
|
-
| **Weak spots** | Wrong answers are saved as the belief behind them
|
|
51
|
-
| **Today** |
|
|
52
|
-
| **Progress** |
|
|
53
|
-
| **Library** | Everything made, searchable, plus a glossary
|
|
54
|
-
|
|
55
|
-
`Ctrl/Cmd+K` jumps to any page, file or project, or starts an activity. `?` lists all shortcuts.
|
|
177
|
+
| **Weak spots** | Wrong answers are saved as the belief behind them. Quiz one weak spot or all of them; a right answer clears one; dismiss one the grader got wrong. |
|
|
178
|
+
| **Today** | Due cards, weak spots, files that need a refresh, the next stop on your path, and one suggested 10-minute activity. |
|
|
179
|
+
| **Progress** | Rolled up per repo and folder, then per file: *seen*, *understood* (a check passed on the code as it is now), *fading* (no recall for a few weeks), *stale* (the code changed since). Pick a repo, drill into folders, search; table or heatmap. |
|
|
180
|
+
| **Library** | Everything made, searchable, plus a glossary and your margin notes. Export a lens or quiz as markdown, or a whole project as JSON. |
|
|
56
181
|
|
|
57
182
|
Context is what you pick: tick files in the tree, or add extra folders (docs, notes, design files) to a
|
|
58
|
-
project as context. The model
|
|
183
|
+
project as context. The model works from what you give it. Long jobs keep running if you leave the page;
|
|
184
|
+
the status bar says when they are ready. <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>K</kbd> jumps anywhere; <kbd>?</kbd> lists shortcuts.
|
|
185
|
+
|
|
186
|
+
</details>
|
|
59
187
|
|
|
60
|
-
|
|
188
|
+
<details>
|
|
189
|
+
<summary><b>Model access</b>: Claude Code, Codex, Copilot or the Anthropic API</summary>
|
|
190
|
+
<br>
|
|
61
191
|
|
|
62
192
|
cognitune makes one model call per lens, quiz, grade, practice, tutor turn and so on (about 15 s to 2 min).
|
|
63
193
|
Replies are checked against a schema (one retry with the problems listed), and lens, walkthrough and path
|
|
@@ -75,9 +205,16 @@ stores a key**. Pick one in Settings; *Auto* takes the first one it finds, in th
|
|
|
75
205
|
Each CLI runs with the project folder as its working directory. Model per provider is optional
|
|
76
206
|
(empty = the CLI's default). `COGNITUNE_AGENT=fake` gives canned answers, to try the UI without a model.
|
|
77
207
|
|
|
78
|
-
|
|
208
|
+
Step-by-step setup: [SETUP.md](SETUP.md).
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
<details>
|
|
213
|
+
<summary><b>Your files are safe</b>: local only, read-only, bounded storage</summary>
|
|
214
|
+
<br>
|
|
79
215
|
|
|
80
216
|
- cognitune never writes to your folders. Practice works on a copy.
|
|
217
|
+
- The server binds to `127.0.0.1` only. There is no login: it is a local, one-person tool.
|
|
81
218
|
- Everything it makes lives in `~/.cognitune` (change with `COGNITUNE_HOME`), as plain JSON files, one
|
|
82
219
|
per item. Files, not SQLite: the data is small, you can read and back it up, and there is no native
|
|
83
220
|
module to build.
|
|
@@ -104,16 +241,16 @@ sizes and has *Clean up now*):
|
|
|
104
241
|
|
|
105
242
|
Cleanup runs at start-up and every 6 hours, and only ever inside the cognitune folder.
|
|
106
243
|
|
|
107
|
-
|
|
244
|
+
</details>
|
|
108
245
|
|
|
109
|
-
|
|
246
|
+
<details>
|
|
247
|
+
<summary><b>CLI and development</b></summary>
|
|
248
|
+
<br>
|
|
110
249
|
|
|
111
250
|
```
|
|
112
251
|
cognitune [folder] [--port 4711] [--host 127.0.0.1] [--no-open] [--demo]
|
|
113
252
|
```
|
|
114
253
|
|
|
115
|
-
## Develop
|
|
116
|
-
|
|
117
254
|
```bash
|
|
118
255
|
npm install
|
|
119
256
|
npm run dev # API on :4711 (tsx watch) + Vite on :5173 with hot reload
|
|
@@ -140,6 +277,10 @@ web/src/ React + Vite + Tailwind: pages/, components/, lib/
|
|
|
140
277
|
Stack: TypeScript everywhere. Hono on Node 20+, zod, ts-fsrs. React 18, React Router, TanStack Query,
|
|
141
278
|
Tailwind, Shiki (code), CodeMirror (practice editor), Mermaid (diagrams), d3-force (map).
|
|
142
279
|
|
|
280
|
+
</details>
|
|
281
|
+
|
|
143
282
|
## License
|
|
144
283
|
|
|
145
284
|
MIT
|
|
285
|
+
|
|
286
|
+
<p align="center"><sub>If cognitune helped you understand something, <a href="https://github.com/k-pulkit/cognitune/issues">tell me what you would change</a>.</sub></p>
|
package/dist/cli.js
CHANGED
|
@@ -3222,12 +3222,13 @@ function createApi(store2, opts2 = {}) {
|
|
|
3222
3222
|
sweep();
|
|
3223
3223
|
if (opts2.pruneEveryMs) setInterval(sweep, opts2.pruneEveryMs).unref();
|
|
3224
3224
|
const graphs = /* @__PURE__ */ new Map();
|
|
3225
|
-
const graphOf = (p) => {
|
|
3226
|
-
|
|
3227
|
-
if (hit
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3225
|
+
const graphOf = (p, refresh = false) => {
|
|
3226
|
+
let hit = graphs.get(p.id);
|
|
3227
|
+
if (!hit || refresh) {
|
|
3228
|
+
hit = { at: Date.now(), g: new Workspace(p).graph() };
|
|
3229
|
+
graphs.set(p.id, hit);
|
|
3230
|
+
}
|
|
3231
|
+
return { ...hit.g, builtAt: new Date(hit.at).toISOString() };
|
|
3231
3232
|
};
|
|
3232
3233
|
const hubs = (p) => graphOf(p).nodes.filter((n) => n.fanIn > 0).sort((a, b) => b.fanIn - a.fanIn).map((n) => n.path);
|
|
3233
3234
|
const offline = () => new Learn(store2, { name: "none", complete: async () => "" });
|
|
@@ -3503,7 +3504,7 @@ function createApi(store2, opts2 = {}) {
|
|
|
3503
3504
|
if (!store2.get(p.id, "hunts", id)) return fail(c, 404, "bug hunt not found");
|
|
3504
3505
|
return startJob(c, "huntgrade", p, (l) => l.huntgrade(p, id));
|
|
3505
3506
|
});
|
|
3506
|
-
api.get("/projects/:pid/graph", (c) => c.json(graphOf(project(c))));
|
|
3507
|
+
api.get("/projects/:pid/graph", (c) => c.json(graphOf(project(c), c.req.query("refresh") === "1")));
|
|
3507
3508
|
api.get("/projects/:pid/glossary", (c) => c.json(glossary(store2, project(c).id)));
|
|
3508
3509
|
const pathView = (x) => ({ ...x, done: pathDone(store2, x) });
|
|
3509
3510
|
crud("paths", "paths", pathView);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as Q,a as ve,b as Me,c as Ne,d as $e,e as _,r as d,f as Se,j as t,S as Le,g as Re,B as Ie,R as qe,E as de,M as Be,G as Ee,F as Fe,h as We,i as ze,k as H}from"./index-dA5Y-R2D.js";const he=8,Oe=()=>({new:0,seen:0,understood:0,fading:0,stale:0});function me(n,l,j,k){var R,F;const f=l.nodes.map(r=>r.path).filter(r=>Q(n,r)),u=j.filter(r=>Q(n,r.path)),x=r=>{const a=u.find(I=>Q(I.path,r));if(a)return{key:a.path,kind:"repo"};const g=r.slice(n.length+1),w=g.indexOf("/");return w<0?{key:r,kind:"file"}:{key:`${n}/${g.slice(0,w)}`,kind:"dir"}},i=new Map;for(const r of f){const{key:a}=x(r);i.set(a,(i.get(a)??0)+1)}if(i.size===1){const[r]=i.keys();if(!f.includes(r)&&r!==n)return me(r,l,j,k)}const h=new Map;for(const r of f){const a=x(r);h.set(r,a.kind==="dir"&&(i.get(a.key)??0)<=he?{key:r,kind:"file"}:a)}const N=new Map;for(const[r,{key:a,kind:g}]of h){let w=N.get(a);w||N.set(a,w={id:a,label:a.slice(n.length+1),kind:g,files:0,fanIn:0,fanOut:0,counts:Oe()}),w.files++,w.counts[k.get(r)??"new"]++}const L=new Map;let m=0;for(const r of l.edges){const a=(R=h.get(r.from))==null?void 0:R.key,g=(F=h.get(r.to))==null?void 0:F.key;if(!a&&!g)continue;if(!a||!g){m++;continue}if(a===g)continue;const w=`${a}\0${g}`,I=L.get(w)??{from:a,to:g,weight:0};I.weight++,L.set(w,I)}for(const r of L.values())N.get(r.to).fanIn+=r.weight,N.get(r.from).fanOut+=r.weight;return{scope:n,nodes:[...N.values()],edges:[...L.values()],outside:m}}const B={new:"rgb(var(--muted) / 0.45)",seen:"rgb(var(--accent) / 0.45)",understood:"rgb(var(--good))",fading:"rgb(var(--warn) / 0.7)",stale:"rgb(var(--warn))"};function fe(n){const l=n.files-n.counts.new;return n.counts.stale?B.stale:n.counts.fading?B.fading:n.counts.understood*2>=n.files?B.understood:l?B.seen:B.new}const Z=n=>n.kind==="file"?Math.min(16,5+Math.sqrt(n.fanIn)*2.5):Math.min(34,10+Math.sqrt(n.files)*2.2);function Te(n,l){const j=d.useRef(null),k=d.useRef(0),[f,u]=d.useState(null);return d.useEffect(()=>{const x=new Worker(new URL("/assets/layout.worker-Bzrmqu8H.js",import.meta.url),{type:"module"});return j.current=x,x.onmessage=i=>i.data.id===k.current&&u(i.data),()=>x.terminate()},[]),d.useEffect(()=>{if(!j.current||!n.length)return;const x=++k.current;u(null);const i={id:x,nodes:n.map(h=>({id:h.id,r:Z(h)})),links:l.map(h=>({source:h.from,target:h.to,weight:h.weight}))};j.current.postMessage(i)},[n,l]),(f==null?void 0:f.pos)??null}function ue({text:n}){const l=[[-140,-60,22],[-40,-110,14],[70,-70,26],[160,-10,12],[110,80,18],[-10,40,30],[-120,70,16],[30,140,10],[-200,10,10]],j=[[0,5],[0,1],[1,2],[2,3],[2,5],[4,5],[5,6],[4,7],[6,8],[3,4]];return t.jsxs("div",{className:"relative h-full w-full bg-panel",children:[t.jsxs("svg",{className:"h-full w-full animate-pulse",viewBox:"-260 -180 520 360",children:[j.map(([k,f],u)=>t.jsx("line",{x1:l[k][0],y1:l[k][1],x2:l[f][0],y2:l[f][1],stroke:"rgb(var(--muted) / 0.18)",strokeWidth:1.5},u)),l.map(([k,f,u],x)=>t.jsx("rect",{x:k-u,y:f-u,width:u*2,height:u*2,rx:x%2?u:6,fill:"rgb(var(--muted) / 0.14)"},x))]}),t.jsx("div",{className:"absolute inset-0 grid place-items-center",children:t.jsx("div",{className:"rounded-full bg-raised/90 px-4 py-1.5 text-[13px] text-muted shadow-soft",children:n})})]})}function Ce(){var ne,re;const{project:n,setOpenFile:l,setSelected:j}=ve(),k=Me(),f=Ne(),[u,x]=$e(),i=n.root.replace(/\/$/,""),h=(u.get("in")??"").replace(/^\/+|\/+$/g,""),N=h?`${i}/${h}`:i,L=e=>x(e&&e!==i?{in:e.slice(i.length+1)}:{}),m=_({queryKey:["graph",n.id],queryFn:()=>H(`/projects/${n.id}/graph`),staleTime:1/0}),R=_({queryKey:["progress",n.id],queryFn:()=>H(`/projects/${n.id}/progress`)}),F=_({queryKey:["repos",n.id,n.contexts],queryFn:()=>H(`/projects/${n.id}/repos`)}),r=d.useMemo(()=>F.data??[],[F.data]),a=d.useMemo(()=>new Map((R.data??[]).map(e=>[e.path,e.level])),[R.data]),g=d.useMemo(()=>new Map((R.data??[]).map(e=>[e.path,e])),[R.data]),w=d.useMemo(()=>{var e;return(((e=m.data)==null?void 0:e.nodes)??[]).map(c=>c.path).filter(c=>Q(i,c))},[m.data,i]),I=d.useMemo(()=>r.length>1?Se(i,w,g,r).filter(e=>e.kind==="repo"):[],[r,i,w,g]),o=d.useMemo(()=>m.data?me(N,m.data,r,a):null,[m.data,N,r,a]),D=(o==null?void 0:o.scope)??N,W=Te((o==null?void 0:o.nodes)??[],(o==null?void 0:o.edges)??[]),[C,ee]=d.useState(!1),pe=async()=>{ee(!0);try{f.setQueryData(["graph",n.id],await H(`/projects/${n.id}/graph?refresh=1`))}finally{ee(!1)}},[p,z]=d.useState(null),[O,K]=d.useState({x:0,y:0,k:1}),S=d.useRef(null);d.useEffect(()=>{K({x:0,y:0,k:1}),z(null)},[D]);const xe=e=>{l(e),j([e]),k(`/p/${n.id}/explore`)},te=e=>e.kind==="file"?xe(e.id):L(e.id),ge=t.jsxs(Le,{className:"rounded-none border-x-0 border-t-0",root:i,rootLabel:n.name,scope:D,repos:r,repoRows:I,onScope:L,children:[((ne=m.data)==null?void 0:ne.builtAt)&&t.jsxs("span",{className:"text-[12px] text-muted",children:["imports read ",Re(m.data.builtAt)]}),t.jsx(Ie,{size:"sm",variant:"ghost",icon:t.jsx(qe,{className:C?"h-3.5 w-3.5 animate-spin":"h-3.5 w-3.5"}),disabled:C||m.isLoading,onClick:pe,children:"Refresh"})]});if(!m.isLoading&&!((re=m.data)!=null&&re.nodes.length))return t.jsx(de,{icon:t.jsx(Be,{className:"h-6 w-6"}),title:"No imports found",children:"The map reads import lines in TypeScript, JavaScript and Python files. This folder has none that point to other files in it."});const b=(o==null?void 0:o.nodes)??[],E=new Map(b.map(e=>[e.id,e])),G=new Set;if(p)for(const e of(o==null?void 0:o.edges)??[])e.from===p&&G.add(e.to),e.to===p&&G.add(e.from);const se=b.filter(e=>e.fanIn>0).sort((e,c)=>c.fanIn-e.fanIn||c.files-e.files).slice(0,12),we=new Set((b.length<=40?b:[...b].sort((e,c)=>c.fanIn+c.files-(e.fanIn+e.files)).slice(0,14)).map(e=>e.id)),J=e=>e.kind==="file"?e.label.split("/").pop():e.label,P=b.filter(e=>e.kind!=="file").length,U=b.length-P,ke=((o==null?void 0:o.edges)??[]).reduce((e,c)=>e+c.weight,0);let T;if(m.isLoading||C)T=t.jsx(ue,{text:C?"Reading imports again…":"Reading imports…"});else if(!b.length)T=t.jsx(de,{title:"Nothing to show",children:"No code files in here import, or are imported by, another file."});else if(!W)T=t.jsx(ue,{text:"Drawing the map…"});else{const e=b.map(s=>W[s.id]??[0,0]),c=e.map(s=>s[0]),X=e.map(s=>s[1]),oe=70,ae=Math.max(Math.max(...c)-Math.min(...c)+oe*2,420),ie=Math.max(Math.max(...X)-Math.min(...X)+oe*2,300),ye=(Math.max(...c)+Math.min(...c))/2,je=(Math.max(...X)+Math.min(...X))/2,A={x:ye-ae/2,y:je-ie/2,w:ae,h:ie},be=Math.max(1,...((o==null?void 0:o.edges)??[]).map(s=>s.weight));T=t.jsxs("div",{className:"relative h-full bg-panel",children:[t.jsxs("svg",{className:"h-full w-full cursor-grab active:cursor-grabbing",viewBox:`${A.x+O.x} ${A.y+O.y} ${A.w/O.k} ${A.h/O.k}`,onWheel:s=>K(v=>({...v,k:Math.min(8,Math.max(.3,v.k*(s.deltaY<0?1.15:1/1.15)))})),onMouseDown:s=>S.current={x:s.clientX,y:s.clientY,moved:!1},onMouseUp:()=>S.current=null,onMouseLeave:()=>S.current=null,onMouseMove:s=>{if(!S.current)return;const v=s.currentTarget.getBoundingClientRect(),$=A.w/O.k/v.width,y=(s.clientX-S.current.x)*$,q=(s.clientY-S.current.y)*$;S.current={x:s.clientX,y:s.clientY,moved:!0},K(M=>({...M,x:M.x-y,y:M.y-q}))},children:[t.jsxs("defs",{children:[t.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L10,5 L0,10 z",fill:"rgb(var(--muted) / 0.55)"})}),t.jsx("marker",{id:"arrow-on",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L10,5 L0,10 z",fill:"rgb(var(--accent))"})})]}),((o==null?void 0:o.edges)??[]).map(s=>{const v=E.get(s.from),$=E.get(s.to),[y,q]=W[v.id]??[0,0],[M,V]=W[$.id]??[0,0],le=Math.hypot(M-y,V-q)||1,ce=Z($)+3,Y=p===v.id||p===$.id;return t.jsx("line",{x1:y,y1:q,x2:M-(M-y)/le*ce,y2:V-(V-q)/le*ce,stroke:Y?"rgb(var(--accent))":"rgb(var(--muted) / 0.28)",strokeWidth:(Y?1.2:.8)+Math.log2(1+s.weight/be*15)*.8,markerEnd:Y?"url(#arrow-on)":"url(#arrow)",opacity:p&&!Y?.25:1,children:t.jsx("title",{children:`${J(v)} → ${J($)}: ${s.weight} import${s.weight===1?"":"s"}`})},`${s.from}>${s.to}`)}),b.map(s=>{const[v,$]=W[s.id]??[0,0],y=Z(s),q=p&&s.id!==p&&!G.has(s.id);return t.jsxs("g",{transform:`translate(${v},${$})`,opacity:q?.25:1,className:"cursor-pointer",onMouseEnter:()=>z(s.id),onMouseLeave:()=>z(null),onClick:()=>{var M;return!((M=S.current)!=null&&M.moved)&&te(s)},children:[s.kind==="file"?t.jsx("circle",{r:y,fill:s.counts.new?B.new:fe(s),stroke:"rgb(var(--panel))",strokeWidth:1.5}):t.jsx("rect",{x:-y,y:-y,width:y*2,height:y*2,rx:7,fill:fe(s),stroke:s.kind==="repo"?"rgb(var(--accent) / 0.7)":"rgb(var(--panel))",strokeWidth:s.kind==="repo"?2:1.5}),s.kind!=="file"&&t.jsx("text",{textAnchor:"middle",dy:"0.35em",fontSize:10,className:"fill-ink font-mono",opacity:.7,children:s.files}),(we.has(s.id)||s.id===p)&&t.jsxs("text",{y:-y-6,textAnchor:"middle",className:"fill-ink font-mono",fontSize:11,paintOrder:"stroke",stroke:"rgb(var(--panel))",strokeWidth:3,strokeLinejoin:"round",children:[J(s),s.kind!=="file"?"/":""]})]},s.id)})]}),t.jsxs("div",{className:"pointer-events-none absolute bottom-3 left-3 flex flex-wrap items-center gap-2 text-[12px] text-muted",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"h-2.5 w-2.5 rounded-[3px] border border-muted/50"}),"folder (number = files)"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"h-2.5 w-2.5 rounded-full border border-muted/50"}),"file"]}),["new","seen","understood","fading","stale"].map(s=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{background:B[s]}}),s==="new"?"not yet":s]},s)),t.jsx("span",{children:"· thicker arrow = more imports · click a folder to go in · scroll to zoom"})]}),p&&E.get(p)&&t.jsxs("div",{className:"absolute left-3 top-3 rounded-md bg-raised px-2 py-1 font-mono text-xs",children:[E.get(p).label,E.get(p).kind!=="file"&&` · ${E.get(p).files} files, click to open`]})]})}return t.jsxs("div",{className:"flex h-full flex-col",children:[ge,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx("div",{className:"min-w-0 flex-1",children:T}),t.jsxs("aside",{className:"w-[300px] shrink-0 overflow-auto border-l border-line bg-panel p-4",children:[t.jsx("h1",{className:"text-base font-semibold",children:"Map"}),t.jsx("p",{className:"text-xs text-muted",children:o?t.jsxs(t.Fragment,{children:[P>0&&`${P} ${I.length&&D===i?"repos and folders":"folders"}`,P>0&&U>0&&", ",U>0&&`${U} files`,", ",ke," imports between them.",o.outside>0&&` ${o.outside} more cross out of this view.`," Folders of ",he," files or fewer show their files."]}):"Reading the imports in TypeScript, JavaScript and Python files."}),se.length>0&&t.jsx("div",{className:"label mt-4",children:"Most depended on"}),t.jsx("ol",{className:"space-y-1",children:se.map(e=>t.jsx("li",{children:t.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-raised",onMouseEnter:()=>z(e.id),onMouseLeave:()=>z(null),onClick:()=>te(e),children:[e.kind==="repo"?t.jsx(Ee,{className:"h-3.5 w-3.5 shrink-0 text-accent"}):e.kind==="dir"?t.jsx(Fe,{className:"h-3.5 w-3.5 shrink-0 text-muted"}):t.jsx(We,{className:"h-3.5 w-3.5 shrink-0 text-muted"}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12.5px]",title:e.label,children:e.label}),t.jsx(ze,{children:e.fanIn})]})},e.id))})]})]})]})}export{Ce as MapPage};
|