teemux 1.8.0 → 1.9.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 +83 -21
- package/dist/client/client.js +10 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/teemux.js +225 -544
- package/dist/teemux.js.map +1 -1
- package/package.json +22 -5
- package/src/LogServer.ts +68 -534
- package/src/McpHandler.test.ts +428 -0
- package/src/McpHandler.ts +307 -0
- package/src/client/App.tsx +200 -0
- package/src/client/components/ClearButton.tsx +82 -0
- package/src/client/components/FilterBar.tsx +106 -0
- package/src/client/components/JsonView.tsx +465 -0
- package/src/client/components/LogContainer.tsx +188 -0
- package/src/client/components/LogRow.tsx +469 -0
- package/src/client/components/SummaryCapsules.tsx +115 -0
- package/src/client/components/TailButton.tsx +62 -0
- package/src/client/contexts/ColumnWidthContext.tsx +54 -0
- package/src/client/favicon.ico +0 -0
- package/src/client/hooks/useLogState.ts +285 -0
- package/src/client/main.tsx +44 -0
- package/src/client/panda.config.ts +164 -0
- package/src/client/postcss.config.cjs +5 -0
- package/src/client/styled-system/css/conditions.mjs +36 -0
- package/src/client/styled-system/css/css.d.ts +22 -0
- package/src/client/styled-system/css/css.mjs +45 -0
- package/src/client/styled-system/css/cva.d.ts +6 -0
- package/src/client/styled-system/css/cva.mjs +87 -0
- package/src/client/styled-system/css/cx.d.ts +5 -0
- package/src/client/styled-system/css/cx.mjs +15 -0
- package/src/client/styled-system/css/index.d.ts +5 -0
- package/src/client/styled-system/css/index.mjs +4 -0
- package/src/client/styled-system/css/sva.d.ts +4 -0
- package/src/client/styled-system/css/sva.mjs +46 -0
- package/src/client/styled-system/helpers.mjs +316 -0
- package/src/client/styled-system/patterns/aspect-ratio.d.ts +20 -0
- package/src/client/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/src/client/styled-system/patterns/bleed.d.ts +21 -0
- package/src/client/styled-system/patterns/bleed.mjs +24 -0
- package/src/client/styled-system/patterns/box.d.ts +20 -0
- package/src/client/styled-system/patterns/box.mjs +15 -0
- package/src/client/styled-system/patterns/center.d.ts +20 -0
- package/src/client/styled-system/patterns/center.mjs +21 -0
- package/src/client/styled-system/patterns/circle.d.ts +20 -0
- package/src/client/styled-system/patterns/circle.mjs +25 -0
- package/src/client/styled-system/patterns/container.d.ts +20 -0
- package/src/client/styled-system/patterns/container.mjs +21 -0
- package/src/client/styled-system/patterns/cq.d.ts +21 -0
- package/src/client/styled-system/patterns/cq.mjs +21 -0
- package/src/client/styled-system/patterns/divider.d.ts +22 -0
- package/src/client/styled-system/patterns/divider.mjs +25 -0
- package/src/client/styled-system/patterns/flex.d.ts +26 -0
- package/src/client/styled-system/patterns/flex.mjs +26 -0
- package/src/client/styled-system/patterns/float.d.ts +23 -0
- package/src/client/styled-system/patterns/float.mjs +52 -0
- package/src/client/styled-system/patterns/grid-item.d.ts +25 -0
- package/src/client/styled-system/patterns/grid-item.mjs +25 -0
- package/src/client/styled-system/patterns/grid.d.ts +24 -0
- package/src/client/styled-system/patterns/grid.mjs +27 -0
- package/src/client/styled-system/patterns/hstack.d.ts +21 -0
- package/src/client/styled-system/patterns/hstack.mjs +24 -0
- package/src/client/styled-system/patterns/index.d.ts +21 -0
- package/src/client/styled-system/patterns/index.mjs +20 -0
- package/src/client/styled-system/patterns/link-overlay.d.ts +20 -0
- package/src/client/styled-system/patterns/link-overlay.mjs +24 -0
- package/src/client/styled-system/patterns/spacer.d.ts +20 -0
- package/src/client/styled-system/patterns/spacer.mjs +21 -0
- package/src/client/styled-system/patterns/square.d.ts +20 -0
- package/src/client/styled-system/patterns/square.mjs +24 -0
- package/src/client/styled-system/patterns/stack.d.ts +23 -0
- package/src/client/styled-system/patterns/stack.mjs +24 -0
- package/src/client/styled-system/patterns/visually-hidden.d.ts +20 -0
- package/src/client/styled-system/patterns/visually-hidden.mjs +18 -0
- package/src/client/styled-system/patterns/vstack.d.ts +21 -0
- package/src/client/styled-system/patterns/vstack.mjs +24 -0
- package/src/client/styled-system/patterns/wrap.d.ts +24 -0
- package/src/client/styled-system/patterns/wrap.mjs +25 -0
- package/src/client/styled-system/styles.css +756 -0
- package/src/client/styled-system/tokens/index.d.ts +9 -0
- package/src/client/styled-system/tokens/index.mjs +280 -0
- package/src/client/styled-system/tokens/tokens.d.ts +39 -0
- package/src/client/styled-system/types/composition.d.ts +227 -0
- package/src/client/styled-system/types/conditions.d.ts +310 -0
- package/src/client/styled-system/types/csstype.d.ts +21298 -0
- package/src/client/styled-system/types/global.d.ts +20 -0
- package/src/client/styled-system/types/index.d.ts +7 -0
- package/src/client/styled-system/types/parts.d.ts +8 -0
- package/src/client/styled-system/types/pattern.d.ts +78 -0
- package/src/client/styled-system/types/prop-type.d.ts +230 -0
- package/src/client/styled-system/types/recipe.d.ts +181 -0
- package/src/client/styled-system/types/selectors.d.ts +59 -0
- package/src/client/styled-system/types/static-css.d.ts +56 -0
- package/src/client/styled-system/types/style-props.d.ts +7504 -0
- package/src/client/styled-system/types/system-types.d.ts +269 -0
- package/src/client/tsconfig.json +25 -0
- package/src/client/types.ts +36 -0
- package/src/client/utils/extractJson.ts +134 -0
- package/src/client/utils/filtering.ts +51 -0
- package/src/client/utils/highlighting.ts +43 -0
- package/src/client/utils/summary.ts +74 -0
- package/src/client/vite.config.ts +30 -0
- /package/src/{ansi-to-html.d.ts → ansiToHtml.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/teemux.png" alt="teemux" width="120" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">teemux</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Aggregate logs from multiple processes in a single view</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
View in browser or terminal • Filter with patterns • Stream to AI agents via MCP
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://www.npmjs.com/package/teemux"><img src="https://img.shields.io/npm/v/teemux.svg" alt="npm version" /></a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/teemux"><img src="https://img.shields.io/npm/dm/teemux.svg" alt="npm downloads" /></a>
|
|
18
|
+
<a href="https://github.com/gajus/teemux/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/teemux.svg" alt="license" /></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
4
22
|
|
|
5
23
|
## Motivation
|
|
6
24
|
|
|
7
25
|
* Needed a simple way to browse logs aggregated across multiple processes.
|
|
8
|
-
* Needed a simple way to
|
|
26
|
+
* Needed a simple way to give agents a unified view of all the logs
|
|
9
27
|
|
|
10
28
|
## Install
|
|
11
29
|
|
|
@@ -29,7 +47,8 @@ The first process starts a local server on port 8336. Others connect automatical
|
|
|
29
47
|
|--------|-------|---------|-------------|
|
|
30
48
|
| `--name` | `-n` | command name | Identifier for this process in logs |
|
|
31
49
|
| `--port` | `-p` | 8336 | Port for the log aggregation server |
|
|
32
|
-
| `--
|
|
50
|
+
| `--buffer` | `-b` | 10000 | Number of log lines to keep in server buffer |
|
|
51
|
+
| `--force-leader` | `-f` | false | Force this process to become the leader, replacing any existing leader |
|
|
33
52
|
|
|
34
53
|
All options can also be set via environment variables with `TEEMUX_` prefix:
|
|
35
54
|
|
|
@@ -55,32 +74,62 @@ curl http://127.0.0.1:8336/
|
|
|
55
74
|
|
|
56
75
|
Plain text stream of all logs.
|
|
57
76
|
|
|
58
|
-
###
|
|
77
|
+
### MCP Server for AI Agents
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
teemux includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables AI agents to programmatically access logs in your development environment. This makes it easy for coding assistants like Claude, Cursor, or other AI tools to inspect application logs, search for errors, and understand what's happening in your running processes.
|
|
61
80
|
|
|
62
|
-
|
|
63
|
-
## Viewing Logs
|
|
81
|
+
The MCP server runs on the same port as the HTTP server at `/mcp` and provides these tools:
|
|
64
82
|
|
|
65
|
-
|
|
83
|
+
| Tool | Description | Parameters |
|
|
84
|
+
|------|-------------|------------|
|
|
85
|
+
| `get_logs` | Get recent logs from buffer | `limit?`, `include?`, `exclude?` |
|
|
86
|
+
| `search_logs` | Search logs with patterns | `limit?`, `include?`, `exclude?` |
|
|
87
|
+
| `clear_logs` | Clear the log buffer | none |
|
|
88
|
+
| `get_process_names` | List all process names that have logged | none |
|
|
66
89
|
|
|
67
|
-
|
|
68
|
-
# View all recent logs
|
|
69
|
-
curl http://127.0.0.1:8336/
|
|
90
|
+
#### Configuring your AI agent
|
|
70
91
|
|
|
71
|
-
|
|
72
|
-
curl "http://127.0.0.1:8336/?include=api"
|
|
92
|
+
Add teemux as an MCP server in your AI tool's configuration. For Claude Code, add to your MCP settings:
|
|
73
93
|
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"teemux": {
|
|
98
|
+
"url": "http://127.0.0.1:8336/mcp"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
76
103
|
|
|
77
|
-
|
|
78
|
-
|
|
104
|
+
Once configured, your AI agent can:
|
|
105
|
+
- **Inspect logs** when debugging issues ("What errors are in the logs?")
|
|
106
|
+
- **Search for specific events** ("Find all database connection errors")
|
|
107
|
+
- **Monitor processes** ("What processes are currently running?")
|
|
108
|
+
- **Clear logs** to start fresh when testing
|
|
109
|
+
|
|
110
|
+
#### Example MCP usage
|
|
79
111
|
|
|
80
|
-
|
|
81
|
-
|
|
112
|
+
```bash
|
|
113
|
+
# Initialize session
|
|
114
|
+
curl -X POST http://127.0.0.1:8336/mcp \
|
|
115
|
+
-H "Content-Type: application/json" \
|
|
116
|
+
-H "Accept: application/json, text/event-stream" \
|
|
117
|
+
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}'
|
|
118
|
+
|
|
119
|
+
# List available tools (use session ID from response above)
|
|
120
|
+
curl -X POST http://127.0.0.1:8336/mcp \
|
|
121
|
+
-H "Content-Type: application/json" \
|
|
122
|
+
-H "Accept: application/json, text/event-stream" \
|
|
123
|
+
-H "mcp-session-id: <session-id>" \
|
|
124
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}'
|
|
125
|
+
|
|
126
|
+
# Get recent logs
|
|
127
|
+
curl -X POST http://127.0.0.1:8336/mcp \
|
|
128
|
+
-H "Content-Type: application/json" \
|
|
129
|
+
-H "Accept: application/json, text/event-stream" \
|
|
130
|
+
-H "mcp-session-id: <session-id>" \
|
|
131
|
+
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_logs","arguments":{"limit":50}},"id":3}'
|
|
82
132
|
```
|
|
83
|
-
````
|
|
84
133
|
|
|
85
134
|
### Filtering Logs
|
|
86
135
|
|
|
@@ -181,3 +230,16 @@ teemux --name db -- docker run --rm my-database
|
|
|
181
230
|
The flags:
|
|
182
231
|
- `-i` = keep stdin open (for interactive input) ✅
|
|
183
232
|
- `-t` = allocate pseudo-TTY (adds terminal formatting) ❌
|
|
233
|
+
|
|
234
|
+
## Developing
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Install dependencies
|
|
238
|
+
npm install
|
|
239
|
+
|
|
240
|
+
# Build and watch for changes
|
|
241
|
+
npm run dev
|
|
242
|
+
|
|
243
|
+
# In another terminal, run with fake logs
|
|
244
|
+
node dist/teemux.js -- node scripts/fake-logs.js
|
|
245
|
+
```
|