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/README.md CHANGED
@@ -1,61 +1,66 @@
1
+ <img src="docs/images/mark.svg" width="44" height="44" alt="">
2
+
1
3
  # truemap
2
4
 
3
- **Agents explain your project with living HTML pages that stay true to the code.**
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
+ ![The truemap workspace: a project blueprint with wires, a comment pinned to a box, and the agent's answer in the conversation panel](docs/images/workspace.png)
8
10
 
9
11
  ## Why
10
12
 
11
- Coding agents write code faster than anyone can read it. Their answers come back as walls of text, and the diagrams they draw are thrown away after one chat. truemap gives the agent a better way to talk to you:
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 an HTML page and opens it in your browser.
14
- - **Point and ask.** Click a box on the page, ask in the chat panel next to it. The agent receives your question *and* the code that box points to. It is the same agent session you are already using, so there is no new login or extra app.
15
- - **Click to decide.** When the agent needs your call, the page shows options. One click and the answer goes back to the agent.
16
- - **Pages that stay true.** Every box carries a `data-src="path#name"` anchor. When the code moves on, truemap marks the box amber (changed) or red (gone), and the agent fixes the page.
17
- - **It all stays in the repo.** Pages live in `.truemap/`, with `index.html` as the project blueprint. They are plain files you can commit, diff, and open anywhere.
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 all the setup there 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 just talk to your agent (Claude Code or Codex): *"How does payment work?"* or *"Show me the project."* The agent writes or updates a page and opens it. You can also ask for it directly: `/truemap show me the architecture`.
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
- It also works with no skill installed. Tell the agent: *"use `npx -y truemap-cli --help`"*.
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 the blueprint: every module links to its page
38
+ ├── index.html the blueprint: every module links to its page
37
39
  ├── payments.html
38
40
  ├── retry-decision.html
39
- └── assets/truemap.css shared look (edit the tokens to match your brand)
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: page switcher on top, the page in the middle, chat on the right (collapsible) |
45
- | `npx -y truemap-cli listen` | Waits for your next message from the chat panel |
46
- | `npx -y truemap-cli reply "…" --listen` | Shows the agent's answer in the chat, then keeps listening |
47
- | `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: kit components, anchors, decision forms |
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 |
50
+ | `npx -y truemap-cli check` | Checks every `data-src` anchor against the code, and that every map wire has a target |
51
+ | `npx -y truemap-cli export <page>` | Writes the page as one self-contained HTML file to share (also in the workspace ⋮ menu) |
52
+ | `npx -y truemap-cli guide` | The page-writing guide for agents: the map, anchors, decisions, design rules |
49
53
 
50
- The checker doesn't depend on the programming language. It uses only git and a plain-text search:
54
+ The checker works for any language. It uses git and a plain-text search:
51
55
 
52
- - **✕ broken**: the path is gone, or `#name` no longer appears in the file (whole word, case-sensitive).
53
- - **● changed**: the file changed after the page was last updated. The agent reviews it, then updates the page or runs `check --ok`.
56
+ - **No longer matches**: the path is gone, or `#name` no longer appears in the file (whole word, case-sensitive).
57
+ - **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
58
 
55
- Everything runs locally:
59
+ Everything runs on your machine:
56
60
 
57
- - The server listens on `127.0.0.1` only and needs a token for every request.
58
- - Pages render in a sandboxed iframe on a separate origin, so page scripts can't reach the chat API.
61
+ - The server listens on `127.0.0.1` only and needs a per-launch token.
62
+ - Pages render in a sandboxed frame on a separate origin, so page scripts can't reach the agent.
63
+ - 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
64
 
60
65
  ## Requirements
61
66
 
@@ -64,5 +69,4 @@ Everything runs locally:
64
69
 
65
70
  ## License
66
71
 
67
- MIT
68
-
72
+ 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.