@taciturnaxolotl/traverse 0.1.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/LICENSE.md +10 -0
- package/README.md +77 -0
- package/bin/traverse.js +21 -0
- package/icon.svg +5 -0
- package/package.json +28 -0
- package/src/config.ts +32 -0
- package/src/index.ts +542 -0
- package/src/storage.ts +62 -0
- package/src/template.ts +973 -0
- package/src/types.ts +22 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# The O'Saasy License
|
|
2
|
+
|
|
3
|
+
Copyright © `2026` `Kieran Klukas`
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
No licensee or downstream recipient may use the Software (including any modified or derivative versions) to directly compete with the original Licensor by offering it to third parties as a hosted, managed, or Software-as-a-Service (SaaS) product or cloud service where the primary value of the service is the functionality of the Software itself.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# traverse
|
|
2
|
+
|
|
3
|
+
interactive code walkthrough diagrams via MCP. share them with anyone.
|
|
4
|
+
|
|
5
|
+
The canonical repo for this is hosted on tangled over at [`dunkirk.sh/traverse`](https://tangled.org/@dunkirk.sh/traverse)
|
|
6
|
+
|
|
7
|
+
## install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bunx @taciturnaxolotl/traverse
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
requires [bun](https://bun.sh). runs an MCP server on stdio and a web server on `localhost:4173`.
|
|
14
|
+
|
|
15
|
+
## usage
|
|
16
|
+
|
|
17
|
+
add to your MCP client config:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"traverse": {
|
|
23
|
+
"command": "bunx",
|
|
24
|
+
"args": ["@taciturnaxolotl/traverse"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
your AI calls the `walkthrough_diagram` tool with mermaid code + node descriptions, and you get a clickable diagram in your browser.
|
|
31
|
+
|
|
32
|
+
diagrams persist to sqlite at `~/Library/Application Support/traverse/traverse.db` (macOS) or `$XDG_DATA_HOME/traverse/traverse.db` (linux). override with `TRAVERSE_DATA_DIR`.
|
|
33
|
+
|
|
34
|
+
## sharing
|
|
35
|
+
|
|
36
|
+
click the share button on any diagram to upload it to `traverse.dunkirk.sh` and copy a public link.
|
|
37
|
+
|
|
38
|
+
configure the share server in `~/Library/Application Support/traverse/config.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"shareServerUrl": "https://traverse.dunkirk.sh"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
or set `TRAVERSE_SHARE_URL`.
|
|
47
|
+
|
|
48
|
+
## server mode
|
|
49
|
+
|
|
50
|
+
run your own share server:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
TRAVERSE_MODE=server bun run src/index.ts
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
accepts `POST /api/diagrams` with a diagram JSON body, returns `{ id, url }`.
|
|
57
|
+
|
|
58
|
+
## env vars
|
|
59
|
+
|
|
60
|
+
| var | default | description |
|
|
61
|
+
|-----|---------|-------------|
|
|
62
|
+
| `TRAVERSE_PORT` | `4173` | web server port |
|
|
63
|
+
| `TRAVERSE_MODE` | `local` | `local` (mcp + web) or `server` (web only) |
|
|
64
|
+
| `TRAVERSE_SHARE_URL` | `https://traverse.dunkirk.sh` | share server url |
|
|
65
|
+
| `TRAVERSE_DATA_DIR` | platform default | sqlite db location |
|
|
66
|
+
|
|
67
|
+
<p align="center">
|
|
68
|
+
<img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/main/.github/images/line-break.svg" />
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
<p align="center">
|
|
72
|
+
<i><code>© 2026-present <a href="https://dunkirk.sh">Kieran Klukas</a></code></i>
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
<p align="center">
|
|
76
|
+
<a href="https://tangled.org/dunkirk.sh/traverse/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=O'Saasy&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
|
|
77
|
+
</p>
|
package/bin/traverse.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync, execFileSync } = require("child_process");
|
|
4
|
+
const { resolve } = require("path");
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
execSync("bun --version", { stdio: "ignore" });
|
|
8
|
+
} catch {
|
|
9
|
+
console.error("Traverse requires Bun to run.");
|
|
10
|
+
console.error("");
|
|
11
|
+
console.error(" Install it: curl -fsSL https://bun.sh/install | bash");
|
|
12
|
+
console.error(" Learn more: https://bun.sh");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const entry = resolve(__dirname, "..", "src", "index.ts");
|
|
17
|
+
try {
|
|
18
|
+
execFileSync("bun", ["run", entry], { stdio: "inherit" });
|
|
19
|
+
} catch (e) {
|
|
20
|
+
process.exit(e.status ?? 1);
|
|
21
|
+
}
|
package/icon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="1024" height="1024" fill="#191919"/>
|
|
3
|
+
<rect x="124.5" y="193.5" width="774" height="637" stroke="white" stroke-width="41"/>
|
|
4
|
+
<path d="M524.021 291.979C517.382 285.34 506.618 285.34 499.979 291.979L391.792 400.167C385.153 406.805 385.153 417.569 391.792 424.208C398.431 430.847 409.195 430.847 415.833 424.208L512 328.042L608.167 424.208C614.805 430.847 625.569 430.847 632.208 424.208C638.847 417.569 638.847 406.805 632.208 400.167L524.021 291.979ZM512 764H529V304H512H495V764H512Z" fill="white"/>
|
|
5
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taciturnaxolotl/traverse",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Interactive code walkthrough diagrams via MCP",
|
|
5
|
+
"module": "src/index.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"traverse": "./bin/traverse.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"bin",
|
|
13
|
+
"icon.svg"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "bun run src/index.ts",
|
|
17
|
+
"dev": "bun --hot run src/index.ts"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/bun": "latest"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"typescript": "^5"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.26.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import type { TraverseConfig } from "./types.ts";
|
|
4
|
+
|
|
5
|
+
const DEFAULT_SHARE_URL = "https://traverse.dunkirk.sh";
|
|
6
|
+
|
|
7
|
+
function getConfigDir(): string {
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
if (platform === "darwin") {
|
|
10
|
+
return join(homedir(), "Library", "Application Support", "traverse");
|
|
11
|
+
}
|
|
12
|
+
const xdg = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
13
|
+
return join(xdg, "traverse");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function loadConfig(): TraverseConfig {
|
|
17
|
+
if (process.env.TRAVERSE_SHARE_URL) {
|
|
18
|
+
return { shareServerUrl: process.env.TRAVERSE_SHARE_URL };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const configPath = join(getConfigDir(), "config.json");
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const text = require("node:fs").readFileSync(configPath, "utf-8");
|
|
25
|
+
const parsed = JSON.parse(text);
|
|
26
|
+
return {
|
|
27
|
+
shareServerUrl: parsed.shareServerUrl || DEFAULT_SHARE_URL,
|
|
28
|
+
};
|
|
29
|
+
} catch {
|
|
30
|
+
return { shareServerUrl: DEFAULT_SHARE_URL };
|
|
31
|
+
}
|
|
32
|
+
}
|