truemap-cli 0.1.0 → 0.2.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 +29 -26
- package/bin/truemap.js +3 -0
- package/kit/fonts/OFL.txt +93 -0
- package/kit/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/kit/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/kit/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/kit/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/kit/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/kit/truemap.css +246 -186
- package/package.json +1 -1
- package/skills/truemap/SKILL.md +4 -3
- package/src/cli.js +46 -15
- package/src/guide.md +53 -31
- package/src/outline.js +71 -0
- package/src/server.js +440 -394
- package/src/ui/sdk.js +387 -58
- package/src/ui/workspace.css +179 -128
- package/src/ui/workspace.html +49 -46
- package/src/ui/workspace.js +241 -104
package/README.md
CHANGED
|
@@ -1,61 +1,65 @@
|
|
|
1
|
+
<img src="docs/images/mark.svg" width="44" height="44" alt="">
|
|
2
|
+
|
|
1
3
|
# truemap
|
|
2
4
|
|
|
3
|
-
**
|
|
4
|
-
Click anything on a page to ask about it. Click an option to decide. The pages live in your repo and get checked against the code, so they never quietly lie.
|
|
5
|
+
**A map of your codebase that your agent draws, and that stays true to the code.**
|
|
5
6
|
|
|
7
|
+
Your coding agent explains the project as HTML pages in your repo: a blueprint of the whole system, a page per module, the options when it needs your call. You read them in the browser, click any box to comment on it, and the agent answers right next to the page. Every box is pinned to real code, so when the code moves on, the map tells you.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+

|
|
8
10
|
|
|
9
11
|
## Why
|
|
10
12
|
|
|
11
|
-
Coding agents write code faster than anyone can read it. Their
|
|
13
|
+
Coding agents write code faster than anyone can read it. Their explanations come back as walls of text, and the diagrams they draw are gone after one chat.
|
|
12
14
|
|
|
13
|
-
- **Pages, not paragraphs.** The agent draws the architecture, a flow, or the options as
|
|
14
|
-
- **Point
|
|
15
|
-
- **Click to decide.** When the agent needs your call, the page shows options. One click and the answer
|
|
16
|
-
- **Pages that stay true.** Every box carries a `data-src="path#name"` anchor. When
|
|
17
|
-
- **It
|
|
15
|
+
- **Pages, not paragraphs.** The agent draws the architecture, a flow, or the options as a page and opens it for you.
|
|
16
|
+
- **Point at it.** Switch on Annotate, click a box or select a sentence, write a comment. Comments go out together, each with the code it points to. It is the agent session you already have open: no login, no extra app.
|
|
17
|
+
- **Click to decide.** When the agent needs your call, the page shows the options. One click and the answer is back with the agent.
|
|
18
|
+
- **Pages that stay true.** Every box carries a `data-src="path#name"` anchor. When that code changes or disappears, the box is marked and the agent fixes the page.
|
|
19
|
+
- **It stays in the repo.** Pages live in `.truemap/`, with `index.html` as the blueprint. Plain files you commit, diff and share.
|
|
18
20
|
|
|
19
21
|
## Install
|
|
20
22
|
|
|
21
|
-
Install the skill once. That is
|
|
23
|
+
Install the skill once. That is the whole setup.
|
|
22
24
|
|
|
23
25
|
```sh
|
|
24
26
|
npx skills add TaoMachina/truemap --skill truemap
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
Then
|
|
29
|
+
Then talk to your agent (Claude Code or Codex) as usual: *"How does payment work?"* or *"Show me the project."* The agent writes or updates a page and opens it. You can also ask directly: `/truemap draw the architecture`.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
No skill installed? Tell the agent: *"use `npx -y truemap-cli --help`"*.
|
|
30
32
|
|
|
31
33
|
## How it works
|
|
32
34
|
|
|
33
35
|
```
|
|
34
36
|
your repo/
|
|
35
37
|
└── .truemap/
|
|
36
|
-
├── index.html
|
|
38
|
+
├── index.html the blueprint: every module links to its page
|
|
37
39
|
├── payments.html
|
|
38
40
|
├── retry-decision.html
|
|
39
|
-
└── assets/
|
|
41
|
+
└── assets/theme.css optional: your brand colors and font
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
| Command (run by the agent) | What it does |
|
|
43
45
|
|---|---|
|
|
44
|
-
| `npx -y truemap-cli [page]` | Opens the workspace in your browser
|
|
45
|
-
| `npx -y truemap-cli
|
|
46
|
-
| `npx -y truemap-cli
|
|
46
|
+
| `npx -y truemap-cli [page] [--annotate]` | Opens the workspace in your browser, or switches the tab you already have open |
|
|
47
|
+
| `npx -y truemap-cli outline` | A compact map of the repo, so the first blueprint takes minutes, not an hour |
|
|
48
|
+
| `npx -y truemap-cli listen` | Waits for your next message or comments from the page |
|
|
49
|
+
| `npx -y truemap-cli reply "…" --listen` | Shows the answer in the conversation panel, then keeps listening |
|
|
47
50
|
| `npx -y truemap-cli check` | Checks every `data-src` anchor against the code |
|
|
48
|
-
| `npx -y truemap-cli guide` | The page-writing guide for agents:
|
|
51
|
+
| `npx -y truemap-cli guide` | The page-writing guide for agents: the map, anchors, decisions, design rules |
|
|
49
52
|
|
|
50
|
-
The checker
|
|
53
|
+
The checker works for any language. It uses git and a plain-text search:
|
|
51
54
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
55
|
+
- **No longer matches**: the path is gone, or `#name` no longer appears in the file (whole word, case-sensitive).
|
|
56
|
+
- **Changed in code**: the file changed after the page was last updated. The agent reviews it, then updates the page or runs `check --ok`.
|
|
54
57
|
|
|
55
|
-
Everything runs
|
|
58
|
+
Everything runs on your machine:
|
|
56
59
|
|
|
57
|
-
- The server listens on `127.0.0.1` only and needs a token
|
|
58
|
-
- Pages render in a sandboxed
|
|
60
|
+
- The server listens on `127.0.0.1` only and needs a per-launch token.
|
|
61
|
+
- Pages render in a sandboxed frame on a separate origin, so page scripts can't reach the agent.
|
|
62
|
+
- Nothing leaves your machine. truemap keeps a local log of which commands ran (`~/.truemap/usage.jsonl`) and the chat history per repo (`~/.truemap/history/`); delete them any time.
|
|
59
63
|
|
|
60
64
|
## Requirements
|
|
61
65
|
|
|
@@ -64,5 +68,4 @@ Everything runs locally:
|
|
|
64
68
|
|
|
65
69
|
## License
|
|
66
70
|
|
|
67
|
-
MIT
|
|
68
|
-
|
|
71
|
+
MIT. Fonts: IBM Plex Sans and IBM Plex Mono, SIL Open Font License (`kit/fonts/OFL.txt`).
|
package/bin/truemap.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { main } from '../src/cli.js';
|
|
3
3
|
|
|
4
|
+
// A reader that stops early (e.g. `| head`) is not an error.
|
|
5
|
+
process.stdout.on('error', (e) => { if (e.code === 'EPIPE') process.exit(0); throw e; });
|
|
6
|
+
|
|
4
7
|
main(process.argv.slice(2)).catch((err) => {
|
|
5
8
|
process.stdout.write(`status: error\nerror: ${JSON.stringify(String(err?.message || err))}\n`);
|
|
6
9
|
process.exit(1);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2019 IBM Corp. All rights reserved. IBMPlexSans-Italic[wdth,wght].ttf: Copyright 2019 IBM Corp. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|