paean 0.8.4 β 0.8.6
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 +23 -0
- package/README.md +126 -96
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/renderer.d.ts +0 -53
- package/dist/agent/renderer.d.ts.map +1 -1
- package/dist/agent/renderer.js +2 -111
- package/dist/agent/renderer.js.map +1 -1
- package/dist/api/worker-api.d.ts +164 -0
- package/dist/api/worker-api.d.ts.map +1 -0
- package/dist/api/worker-api.js +87 -0
- package/dist/api/worker-api.js.map +1 -0
- package/dist/mcp/cli-agent-tools.d.ts +21 -0
- package/dist/mcp/cli-agent-tools.d.ts.map +1 -0
- package/dist/mcp/cli-agent-tools.js +457 -0
- package/dist/mcp/cli-agent-tools.js.map +1 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +12 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/ui/components/Header.d.ts.map +1 -1
- package/dist/ui/components/Header.js +6 -3
- package/dist/ui/components/Header.js.map +1 -1
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +5 -2
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/hooks/index.d.ts +1 -0
- package/dist/ui/hooks/index.d.ts.map +1 -1
- package/dist/ui/hooks/index.js +1 -0
- package/dist/ui/hooks/index.js.map +1 -1
- package/dist/ui/hooks/useTerminalSize.d.ts +14 -0
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalSize.js +34 -0
- package/dist/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/theme/branding.d.ts +0 -4
- package/dist/ui/theme/branding.d.ts.map +1 -1
- package/dist/ui/theme/branding.js +1 -38
- package/dist/ui/theme/branding.js.map +1 -1
- package/dist/ui/theme/index.d.ts +0 -1
- package/dist/ui/theme/index.d.ts.map +1 -1
- package/dist/ui/theme/index.js +0 -1
- package/dist/ui/theme/index.js.map +1 -1
- package/dist/ui/theme/ink-theme.d.ts +1 -1
- package/dist/ui/theme/ink-theme.d.ts.map +1 -1
- package/dist/ui/theme/ink-theme.js +15 -10
- package/dist/ui/theme/ink-theme.js.map +1 -1
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/worker/config.d.ts +101 -0
- package/dist/worker/config.d.ts.map +1 -0
- package/dist/worker/config.js +181 -0
- package/dist/worker/config.js.map +1 -0
- package/dist/worker/executors/index.d.ts +4 -2
- package/dist/worker/executors/index.d.ts.map +1 -1
- package/dist/worker/executors/index.js.map +1 -1
- package/dist/worker/index.d.ts +2 -1
- package/dist/worker/index.d.ts.map +1 -1
- package/dist/worker/index.js +4 -0
- package/dist/worker/index.js.map +1 -1
- package/dist/worker/service.d.ts +56 -1
- package/dist/worker/service.d.ts.map +1 -1
- package/dist/worker/service.js +241 -19
- package/dist/worker/service.js.map +1 -1
- package/dist/worker/types.d.ts +42 -0
- package/dist/worker/types.d.ts.map +1 -1
- package/dist/worker/types.js +31 -13
- package/dist/worker/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.6] - Responsive Terminal Layout (2026-01-26)
|
|
4
|
+
|
|
5
|
+
### β¨ Features
|
|
6
|
+
- **Responsive Layout**: Added `useTerminalSize` hook for dynamic re-rendering on terminal resize.
|
|
7
|
+
- **Dynamic Separators**: Header and InputArea components now respond to window size changes in real-time.
|
|
8
|
+
|
|
9
|
+
### π§ Technical
|
|
10
|
+
- New `useTerminalSize` hook using Ink's `useStdout` for reactive terminal dimensions.
|
|
11
|
+
- Improved UX with separator lines that automatically adjust to terminal width.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.8.5] - UI Cleanup and UX Enhancements (2026-01-26)
|
|
15
|
+
|
|
16
|
+
### β¨ Features
|
|
17
|
+
- **CWD Display**: Added current working directory display in the interactive session header for better spatial awareness.
|
|
18
|
+
|
|
19
|
+
### π§Ή Cleanup & Refactoring
|
|
20
|
+
- **Branding Consolidation**: Removed legacy ASCII logos and assets from `branding.ts`.
|
|
21
|
+
- **Theme Simplification**: Shifted to `ink-theme.ts` as the single source of truth for all UI assets.
|
|
22
|
+
- **Renderer Cleanup**: Removed over 12 unused legacy renderer functions to streamline the codebase and focus exclusively on Ink-based rendering.
|
|
23
|
+
- **Improved Type Safety**: Fixed internal lint errors and refined exports in the agent module.
|
|
24
|
+
|
|
25
|
+
|
|
3
26
|
## [0.7.7] - Bug Fixes and UX Improvements (2026-01-22)
|
|
4
27
|
|
|
5
28
|
### π Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
# Paean CLI
|
|
2
2
|
|
|
3
|
-
> Claude Code-like AI agent with local MCP integration and task management
|
|
3
|
+
> Claude Code-like AI agent with local autonomous workers, MCP integration, and task management
|
|
4
4
|
|
|
5
|
-
**Paean CLI** is a
|
|
5
|
+
**Paean CLI** is a next-generation AI command-line interface designed for autonomous development. It combines interactive chat with powerful background workers and intelligent task routing.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
## β¨ Key Features
|
|
8
|
+
|
|
9
|
+
- **π€ Interactive Agent Mode**: Chat with AI that understands your project context
|
|
10
|
+
- **π· Autonomous Worker**: Background service for continuous task execution (24/7 operation)
|
|
11
|
+
- **π§ Planning & Analysis**: Pre-flight project analysis and risk assessment
|
|
12
|
+
- **π Local MCP Integration**: Connect any Model Context Protocol server
|
|
13
|
+
- **π¦ Intelligent Routing**: Auto-routes tasks to the best executor (Internal, Claude, Gemini, Cursor)
|
|
14
|
+
- **π Observability**: Full execution tracing and token cost tracking
|
|
11
15
|
|
|
12
16
|
## Installation
|
|
13
17
|
|
|
@@ -18,7 +22,7 @@ bun add -g paean
|
|
|
18
22
|
# Or use npm
|
|
19
23
|
npm install -g paean
|
|
20
24
|
|
|
21
|
-
# Or
|
|
25
|
+
# Or run directly
|
|
22
26
|
npx paean
|
|
23
27
|
```
|
|
24
28
|
|
|
@@ -30,102 +34,113 @@ npx paean
|
|
|
30
34
|
paean login
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
### 2.
|
|
37
|
+
### 2. Interactive Agent (Default)
|
|
38
|
+
|
|
39
|
+
The standard mode for day-to-day assistance.
|
|
34
40
|
|
|
35
41
|
```bash
|
|
36
|
-
#
|
|
42
|
+
# Start interactive chat
|
|
37
43
|
paean
|
|
38
44
|
|
|
39
|
-
#
|
|
40
|
-
paean
|
|
45
|
+
# With planning mode (analyzes project before starting)
|
|
46
|
+
paean --plan
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
### 3.
|
|
49
|
+
### 3. Autonomous Worker
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
Offload long-running or complex tasks to the background worker.
|
|
46
52
|
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
53
|
+
```bash
|
|
54
|
+
# Execute a task using natural language (auto-detects strategy)
|
|
55
|
+
paean worker prompt "Refactor the authentication module to use JWT"
|
|
56
|
+
|
|
57
|
+
# Start the worker loop to process background tasks
|
|
58
|
+
paean worker start
|
|
56
59
|
```
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
## π Intelligent Worker System
|
|
62
|
+
|
|
63
|
+
The new **Paean Worker** allows for autonomous task execution with intelligent routing.
|
|
64
|
+
|
|
65
|
+
### Quick Prompts (`paean prompt` / `paean worker prompt`)
|
|
66
|
+
|
|
67
|
+
Execute tasks without entering a chat session. The supervisor agent analyzes your request and decides the best execution strategy:
|
|
68
|
+
- **Direct**: Simple tasks executed immediately
|
|
69
|
+
- **Chain**: Sequential dependent steps for complex flows
|
|
70
|
+
- **Batch**: Parallel independent tasks for bulk operations
|
|
59
71
|
|
|
60
72
|
```bash
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
# Simple usage
|
|
74
|
+
paean prompt "Analyze the current project structure"
|
|
75
|
+
|
|
76
|
+
# Force specific executor
|
|
77
|
+
paean prompt "Fix the login bug" --executor cursor
|
|
78
|
+
|
|
79
|
+
# Create a planned chain of tasks
|
|
80
|
+
paean prompt "Refactor utils, then update tests, then run build" --chain
|
|
66
81
|
```
|
|
67
82
|
|
|
68
|
-
|
|
83
|
+
### Continuous Worker Mode
|
|
84
|
+
|
|
85
|
+
Start a persistent worker that polls for and executes tasks 24/7.
|
|
69
86
|
|
|
70
87
|
```bash
|
|
71
|
-
paean
|
|
72
|
-
paean --no-mcp # Disable local MCP integration
|
|
73
|
-
paean -d, --debug # Enable debug logging
|
|
74
|
-
paean -m "message" # Send a single message
|
|
88
|
+
paean worker start
|
|
75
89
|
```
|
|
76
90
|
|
|
77
|
-
|
|
91
|
+
Options:
|
|
92
|
+
- `--interval <ms>`: Polling interval (default: 30000ms)
|
|
93
|
+
- `--max-retries <n>`: Max retry attempts per task
|
|
94
|
+
- `--no-verification`: Disable the post-execution verification step
|
|
95
|
+
|
|
96
|
+
### Available Executors
|
|
97
|
+
|
|
98
|
+
The supervisor routes tasks to specialized executors:
|
|
99
|
+
- **Internal**: Built-in Paean agent (default)
|
|
100
|
+
- **Claude**: Uses `claude` CLI for complex logic
|
|
101
|
+
- **Cursor**: Uses Cursor Agent for context-aware edits
|
|
102
|
+
- **Gemini**: Specialized for large context analysis
|
|
103
|
+
- **Codex**: Optimized for code generation
|
|
104
|
+
|
|
105
|
+
## π Observability & Trace
|
|
106
|
+
|
|
107
|
+
Debug and analyze your agent's performance with the built-in trace system.
|
|
78
108
|
|
|
79
109
|
```bash
|
|
80
|
-
|
|
81
|
-
paean
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
# View latest execution trace
|
|
111
|
+
paean trace --latest
|
|
112
|
+
|
|
113
|
+
# List all traces
|
|
114
|
+
paean trace
|
|
115
|
+
|
|
116
|
+
# Generate a usage report (success rates, token usage)
|
|
117
|
+
paean trace --report
|
|
84
118
|
```
|
|
85
119
|
|
|
86
|
-
##
|
|
120
|
+
## π οΈ Utility Commands
|
|
87
121
|
|
|
88
|
-
|
|
122
|
+
### Context Generation
|
|
89
123
|
|
|
90
|
-
|
|
124
|
+
Generate a comprehensive context file for your AI agents (useful for manual prompt engineering).
|
|
91
125
|
|
|
92
|
-
|
|
126
|
+
```bash
|
|
127
|
+
# Generate Markdown context
|
|
128
|
+
paean context -o .agent/context.md
|
|
93
129
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"mcpServers": {
|
|
97
|
-
"paean": {
|
|
98
|
-
"command": "npx",
|
|
99
|
-
"args": ["paean", "serve"]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
130
|
+
# Generate JSON for tools
|
|
131
|
+
paean context --json
|
|
103
132
|
```
|
|
104
133
|
|
|
105
|
-
###
|
|
134
|
+
### Task Validation
|
|
106
135
|
|
|
107
|
-
|
|
108
|
-
| --------------------- | ------------------------------- |
|
|
109
|
-
| `paean_list_tasks` | List tasks with filters |
|
|
110
|
-
| `paean_create_task` | Create a new task |
|
|
111
|
-
| `paean_complete_task` | Mark a task as completed |
|
|
112
|
-
| `paean_update_task` | Update task status/priority |
|
|
113
|
-
| `paean_add_subtask` | Add a subtask to an existing |
|
|
136
|
+
Verify if pending tasks have been completed by recent changes.
|
|
114
137
|
|
|
115
|
-
|
|
138
|
+
```bash
|
|
139
|
+
# Check status
|
|
140
|
+
paean validate
|
|
116
141
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
β You (CLI) ββββββΆβ Paean Cloud ββββββΆβ PΓ¦an Agent β
|
|
120
|
-
β (Agent Mode) β β (zero-api) β β (ADK) β
|
|
121
|
-
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
|
|
122
|
-
β β β
|
|
123
|
-
β β SSE: mcp_tool_call β
|
|
124
|
-
βΌ βΌ β
|
|
125
|
-
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
126
|
-
β Local MCP β
|
|
127
|
-
β (vibe-kanban) β β Executes locally, returns result
|
|
128
|
-
βββββββββββββββββββ
|
|
142
|
+
# Check and auto-complete valid tasks
|
|
143
|
+
paean validate --auto-complete
|
|
129
144
|
```
|
|
130
145
|
|
|
131
146
|
## Configuration
|
|
@@ -134,17 +149,49 @@ Config stored in `~/.paean/`:
|
|
|
134
149
|
|
|
135
150
|
- `config.json` - Auth and preferences
|
|
136
151
|
- `mcp_config.json` - MCP server configuration
|
|
152
|
+
- `traces/` - Execution logs and debug data
|
|
137
153
|
|
|
138
|
-
|
|
154
|
+
### MCP Configuration
|
|
139
155
|
|
|
140
|
-
|
|
141
|
-
import { agentService, startChat, McpClient } from 'paean';
|
|
156
|
+
Add servers to `~/.paean/mcp_config.json`:
|
|
142
157
|
|
|
143
|
-
|
|
144
|
-
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"git": {
|
|
162
|
+
"command": "npx",
|
|
163
|
+
"args": ["-y", "@modelcontextprotocol/server-git"]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Architecture
|
|
145
170
|
|
|
146
|
-
|
|
147
|
-
|
|
171
|
+
```
|
|
172
|
+
βββββββββββββββββ βββββββββββββββββ
|
|
173
|
+
β Interactive β β Autonomous β
|
|
174
|
+
β Agent UI β β Worker β
|
|
175
|
+
βββββββββ¬ββββββββ βββββββββ¬ββββββββ
|
|
176
|
+
β β
|
|
177
|
+
βΌ βΌ
|
|
178
|
+
ββββββββββββββββββββββββββββββββββββββββ
|
|
179
|
+
β Supervisor Agent β
|
|
180
|
+
β (Grooming, Routing, Verification) β
|
|
181
|
+
ββββββββββββββββββββ¬ββββββββββββββββββββ
|
|
182
|
+
β
|
|
183
|
+
βββββββββββ΄βββββββββββ
|
|
184
|
+
βΌ βΌ
|
|
185
|
+
βββββββββββββ βββββββββββββ
|
|
186
|
+
β Internal β β External β
|
|
187
|
+
β Executor β β Executor β
|
|
188
|
+
βββββββ¬ββββββ βββββββ¬ββββββ
|
|
189
|
+
β β
|
|
190
|
+
βΌ βΌ
|
|
191
|
+
βββββββββββββ βββββββββββββ
|
|
192
|
+
β Local MCP β β 3rd Party β
|
|
193
|
+
β Servers β β CLI Tools β
|
|
194
|
+
βββββββββββββ βββββββββββββ
|
|
148
195
|
```
|
|
149
196
|
|
|
150
197
|
## Requirements
|
|
@@ -152,23 +199,6 @@ const response = await sendMessage("Hello");
|
|
|
152
199
|
- Node.js 18+ or Bun
|
|
153
200
|
- Paean AI account
|
|
154
201
|
|
|
155
|
-
## Development
|
|
156
|
-
|
|
157
|
-
### Running Locally
|
|
158
|
-
|
|
159
|
-
For development and debugging, **use npm/node instead of bun** to run the interactive agent mode. The [Ink](https://github.com/vadimdemedes/ink) library (React for CLI) has compatibility issues with Bun's runtime:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# Recommended: Use npm for development
|
|
163
|
-
npm run dev:node
|
|
164
|
-
|
|
165
|
-
# Or run directly with node
|
|
166
|
-
node --import tsx src/cli.ts
|
|
167
|
-
|
|
168
|
-
# Bun works for building but may have Ink rendering issues
|
|
169
|
-
bun run dev # Not recommended for interactive mode
|
|
170
|
-
```
|
|
171
|
-
|
|
172
202
|
## Links
|
|
173
203
|
|
|
174
204
|
- **Website**: https://paean.ai
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { AgentService, agentService } from './service.js';
|
|
6
6
|
export { startChat, sendMessage } from './chat.ink.js';
|
|
7
|
-
export { renderMarkdown,
|
|
7
|
+
export { renderMarkdown, renderError, renderSuccess, getTerminalWidth, renderSparkletCreated, renderMediaGenerated, } from './renderer.js';
|
|
8
8
|
export { createThinkingSpinner, createToolCallSpinner, createMcpSpinner, createLoadingSpinner, } from './spinner.js';
|
|
9
9
|
export type { SpinnerController, SpinnerType } from './spinner.js';
|
|
10
10
|
export { commandCompleter, renderCommandHelp, COMMANDS, getAllCommandNames, isCommand, getCommandDef, } from './completer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACH,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACH,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACvB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,aAAa,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EACR,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,GACd,MAAM,YAAY,CAAC"}
|
package/dist/agent/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { AgentService, agentService } from './service.js';
|
|
6
6
|
export { startChat, sendMessage } from './chat.ink.js';
|
|
7
|
-
export { renderMarkdown,
|
|
7
|
+
export { renderMarkdown, renderError, renderSuccess, getTerminalWidth, renderSparkletCreated, renderMediaGenerated, } from './renderer.js';
|
|
8
8
|
export { createThinkingSpinner, createToolCallSpinner, createMcpSpinner, createLoadingSpinner, } from './spinner.js';
|
|
9
9
|
export { commandCompleter, renderCommandHelp, COMMANDS, getAllCommandNames, isCommand, getCommandDef, } from './completer.js';
|
|
10
10
|
export { CLI_MODE_PROMPT, DEFAULT_CLI_MODE, createCliModeConfig, isCliModeActive, isRawStreamEnabled, } from './cli-mode.js';
|
package/dist/agent/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACH,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACH,cAAc,EACd,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,aAAa,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACrB,MAAM,eAAe,CAAC"}
|
package/dist/agent/renderer.d.ts
CHANGED
|
@@ -7,22 +7,6 @@
|
|
|
7
7
|
* Uses synchronous parsing to ensure consistent results
|
|
8
8
|
*/
|
|
9
9
|
export declare function renderMarkdown(text: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Render a tool call indicator
|
|
12
|
-
*/
|
|
13
|
-
export declare function renderToolCall(name: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Render a tool result indicator
|
|
16
|
-
*/
|
|
17
|
-
export declare function renderToolResult(name: string, success?: boolean): string;
|
|
18
|
-
/**
|
|
19
|
-
* Render MCP tool call indicator
|
|
20
|
-
*/
|
|
21
|
-
export declare function renderMcpToolCall(serverName: string, toolName: string): string;
|
|
22
|
-
/**
|
|
23
|
-
* Render MCP tool result indicator
|
|
24
|
-
*/
|
|
25
|
-
export declare function renderMcpToolResult(serverName: string, toolName: string, success?: boolean): string;
|
|
26
10
|
/**
|
|
27
11
|
* Render an error message
|
|
28
12
|
*/
|
|
@@ -35,43 +19,6 @@ export declare function renderSuccess(message: string): string;
|
|
|
35
19
|
* Get current terminal width
|
|
36
20
|
*/
|
|
37
21
|
export declare function getTerminalWidth(): number;
|
|
38
|
-
/**
|
|
39
|
-
* Render the input separator line (top) - simple horizontal line
|
|
40
|
-
*/
|
|
41
|
-
export declare function renderInputBoxTop(): string;
|
|
42
|
-
/**
|
|
43
|
-
* Render the input separator line (bottom)
|
|
44
|
-
*/
|
|
45
|
-
export declare function renderInputBoxBottom(): string;
|
|
46
|
-
/**
|
|
47
|
-
* Render the agent prompt
|
|
48
|
-
*/
|
|
49
|
-
export declare function renderPrompt(): string;
|
|
50
|
-
/**
|
|
51
|
-
* Render simple prompt (without box)
|
|
52
|
-
*/
|
|
53
|
-
export declare function renderSimplePrompt(): string;
|
|
54
|
-
/**
|
|
55
|
-
* Render the agent label
|
|
56
|
-
*/
|
|
57
|
-
export declare function renderAgentLabel(): string;
|
|
58
|
-
/**
|
|
59
|
-
* Render welcome message with clean styling
|
|
60
|
-
*/
|
|
61
|
-
export declare function renderWelcome(mcpToolCount?: number): string;
|
|
62
|
-
/**
|
|
63
|
-
* Render goodbye message
|
|
64
|
-
*/
|
|
65
|
-
export declare function renderGoodbye(): string;
|
|
66
|
-
/**
|
|
67
|
-
* Render thinking indicator
|
|
68
|
-
*/
|
|
69
|
-
export declare function renderThinking(): string;
|
|
70
|
-
/**
|
|
71
|
-
* Indent multiline text for consistent display
|
|
72
|
-
* Adds prefix to continuation lines after the first
|
|
73
|
-
*/
|
|
74
|
-
export declare function indentMultilineResponse(text: string, indentSize?: number): string;
|
|
75
22
|
/**
|
|
76
23
|
* Render sparklet created indicator
|
|
77
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/agent/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/agent/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkDH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwBnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,OAAO,GAAG,OAAO,EAC5B,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,CAKR"}
|
package/dist/agent/renderer.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Marked } from 'marked';
|
|
6
6
|
import { markedTerminal } from 'marked-terminal';
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
-
import { primary, primaryBold,
|
|
8
|
+
import { primary, primaryBold, success, error, muted, code as codeStyle, link, symbols, } from '../ui/theme/index.js';
|
|
9
9
|
// Configure marked with terminal renderer
|
|
10
10
|
// Use synchronous parsing by setting async: false
|
|
11
11
|
const marked = new Marked();
|
|
@@ -64,32 +64,6 @@ export function renderMarkdown(text) {
|
|
|
64
64
|
return text;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Render a tool call indicator
|
|
69
|
-
*/
|
|
70
|
-
export function renderToolCall(name) {
|
|
71
|
-
return muted(`${toolSymbol()} ${primary(name)}...`);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Render a tool result indicator
|
|
75
|
-
*/
|
|
76
|
-
export function renderToolResult(name, success = true) {
|
|
77
|
-
const icon = success ? symbols.success : symbols.error;
|
|
78
|
-
return muted(`${icon} Tool ${primary(name)} completed`);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Render MCP tool call indicator
|
|
82
|
-
*/
|
|
83
|
-
export function renderMcpToolCall(serverName, toolName) {
|
|
84
|
-
return muted(`${mcpSymbol()} [${warning(serverName)}] ${primary(toolName)}...`);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Render MCP tool result indicator
|
|
88
|
-
*/
|
|
89
|
-
export function renderMcpToolResult(serverName, toolName, success = true) {
|
|
90
|
-
const icon = success ? symbols.success : symbols.error;
|
|
91
|
-
return muted(`${icon} [${warning(serverName)}] ${primary(toolName)} completed`);
|
|
92
|
-
}
|
|
93
67
|
/**
|
|
94
68
|
* Render an error message
|
|
95
69
|
*/
|
|
@@ -108,94 +82,11 @@ export function renderSuccess(message) {
|
|
|
108
82
|
export function getTerminalWidth() {
|
|
109
83
|
return process.stdout.columns || 80;
|
|
110
84
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Render the input separator line (top) - simple horizontal line
|
|
113
|
-
*/
|
|
114
|
-
export function renderInputBoxTop() {
|
|
115
|
-
const width = getTerminalWidth();
|
|
116
|
-
const line = 'β'.repeat(width);
|
|
117
|
-
return muted(line);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Render the input separator line (bottom)
|
|
121
|
-
*/
|
|
122
|
-
export function renderInputBoxBottom() {
|
|
123
|
-
const width = getTerminalWidth();
|
|
124
|
-
const line = 'β'.repeat(width);
|
|
125
|
-
return muted(line);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Render the agent prompt
|
|
129
|
-
*/
|
|
130
|
-
export function renderPrompt() {
|
|
131
|
-
return `${primary('β―')} `;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Render simple prompt (without box)
|
|
135
|
-
*/
|
|
136
|
-
export function renderSimplePrompt() {
|
|
137
|
-
return primaryBold('You: ');
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Render the agent label
|
|
141
|
-
*/
|
|
142
|
-
export function renderAgentLabel() {
|
|
143
|
-
return `${secondary('β―')} ${primaryBold('PΓ¦an: ')}`;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Render welcome message with clean styling
|
|
147
|
-
*/
|
|
148
|
-
export function renderWelcome(mcpToolCount) {
|
|
149
|
-
const width = getTerminalWidth();
|
|
150
|
-
const line = 'β'.repeat(width);
|
|
151
|
-
const lines = [
|
|
152
|
-
'',
|
|
153
|
-
primary(getLogoAscii()),
|
|
154
|
-
muted(line),
|
|
155
|
-
bold(' Interactive Agent Session'),
|
|
156
|
-
];
|
|
157
|
-
if (mcpToolCount !== undefined && mcpToolCount > 0) {
|
|
158
|
-
lines.push(` ${mcpSymbol()} MCP: ${success(mcpToolCount.toString())} tools connected`);
|
|
159
|
-
}
|
|
160
|
-
lines.push(muted(' π‘ Type your message and press Enter to send'));
|
|
161
|
-
lines.push(muted(' β¨οΈ Type / then Tab for commands, Ctrl+C to exit'));
|
|
162
|
-
lines.push(muted(line));
|
|
163
|
-
lines.push('');
|
|
164
|
-
return lines.join('\n');
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Render goodbye message
|
|
168
|
-
*/
|
|
169
|
-
export function renderGoodbye() {
|
|
170
|
-
return bold(primary('\nπ Goodbye!\n'));
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Render thinking indicator
|
|
174
|
-
*/
|
|
175
|
-
export function renderThinking() {
|
|
176
|
-
return `${secondary('β―')} ${muted('π Thinking...')}`;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Indent multiline text for consistent display
|
|
180
|
-
* Adds prefix to continuation lines after the first
|
|
181
|
-
*/
|
|
182
|
-
export function indentMultilineResponse(text, indentSize = 2) {
|
|
183
|
-
const lines = text.split('\n');
|
|
184
|
-
if (lines.length <= 1) {
|
|
185
|
-
return text;
|
|
186
|
-
}
|
|
187
|
-
const indent = ' '.repeat(indentSize);
|
|
188
|
-
return lines.map((line, index) => {
|
|
189
|
-
if (index === 0)
|
|
190
|
-
return line;
|
|
191
|
-
return indent + line;
|
|
192
|
-
}).join('\n');
|
|
193
|
-
}
|
|
194
85
|
/**
|
|
195
86
|
* Render sparklet created indicator
|
|
196
87
|
*/
|
|
197
88
|
export function renderSparkletCreated(hashKey, title) {
|
|
198
|
-
return success(`\n⨠Sparklet created: ${bold(title)} (${hashKey.slice(0, 8)}...)\n`);
|
|
89
|
+
return success(`\n⨠Sparklet created: ${chalk.bold(title)} (${hashKey.slice(0, 8)}...)\n`);
|
|
199
90
|
}
|
|
200
91
|
/**
|
|
201
92
|
* Render media generated indicator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/agent/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,OAAO,EACP,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/agent/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,OAAO,EACP,WAAW,EACX,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,IAAI,SAAS,EACjB,IAAI,EACJ,OAAO,GACV,MAAM,sBAAsB,CAAC;AAE9B,0CAA0C;AAC1C,kDAAkD;AAClD,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,MAAM,CAAC,GAAG,CACN,cAAc,CAAC;IACX,cAAc;IACd,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,KAAK,CAAC,MAAM;IACxB,UAAU;IACV,OAAO,EAAE,OAAO,CAAC,IAAI;IACrB,YAAY,EAAE,WAAW;IACzB,sEAAsE;IACtE,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,C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